:root {
    --bg: #f7f5f1;
    --fg: #14201a;
    --card: #fffcf8;
    --border: #ddd6cb;
    --muted: #5c6b62;
    --primary: #1a3a2a;
    --primary-fg: #f4f7f4;
    --accent: #d4e4da;
    --danger: #b42318;
    --sidebar: #0b1220;
    --sidebar-fg: #f4f7f4;
    --sidebar-border: #1e2a3d;
    --radius: 0.75rem;
    --font-sans: "Figtree", "Segoe UI", sans-serif;
    --font-display: "Fraunces", Georgia, serif;
}

html, body {
    font-family: var(--font-sans);
    background: var(--bg);
    color: var(--fg);
    margin: 0;
    min-height: 100vh;
}

body {
    background-image:
        radial-gradient(ellipse 80% 50% at 10% -10%, rgba(26, 58, 42, 0.08), transparent),
        radial-gradient(ellipse 60% 40% at 100% 0%, rgba(196, 180, 154, 0.18), transparent);
    background-attachment: fixed;
}

h1, h2, h3, .h3, .auth-logo {
    font-family: var(--font-display);
    letter-spacing: -0.02em;
}

a, .btn-link {
    color: var(--primary);
}

.btn-primary {
    color: var(--primary-fg);
    background-color: var(--primary);
    border-color: var(--primary);
    border-radius: 0.6rem;
    padding: 0.55rem 1.1rem;
    font-weight: 600;
}

.btn-primary:hover,
.btn-primary:focus {
    background-color: #142c20;
    border-color: #142c20;
    color: var(--primary-fg);
}

.btn-outline-secondary {
    border-radius: 0.6rem;
    border-color: var(--border);
    color: var(--fg);
}

.form-control {
    border-radius: 0.6rem;
    border-color: var(--border);
    background: #fff;
    padding: 0.65rem 0.85rem;
}

.form-control:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 0.2rem rgba(26, 58, 42, 0.15);
}

.form-label {
    font-size: 0.85rem;
    color: var(--muted);
    margin-bottom: 0.35rem;
}

.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: none;
}

.table {
    --bs-table-bg: transparent;
}

.alert-danger {
    background: #fef3f2;
    border-color: #fecdca;
    color: var(--danger);
    border-radius: 0.6rem;
}

.validation-message,
.validation-summary-errors {
    color: var(--danger);
}

.content {
    padding-top: 0.25rem;
}

/* Auth pages */
.auth-shell {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 2rem 1rem;
}

.auth-panel {
    width: 100%;
    max-width: 420px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 1rem;
    padding: 2rem 1.75rem 1.75rem;
}

.auth-brand {
    margin-bottom: 1.75rem;
}

.auth-logo {
    display: block;
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--fg);
}

.auth-tagline {
    display: block;
    margin-top: 0.25rem;
    font-size: 0.85rem;
    color: var(--muted);
}

.auth-body h1 {
    font-size: 1.35rem;
    margin-bottom: 1.25rem;
}

.auth-footer {
    margin-top: 1.25rem;
    font-size: 0.9rem;
    color: var(--muted);
}

.auth-footer a {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
}

.page-header {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.25rem;
    flex-wrap: wrap;
}

.page-header h1 {
    margin: 0;
    font-size: 1.75rem;
}

.page-header p {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.95rem;
}

.empty-state {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--muted);
}

.table thead th {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--muted);
    font-weight: 600;
    border-bottom-color: var(--border);
}

.table td {
    vertical-align: middle;
    border-bottom-color: var(--border);
}

/* ---- Liste fine (style Onboarding / Abazvoove) ---- */
.list-page {
    max-width: 1200px;
}

.list-page-head {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1rem;
}

.list-page-head h1 {
    margin: 0;
    font-size: 1.5rem;
    font-weight: 600;
}

.list-eyebrow {
    margin: 0 0 0.15rem;
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--muted);
    font-weight: 600;
}

.kpi-strip {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 0.75rem;
    margin-bottom: 1rem;
}

.kpi-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    padding: 0.65rem 0.85rem;
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.kpi-label {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    font-weight: 600;
}

.kpi-value {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.1;
    font-family: var(--font-sans);
    color: var(--fg);
}

.kpi-value-sm {
    font-size: 1rem;
    font-weight: 600;
}

.list-panel {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.5rem;
    overflow: hidden;
}

.list-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.65rem 0.85rem;
    border-bottom: 1px solid var(--border);
    background: #faf8f5;
}

.list-search {
    position: relative;
    flex: 1;
    max-width: 420px;
}

.list-search-icon {
    position: absolute;
    left: 0.65rem;
    top: 50%;
    transform: translateY(-50%);
    width: 0.95rem;
    height: 0.95rem;
    color: var(--muted);
    pointer-events: none;
}

.list-search-input {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 0.4rem;
    padding: 0.4rem 0.65rem 0.4rem 2rem;
    font-size: 0.82rem;
    background: #fff;
    color: var(--fg);
}

.list-search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 2px rgba(26, 58, 42, 0.12);
}

.list-toolbar-meta {
    font-size: 0.75rem;
    color: var(--muted);
    white-space: nowrap;
}

.list-empty {
    padding: 2.5rem 1rem;
    text-align: center;
    color: var(--muted);
    font-size: 0.9rem;
}

.list-empty p {
    margin-bottom: 1rem;
}

.fine-table-wrap {
    overflow-x: auto;
}

.fine-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
    line-height: 1.3;
}

