/* =========================================================
   Carnet de Voyage — design système
   Palette §25 : bleu océan, sable, corail, vert nature, jaune soleil, gris doux
   ========================================================= */
:root {
    --ocean: #2563eb;
    --ocean-dark: #1d4ed8;
    --sand: #f4ecd9;
    --coral: #f97362;
    --nature: #2bb673;
    --sun: #f5b73d;
    --ink: #1f2937;
    --muted: #6b7280;
    --line: #e5e7eb;
    --bg: #f7f5f0;
    --surface: #ffffff;
    --surface-2: #faf8f3;
    --shadow: 0 1px 3px rgba(31,41,55,.08), 0 8px 24px rgba(31,41,55,.06);
    --shadow-sm: 0 1px 2px rgba(31,41,55,.08);
    --radius: 16px;
    --radius-sm: 10px;
    --sidebar-w: 256px;
    --font: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
}
[data-theme="dark"] {
    --sand: #1e293b;
    --ink: #e2e8f0;
    --muted: #94a3b8;
    --line: #334155;
    --bg: #0f172a;
    --surface: #1e293b;
    --surface-2: #243449;
    --shadow: 0 1px 3px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.3);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--ink);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}
a { color: var(--ocean); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }

/* ---- Layout ---- */
.app-shell { display: flex; min-height: 100vh; }
.app-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.app-content { padding: 1.5rem; flex: 1; }
@media (max-width: 768px) {
    .app-content { padding: 1rem; padding-bottom: 5rem; }
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-w);
    background: var(--surface);
    border-right: 1px solid var(--line);
    padding: 1.25rem 1rem;
    position: sticky; top: 0; height: 100vh;
    display: flex; flex-direction: column;
    overflow-y: auto;
}
.sidebar .brand {
    font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; gap: .5rem;
    margin-bottom: 1.5rem; color: var(--ink);
}
.sidebar .brand:hover { text-decoration: none; }
.nav-link {
    display: flex; align-items: center; gap: .75rem;
    padding: .65rem .85rem; border-radius: var(--radius-sm);
    color: var(--ink); font-weight: 500; margin-bottom: .15rem;
}
.nav-link:hover { background: var(--surface-2); text-decoration: none; }
.nav-link.active { background: var(--ocean); color: #fff; }
.nav-link i { font-size: 1.15rem; }
.sidebar-section { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); margin: 1.25rem .85rem .4rem; }
.sidebar-spacer { flex: 1; }
@media (max-width: 768px) { .sidebar { display: none; } }

/* ---- Topbar ---- */
.topbar {
    display: flex; align-items: center; justify-content: space-between;
    padding: .85rem 1.5rem; background: var(--surface);
    border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20;
}
.topbar .title { font-weight: 700; font-size: 1.05rem; }
.topbar-actions { display: flex; align-items: center; gap: .5rem; }

