* {
	box-sizing: border-box;
}

:root {
	--bg-base: #edf4ff;
	--bg-contrast: #d7e6ff;
	--surface: #ffffff;
	--surface-soft: #f7faff;
	--text-main: #172033;
	--text-muted: #4d5f7d;
	--line: #c7d6ee;
	--brand: #1450b8;
	--brand-strong: #0f3f93;
	--accent: #f08a24;
	--danger: #991b1b;
	--success: #166534;
	--radius-lg: 18px;
	--radius-md: 12px;
	--shadow-soft: 0 10px 30px rgba(20, 80, 184, 0.1);
	--shadow-card: 0 16px 36px rgba(23, 32, 51, 0.15);
}

body {
	margin: 0;
	font-family: "Trebuchet MS", "Lucida Sans Unicode", "Lucida Grande", "Segoe UI", sans-serif;
	color: var(--text-main);
	background: var(--bg-base);
	min-height: 100vh;
}

a {
	color: var(--brand);
	text-underline-offset: 2px;
}

.auth-page,
.dashboard-page {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-direction: column;
	padding: 24px;
	gap: 24px;
}

.auth-card,
.dashboard-card {
	width: min(980px, 100%);
	margin-inline: auto;
	background: linear-gradient(180deg, var(--surface) 0%, var(--surface-soft) 100%);
	border-radius: var(--radius-lg);
	padding: 26px;
	box-shadow: var(--shadow-card);
	border: 1px solid rgba(20, 80, 184, 0.12);
	animation: card-enter 320ms ease-out;
}

.auth-card {
	width: min(520px, 100%);
}

.auth-card h1,
.dashboard-card h1,
.dashboard-card h2 {
	margin-top: 0;
}

input[type="checkbox"] {
	padding: 0;
	width: 16px;
	height: 16px;
	accent-color: var(--brand);
	vertical-align: middle;
	margin-right: 8px;
}

.page-title {
	font-size: clamp(1.6rem, 1.2rem + 1.2vw, 2.3rem);
	letter-spacing: 0.02em;
	margin-bottom: 10px;
}

.page-subtitle {
	color: var(--text-muted);
	font-size: clamp(1rem, 0.92rem + 0.35vw, 1.25rem);
	margin-bottom: 8px;
}

.page-lead {
	margin: 0;
	font-size: 0.98rem;
	color: #334566;
}

.section-title {
	font-size: 1.18rem;
	margin: 0 0 14px;
}

.ticket-list-title {
	margin-top: 8px;
}

.client-hero {
	padding: 16px 18px;
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	background: #eef4ff;
	margin-bottom: 16px;
}

.auth-hero {
	margin-bottom: 12px;
}

.auth-brand {
	display: flex;
	justify-content: center;
	margin-bottom: 10px;
}

.auth-brand-logo {
	max-width: min(320px, 72vw);
	height: auto;
	object-fit: contain;
	filter: drop-shadow(0 8px 16px rgba(20, 80, 184, 0.18));
}

.auth-form {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

label {
	font-weight: 600;
	color: #334047;
}

input,
select,
textarea,
button {
	font: inherit;
	padding: 10px 12px;
	border: 1px solid #cbd5e1;
	border-radius: 8px;
	background: #ffffff;
}

input:focus,
select:focus,
textarea:focus {
	outline: none;
	border-color: var(--brand);
	box-shadow: 0 0 0 3px rgba(20, 80, 184, 0.2);
}

button,
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 42px;
	padding: 10px 16px;
	background: linear-gradient(180deg, var(--brand), var(--brand-strong));
	color: #ffffff;
	border: none;
	border-radius: 10px;
	text-decoration: none;
	font-weight: 700;
	line-height: 1;
	white-space: nowrap;
	cursor: pointer;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	box-shadow: 0 8px 14px rgba(20, 80, 184, 0.24);
}

.btn:visited,
.btn-secondary:visited {
	color: #ffffff;
}

button:hover,
.btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 18px rgba(20, 80, 184, 0.28);
}