.fine-table thead th {
    position: sticky;
    top: 0;
    z-index: 1;
    background: #eef2f6;
    color: #3d4f5f;
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.45rem 0.85rem;
    border-bottom: 1px solid #d5dde6;
    white-space: nowrap;
}

.fine-table-group td {
    background: #e8f0f8;
    color: #2c4a66;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    padding: 0.3rem 0.85rem;
    border-bottom: 1px solid #d0dce8;
}

.fine-table-row {
    cursor: pointer;
    transition: background 0.1s ease;
}

.fine-table-row:hover {
    background: #f5f8fa;
}

.fine-table-row td {
    padding: 0.42rem 0.85rem;
    border-bottom: 1px solid #ece7df;
    vertical-align: middle;
}

.client-name {
    font-weight: 600;
    color: var(--fg);
}

.cell-muted {
    color: #4a5c55;
}

.cell-empty {
    color: #b0b8b3;
}

.badge-count {
    display: inline-block;
    min-width: 1.4rem;
    text-align: center;
    padding: 0.1rem 0.4rem;
    border-radius: 999px;
    background: #eef2f0;
    color: var(--muted);
    font-size: 0.75rem;
    font-weight: 600;
}

.link-action {
    background: none;
    border: none;
    padding: 0;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #1a5f7a;
    cursor: pointer;
}

.link-action:hover {
    color: #0d3d52;
    text-decoration: underline;
}

.col-client { min-width: 160px; }
.col-email { min-width: 180px; }
.col-phone { min-width: 120px; width: 130px; }
.col-trips { width: 72px; text-align: center; }
.col-action { width: 72px; text-align: right; }

.list-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.5rem 0.85rem;
    border-top: 1px solid var(--border);
    background: #faf8f5;
}

.list-footer-info {
    font-size: 0.75rem;
    color: var(--muted);
}

.list-footer-nav {
    display: flex;
    gap: 0.35rem;
}

.btn-sm {
    padding: 0.35rem 0.75rem;
    font-size: 0.78rem;
}

.btn-ghost {
    background: transparent;
    border: 1px solid var(--border);
    border-radius: 0.35rem;
    color: var(--fg);
    padding: 0.3rem 0.65rem;
    font-size: 0.75rem;
}

.btn-ghost:hover:not(:disabled) {
    background: #fff;
    border-color: #c8bfb3;
}

.btn-ghost:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

@media (max-width: 640px) {
    .kpi-strip {
        grid-template-columns: 1fr;
    }

    .col-phone,
    .col-trips {
        display: none;
    }

    .fine-table thead th.col-phone,
    .fine-table thead th.col-trips {
        display: none;
    }
}

/* Status badges */
.status-badge {
    display: inline-block;
    padding: 0.15rem 0.5rem;
    border-radius: 999px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
}

.status-draft { background: #eef0f2; color: #5c6b62; }
.status-confirmed { background: #e8f5ee; color: #1a5c3a; }
.status-progress { background: #e8f0f8; color: #1a5f7a; }
.status-completed { background: #f0f0f0; color: #666; }
.status-cancelled { background: #fef3f2; color: #b42318; }

/* Trip detail */
.trip-detail-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 1rem;
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.trip-detail-head h1 {
    margin: 0;
    font-size: 1.5rem;
}

.trip-meta {
    margin: 0.35rem 0 0;
    color: var(--muted);
    font-size: 0.9rem;
}

.trip-budget {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--fg);
}

.trip-tabs {
    display: flex;
    gap: 0.25rem;
    flex-wrap: wrap;
    margin-bottom: 0;
    border-bottom: 1px solid var(--border);
    padding-bottom: 0;
}

.trip-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 0.5rem 0.85rem;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--muted);
    cursor: pointer;
    margin-bottom: -1px;
}

.trip-tab:hover {
    color: var(--fg);
}

.trip-tab.active {
    color: var(--primary);
    border-bottom-color: var(--primary);
}

.module-placeholder h3 {
    font-size: 1rem;
    margin-bottom: 0.5rem;
}

.module-placeholder p {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 0.35rem;
}

.module-soon {
    font-size: 0.78rem !important;
    font-style: italic;
}

.form-section-title {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--muted);
    margin-bottom: 0.75rem;
    font-weight: 700;
}

.alert-success {
    background: #ecfdf3;
    border: 1px solid #abefc6;
    color: #067647;
    border-radius: 0.6rem;
    padding: 0.65rem 1rem;
}

.nav-section-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(244, 247, 244, 0.35);
    margin-top: 1rem;
    margin-bottom: 0.25rem;
    font-weight: 700;
}

.nav-item-bottom {
    margin-top: auto;
}

/* Portail voyageur */
.portal-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    max-width: 480px;
    margin: 0 auto;
    background: var(--bg);
}

.portal-main {
    flex: 1;
    padding: 1.5rem 1rem 5rem;
}

.portal-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 480px;
    display: flex;
    justify-content: space-around;
    background: #fff;
    border-top: 1px solid var(--border);
    padding: 0.65rem 0;
}

.portal-nav-item {
    font-size: 0.75rem;
    color: var(--muted);
    text-decoration: none;
    font-weight: 600;
}

.portal-home h1 {
    font-size: 1.5rem;
    margin-bottom: 0.35rem;
}

.portal-subtitle {
    color: var(--muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
}

.portal-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 0.75rem;
    padding: 1.25rem;
    margin-bottom: 1rem;
}

.portal-card h2 {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--muted);
    margin-bottom: 0.75rem;
}

.portal-card-muted {
    background: #faf8f5;
}