/* ---- Mobile bottom nav ---- */
.mobile-nav { display: none; }
@media (max-width: 768px) {
    .mobile-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0;
        background: var(--surface); border-top: 1px solid var(--line);
        padding: .4rem .25rem calc(.4rem + env(safe-area-inset-bottom)); z-index: 50;
        justify-content: space-around;
    }
    .mobile-nav a {
        display: flex; flex-direction: column; align-items: center; gap: .1rem;
        color: var(--muted); font-size: .68rem; padding: .35rem .6rem; border-radius: 10px;
    }
    .mobile-nav a.active { color: var(--ocean); }
    .mobile-nav a i { font-size: 1.35rem; }
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; gap: .45rem; cursor: pointer;
    padding: .6rem 1.05rem; border-radius: var(--radius-sm); border: 1px solid transparent;
    font-weight: 600; font-size: .92rem; font-family: inherit; transition: .15s;
    background: var(--surface-2); color: var(--ink);
}
.btn:hover { text-decoration: none; filter: brightness(.97); }
.btn-primary { background: var(--ocean); color: #fff; }
.btn-primary:hover { background: var(--ocean-dark); }
.btn-coral { background: var(--coral); color: #fff; }
.btn-nature { background: var(--nature); color: #fff; }
.btn-ghost { background: transparent; border-color: var(--line); }
.btn-danger { background: transparent; color: var(--coral); border-color: var(--coral); }
.btn-danger:hover { background: var(--coral); color: #fff; }
.btn-sm { padding: .35rem .7rem; font-size: .82rem; }
.btn-icon { padding: .5rem; border-radius: 50%; background: transparent; }
.btn-block { width: 100%; justify-content: center; }

/* ---- Cards / surfaces ---- */
.card {
    background: var(--surface); border-radius: var(--radius);
    box-shadow: var(--shadow); padding: 1.25rem; border: 1px solid var(--line);
}
.card-flush { padding: 0; overflow: hidden; }
.grid { display: grid; gap: 1.25rem; }
.grid-cards { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.stat-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); }

/* ---- Trip card (Airbnb-like) ---- */
.trip-card { background: var(--surface); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); border: 1px solid var(--line); transition: transform .15s; display: block; color: var(--ink); }
.trip-card:hover { transform: translateY(-3px); text-decoration: none; }
.trip-card .cover { height: 150px; background: linear-gradient(135deg, var(--ocean), var(--nature)); background-size: cover; background-position: center; position: relative; }
.trip-card .cover .badge-visibility { position: absolute; top: .6rem; right: .6rem; background: rgba(0,0,0,.5); color: #fff; padding: .2rem .55rem; border-radius: 999px; font-size: .72rem; }
.trip-card .body { padding: 1rem 1.1rem 1.2rem; }
.trip-card .body h3 { font-size: 1.05rem; margin-bottom: .25rem; }
.trip-card .meta { color: var(--muted); font-size: .85rem; display: flex; gap: .75rem; flex-wrap: wrap; }

/* ---- Forms ---- */
label { font-weight: 600; font-size: .88rem; display: block; margin-bottom: .35rem; }
input[type=text], input[type=email], input[type=password], input[type=url], input[type=date],
input[type=number], input[type=search], select, textarea {
    width: 100%; padding: .6rem .8rem; border: 1px solid var(--line);
    border-radius: var(--radius-sm); font-family: inherit; font-size: .95rem;
    background: var(--surface); color: var(--ink);
}
input:focus, select:focus, textarea:focus { outline: 2px solid var(--ocean); outline-offset: -1px; border-color: var(--ocean); }
.form-row { margin-bottom: 1rem; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .form-grid-2 { grid-template-columns: 1fr; } }
.form-error { color: var(--coral); font-size: .82rem; margin-top: .25rem; }
.checkbox-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .35rem; }
.checkbox-grid label { font-weight: 500; display: flex; align-items: center; gap: .4rem; cursor: pointer; }

/* ---- Flash ---- */
.flash { display: flex; align-items: center; gap: .6rem; padding: .8rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1rem; font-weight: 500; }
.flash-success { background: rgba(43,182,115,.15); color: var(--nature); }
.flash-error { background: rgba(249,115,98,.15); color: var(--coral); }
.flash-info { background: rgba(37,99,235,.12); color: var(--ocean); }

/* ---- Badges & chips ---- */
.chip { display: inline-flex; align-items: center; gap: .3rem; padding: .15rem .6rem; border-radius: 999px; font-size: .76rem; font-weight: 600; background: var(--surface-2); color: var(--muted); }
.chip-type { background: rgba(37,99,235,.12); color: var(--ocean); }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: var(--ocean); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: .8rem; flex: none; background-size: cover; }
.avatar-sm { width: 26px; height: 26px; font-size: .68rem; }
.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -8px; border: 2px solid var(--surface); }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ---- Board (Trello) ---- */
.board-wrap { overflow-x: auto; padding-bottom: 1rem; }
.board { display: flex; gap: 1rem; align-items: flex-start; min-height: 60vh; }
.board-list { background: var(--surface-2); border-radius: var(--radius); width: 290px; flex: none; display: flex; flex-direction: column; max-height: calc(100vh - 200px); border: 1px solid var(--line); }
.board-list .list-head { display: flex; align-items: center; justify-content: space-between; padding: .8rem 1rem .5rem; font-weight: 700; }
.board-list .list-head .count { color: var(--muted); font-weight: 600; font-size: .82rem; }
.board-list .cards { padding: .25rem .65rem; overflow-y: auto; flex: 1; min-height: 12px; }
.board-list .list-foot { padding: .5rem .65rem .75rem; }
.board-card { background: var(--surface); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); padding: .7rem .8rem; margin-bottom: .55rem; cursor: grab; border: 1px solid var(--line); display: block; color: var(--ink); }
.board-card:hover { text-decoration: none; border-color: var(--ocean); }
.board-card.dragging { opacity: .5; }
.board-card .cover { height: 90px; border-radius: 8px; margin: -.2rem -.2rem .5rem; background-size: cover; background-position: center; }
.board-card .card-title { font-weight: 600; font-size: .92rem; }
.board-card .card-foot { display: flex; align-items: center; gap: .5rem; flex-wrap: wrap; margin-top: .5rem; font-size: .76rem; color: var(--muted); }
.sortable-ghost { opacity: .35; }
.add-list-box { width: 290px; flex: none; }