.btn-secondary {
	background: linear-gradient(180deg, #5a6672, #475460);
}

.btn-danger {
	background: linear-gradient(180deg, #dc2626, #b91c1c);
	color: #ffffff;
	box-shadow: 0 8px 14px rgba(185, 28, 28, 0.3);
}

.btn-danger:hover {
	box-shadow: 0 10px 18px rgba(185, 28, 28, 0.36);
}

.btn-danger:visited {
	color: #ffffff;
}

.btn-reset {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 42px;
	padding: 10px 14px;
	background: #ffffff;
	color: #354149;
	border: 1px solid #b8c8e8;
	border-radius: 10px;
	font-weight: 600;
	text-decoration: none;
	box-shadow: none;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.btn-reset:visited {
	color: #354149;
}

.btn-reset:hover {
	background: #eef4ff;
	border-color: #8ba6db;
	color: #243038;
	transform: translateY(-1px);
	box-shadow: none;
}

.btn-reset:focus-visible {
	outline: none;
	box-shadow: 0 0 0 3px rgba(53, 84, 68, 0.22);
}

.btn-small {
	padding: 6px 10px;
	font-size: 0.85rem;
}

.alert {
	border-radius: var(--radius-md);
	padding: 13px 14px;
	margin-bottom: 14px;
	box-shadow: var(--shadow-soft);
}

.alert p {
	margin: 4px 0;
}

.alert-error {
	background: #fee2e2;
	color: #991b1b;
	border: 1px solid #fecaca;
}

.alert-success {
	background: #dcfce7;
	color: #166534;
	border: 1px solid #86efac;
}

.dashboard-header,
.admin-nav {
	width: min(980px, 100%);
	margin-inline: auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
}

.admin-nav {
	padding: 12px 16px;
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.82);
	backdrop-filter: blur(4px);
}

.brand-link {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	text-decoration: none;
	color: var(--text-main);
}

.brand-logo {
	height: 38px;
	width: auto;
	object-fit: contain;
	filter: drop-shadow(0 4px 10px rgba(20, 80, 184, 0.2));
}

.brand-title {
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #123a87;
}

.nav-links {
	display: inline-flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}

.admin-nav a {
	text-decoration: none;
	font-weight: 600;
}

.actions {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	margin-top: 16px;
}

.actions-top {
	margin-top: 0;
}

.row-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.row-actions-inline {
	flex-wrap: nowrap;
	align-items: center;
}

.table-actions-cell {
	width: 200px;
	vertical-align: middle;
}

.action-btn {
	min-width: 86px;
}

.inline-form {
	margin: 0;
	display: inline;
}

.deletable-row {
	display: flex;
	align-items: flex-start;
	gap: 8px;
}

.deletable-row .message-content {
	flex: 1;
	min-width: 0;
}

.delete-inline-form {
	margin: 0;
	flex: 0 0 auto;
}

.delete-inline-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 18px;
	height: 18px;
	min-height: 0;
	padding: 0;
	border: none;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	color: #c0392b;
	font-size: 0.9rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	opacity: 0.75;
	transition: opacity 0.15s ease, background-color 0.15s ease;
}

.delete-inline-btn:hover {
	opacity: 1;
	background-color: rgba(192, 57, 43, 0.12);
}

.admin-section + .admin-section {
	margin-top: 24px;
	padding-top: 20px;
	border-top: 1px solid var(--line);
}

.admin-form {
	margin-top: 12px;
}

.search-form,
.create-discussion-form,
.reply-form {
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	background: #ffffff;
	box-shadow: var(--shadow-soft);
}

.reply-form {
	display: grid;
	gap: 14px;
	padding: 16px;
	border-color: #c3d5f4;
	background: #f7fbff;
	box-shadow: 0 12px 24px rgba(20, 80, 184, 0.1);
}

.reply-form .form-grid {
	grid-template-columns: minmax(300px, 1.35fr) minmax(260px, 1fr);
	gap: 14px 16px;
	align-items: start;
}

.reply-form .form-field {
	gap: 8px;
}

.reply-form .form-field label {
	line-height: 1.25;
	color: #233c65;
}

.reply-form textarea {
	min-height: 122px;
	resize: vertical;
	background: #ffffff;
	border-color: #b9ccee;
}

.reply-form input[type="file"] {
	padding: 8px 10px;
	border: 1px dashed #abc2e9;
	border-radius: 10px;
	background: #f1f7ff;
}

.reply-form input[type="file"]::file-selector-button {
	margin-right: 10px;
	padding: 7px 11px;
	border: none;
	border-radius: 8px;
	font-weight: 700;
	color: #ffffff;
	background: var(--brand);
	box-shadow: 0 4px 10px rgba(20, 80, 184, 0.25);
	cursor: pointer;
}

.reply-form > .btn {
	justify-self: start;
	padding-inline: 20px;
	background: var(--brand);
	box-shadow: 0 10px 18px rgba(20, 80, 184, 0.3);
}

.reply-form > .btn:hover {
	box-shadow: 0 12px 22px rgba(20, 80, 184, 0.36);
}

.reply-form > .btn:focus-visible {
	outline: none;
	box-shadow:
		0 0 0 3px rgba(20, 80, 184, 0.22),
		0 10px 18px rgba(20, 80, 184, 0.3);
}

.panel-form {
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	background: #ffffff;
	box-shadow: var(--shadow-soft);
}

.panel-card {
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	background: #ffffff;
	box-shadow: var(--shadow-soft);
}

.form-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 12px;
}