@media (max-width: 768px) {
    .board-list { width: 80vw; max-width: 300px; }
}

/* ---- Tables ---- */
table.data { width: 100%; border-collapse: collapse; }
table.data th, table.data td { text-align: left; padding: .7rem .6rem; border-bottom: 1px solid var(--line); font-size: .9rem; }
table.data th { color: var(--muted); font-size: .78rem; text-transform: uppercase; letter-spacing: .03em; }

/* ---- Misc ---- */
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.5rem; flex-wrap: wrap; }
.text-muted { color: var(--muted); }
.text-coral { color: var(--coral); }
.text-nature { color: var(--nature); }
.fw-bold { font-weight: 700; }
.mt-1{margin-top:.5rem}.mt-2{margin-top:1rem}.mt-3{margin-top:1.5rem}
.mb-1{margin-bottom:.5rem}.mb-2{margin-bottom:1rem}.mb-3{margin-bottom:1.5rem}
.flex { display: flex; } .items-center { align-items: center; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.justify-between { justify-content: space-between; } .flex-wrap { flex-wrap: wrap; }
.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.25rem; overflow-x: auto; }
.tabs a { padding: .6rem .9rem; color: var(--muted); font-weight: 600; border-bottom: 2px solid transparent; white-space: nowrap; }
.tabs a.active { color: var(--ocean); border-bottom-color: var(--ocean); }
.progress { height: 6px; background: var(--line); border-radius: 999px; overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--nature); }
.modal-page { max-width: 760px; margin: 0 auto; }

/* ---- Auth ---- */
.auth-wrap { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; background: linear-gradient(135deg, var(--ocean) 0%, var(--nature) 100%); }
.auth-card { background: var(--surface); border-radius: 22px; box-shadow: var(--shadow); padding: 2.25rem; width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 1.6rem; }
.auth-brand { font-size: 2rem; }

/* ---- Landing ---- */
.hero { background: linear-gradient(135deg, var(--ocean), var(--nature)); color: #fff; border-radius: 0 0 32px 32px; padding: 4rem 1.5rem; text-align: center; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
.hero p { font-size: 1.15rem; max-width: 600px; margin: 1rem auto 1.75rem; opacity: .95; }
.feature-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.25rem; max-width: 1000px; margin: 2.5rem auto; padding: 0 1.5rem; }
.feature { background: var(--surface); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.feature i { font-size: 2rem; color: var(--ocean); }