.search-inline-row {
	display: grid;
	grid-template-columns: 1fr auto;
	gap: 10px;
	align-items: end;
}

.form-field {
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.field-help {
	margin: 0;
	font-size: 0.85rem;
	color: #516483;
}

.settings-form {
	padding: 16px;
	border-color: #c8d7ef;
	background: linear-gradient(180deg, #ffffff 0%, #f5f9ff 100%);
}

.settings-grid {
	display: grid;
	grid-template-columns: minmax(260px, 1.2fr) minmax(240px, 1fr);
	gap: 12px 16px;
	align-items: start;
}

.settings-status-field select {
	min-height: 42px;
}

.settings-urgent-field {
	padding: 12px;
	border: 1px solid #d5e1f4;
	border-radius: 10px;
	background: #ffffff;
}

.urgent-toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	font-weight: 700;
	color: #22334f;
	cursor: pointer;
}

.urgent-toggle input[type="checkbox"] {
	width: 18px;
	height: 18px;
	margin-right: 0;
	flex: 0 0 auto;
}

.settings-hint {
	margin: 8px 0 0;
	font-size: 0.86rem;
	line-height: 1.35;
	color: #5a6e90;
}

.settings-actions {
	margin-top: 14px;
}

.create-claim-form {
	padding: 18px;
	border-color: #bed1f0;
	background: linear-gradient(180deg, #ffffff 0%, #f6f9ff 100%);
	box-shadow: 0 12px 24px rgba(20, 80, 184, 0.1);
}

.create-claim-grid {
	grid-template-columns: repeat(12, minmax(0, 1fr));
	gap: 12px 10px;
}

.create-claim-grid > .form-field {
	grid-column: span 4;
	gap: 7px;
}

.create-claim-grid .create-claim-message-field,
.create-claim-grid .create-claim-file-field {
	grid-column: span 6;
}

.create-claim-form label {
	color: #1f365f;
	font-weight: 700;
}

.create-claim-form input,
.create-claim-form textarea {
	border-color: #b6c9ea;
	background: #ffffff;
}

.create-claim-form textarea {
	min-height: 116px;
	resize: vertical;
}

.create-claim-file-field input[type="file"] {
	padding: 8px 10px;
	border: 1px dashed #a8bde5;
	border-radius: 10px;
	background: #f2f7ff;
}

.create-claim-file-field input[type="file"]::file-selector-button {
	margin-right: 10px;
	padding: 7px 11px;
	border: none;
	border-radius: 8px;
	font-weight: 700;
	color: #ffffff;
	background: var(--brand);
	box-shadow: 0 4px 10px rgba(20, 80, 184, 0.24);
	cursor: pointer;
}

.create-claim-actions {
	margin-top: 14px;
}

.create-claim-actions .btn {
	min-width: 180px;
}

.open-ticket-filter-form {
	margin-top: 8px;
	padding: 10px 12px;
	background: #fbfdff;
	box-shadow: none;
}

.open-ticket-filter-form .form-grid {
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 8px 10px;
}

.open-ticket-filter-form .form-field {
	gap: 4px;
}

.open-ticket-filter-form .form-field label {
	font-size: 0.92rem;
	font-weight: 600;
	color: #2a3b59;
}

.open-ticket-filter-form input,
.open-ticket-filter-form select {
	height: 36px;
	padding: 6px 10px;
	border-radius: 8px;
}

.open-ticket-filter-actions {
	margin-top: 10px;
	gap: 8px;
}

.open-ticket-filter-meta {
	margin-top: 8px;
	margin-bottom: 10px;
	font-size: 0.92rem;
	color: #3c4f72;
}

.result-box {
	margin-top: 20px;
	padding: 14px;
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	background: rgba(255, 255, 255, 0.72);
	box-shadow: var(--shadow-soft);
}

.result-box h3 {
	margin-top: 0;
}

.result-box pre {
	margin: 0;
	white-space: pre-wrap;
	word-break: break-word;
}

.transport-results {
	display: grid;
	gap: 14px;
}

.expedition-card {
	padding: 14px;
	border-radius: var(--radius-md);
	border: 1px solid #d2def4;
	background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
	box-shadow: 0 8px 16px rgba(34, 43, 47, 0.08);
	animation: card-enter 260ms ease-out;
}

.expedition-title {
	margin: 0 0 10px;
	font-size: 1.08rem;
}

.notice-substitution {
	margin: 0 0 10px;
	padding: 8px 12px;
	border-left: 4px solid #f59e0b;
	background: #fffbeb;
	color: #78350f;
	border-radius: 0 var(--radius-md) var(--radius-md) 0;
	font-size: 0.93rem;
}

.expedition-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
	gap: 8px 12px;
	margin-bottom: 8px;
}

.expedition-grid p,
.tracking-row {
	margin: 0;
	line-height: 1.4;
}

.label {
	font-weight: 700;
	color: #2f3a41;
}

.value {
	color: var(--text-main);
}

.tracking-row {
	margin: 8px 0 14px;
}

.tracking-link {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border-radius: 999px;
	background: rgba(20, 80, 184, 0.12);
	text-decoration: none;
	font-weight: 600;
}

.tracking-embed {
	margin: 8px 0;
	border: 1px solid #cfd9ee;
	border-radius: var(--radius-md);
	overflow: hidden;
	background: #fff;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.35);
}

.tracking-iframe {
	display: block;
	width: 100%;
	min-height: 430px;
	border: 0;
	background: #f6f9ff;
}

.tracking-hint {
	margin: 6px 0 12px;
	font-size: 0.9rem;
	color: var(--text-muted);
}

.thread-card {
	margin-top: 10px;
	padding: 12px;
	border-radius: var(--radius-md);
	border: 1px solid #d3def3;
	background: #fcfdff;
}

.status-badge {
	display: inline-flex;
	align-items: center;
	padding: 3px 10px;
	border-radius: 999px;
	font-size: 0.78rem;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	vertical-align: middle;
	margin-left: 6px;
	border: 1px solid transparent;
}

.status-open {
	background: #dcfce7;
	color: #166534;
	border-color: #86efac;
}

.status-closed {
	background: #fee2e2;
	color: #991b1b;
	border-color: #fecaca;
}

.status-urgent {
	background: #fff7ed;
	color: #9a3412;
	border-color: #fdba74;
}

.thread-conversation-card {
	margin-top: 14px;
}

.statut-edit-form {
	display: flex;
	gap: 8px;
	align-items: center;
}

.discussion-thread {
	margin: 12px 0;
	padding: 6px 0;
	display: grid;
	gap: 12px;
}

.conversation-block {
	margin-top: 12px;
	padding: 14px;
	border: 1px solid #bfd3f5;
	border-left: 4px solid #3e6fc5;
	border-radius: 12px;
	background: linear-gradient(180deg, #f9fbff 0%, #f4f8ff 100%);
	box-shadow: 0 10px 20px rgba(20, 80, 184, 0.08);
	display: grid;
	gap: 12px;
}

.conversation-header {
	padding: 8px 10px;
	border-radius: 10px;
	background: #ffffff;
	border: 1px solid #d5e2fa;
}

.conversation-title {
	margin: 0;
	font-size: 1rem;
	color: #1f3f77;
}

.conversation-subtitle {
	margin: 4px 0 0;
	font-size: 0.86rem;
	color: #4e6385;
}

.conversation-reply-box {
	margin-top: 4px;
}

.conversation-reply-box h5 {
	margin: 0 0 8px;
}

.conversation-close-form {
	margin-top: 2px;
}

.discussion-message {
	position: relative;
	padding: 11px 12px 11px 12px;
	border-radius: 14px;
	border: 1px solid #dde5d7;
	background: #ffffff;
	max-width: min(86%, 720px);
	box-shadow: 0 8px 16px rgba(34, 43, 47, 0.08);
}

.message-side-left {
	justify-self: start;
}

.message-side-right {
	justify-self: end;
}

.close-discussion-form {
	margin: 8px 0 12px;
}

.discussion-closed-note {
	margin: 12px 0 0;
	padding: 10px 12px;
	border-radius: 10px;
	background: #fff7ed;
	border: 1px solid #fed7aa;
	color: #9a3412;
}

.attachment-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	flex-wrap: wrap;
	margin-bottom: 8px;
}

.attachment-main {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	min-width: 0;
}

.message-meta {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 10px;
	margin: 0 0 8px;
	font-size: 0.86rem;
}

.message-role {
	font-weight: 700;
	letter-spacing: 0.01em;
}

.message-date {
	color: #5a646b;
	font-size: 0.8rem;
	white-space: nowrap;
}

.message-content {
	margin: 0;
	line-height: 1.45;
	white-space: pre-wrap;
	word-break: break-word;
}

.message-role-client {
	background: linear-gradient(180deg, #eef5ff 0%, #f7fbff 100%);
	border-color: #cfe1fb;
}

.message-role-client .message-role {
	color: #1e4f97;
}

.message-role-salarie {
	background: linear-gradient(180deg, #fff1e5 0%, #fff8f1 100%);
	border-color: #f8d0ad;
}

.message-role-salarie .message-role {
	color: #b45309;
}

.attachment-thumb-link {
	display: inline-block;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid #d9e1d4;
	box-shadow: var(--shadow-soft);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.attachment-thumb-link:hover {
	transform: translateY(-1px);
	box-shadow: 0 10px 18px rgba(20, 80, 184, 0.28);
}

.attachment-thumb {
	display: block;
	width: min(220px, 100%);
	height: auto;
	max-height: 160px;
	object-fit: cover;
	background: #f1f5ef;
}

.message-initial {
	position: relative;
}

table {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0;
}

.table-wrap {
	overflow-x: auto;
	border: 1px solid var(--line);
	border-radius: var(--radius-md);
	background: #ffffff;
}

.table-wrap table {
	margin: 0;
}

th,
td {
	border-bottom: 1px solid #e2e8f0;
	text-align: left;
	padding: 10px;
}

@keyframes card-enter {
	from {
		opacity: 0;
		transform: translateY(8px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

@media (max-width: 640px) {
	.auth-page,
	.dashboard-page {
		padding: 14px;
	}

	.admin-nav {
		padding: 10px 12px;
	}

	.brand-logo {
		height: 32px;
	}

	.brand-title {
		font-size: 0.9rem;
	}

	.nav-links {
		width: 100%;
		justify-content: flex-end;
	}

	.auth-card,
	.dashboard-card {
		padding: 16px;
	}

	.auth-brand-logo {
		max-width: min(250px, 78vw);
	}

	.client-hero {
		padding: 14px;
	}

	.expedition-grid {
		grid-template-columns: 1fr;
	}

	.search-form,
	.create-discussion-form,
	.reply-form {
		padding: 12px;
	}

	.open-ticket-filter-form {
		padding: 10px;
	}

	.open-ticket-filter-form .form-grid {
		grid-template-columns: 1fr;
	}

	.settings-grid {
		grid-template-columns: 1fr;
	}

	.settings-actions .btn {
		width: 100%;
	}

	.create-claim-grid > .form-field,
	.create-claim-grid .create-claim-message-field,
	.create-claim-grid .create-claim-file-field {
		grid-column: span 12;
	}

	.create-claim-actions .btn {
		width: 100%;
	}

	.reply-form .form-grid {
		grid-template-columns: 1fr;
	}

	.reply-form > .btn {
		width: 100%;
		justify-self: stretch;
	}

	.search-inline-row {
		grid-template-columns: 1fr;
	}

	.discussion-message {
		max-width: 100%;
	}

	.conversation-block {
		padding: 12px;
	}
}
