/* =========================================================================
   DailyBoost — habillage corporate
   Design tokens : pour rebrander, ne modifier QUE le bloc :root ci-dessous.
   ========================================================================= */
:root {
    /* Couleurs de marque — ALIGNÉES sur le design system d'Alain (design-system.css).
       On référence ses tokens : si Alain fait évoluer sa charte, le chrome suit. */
    --brand-primary:      var(--color-primary-700);   /* vert profond — header / sidebar */
    --brand-primary-700:  var(--color-primary-900);   /* vert très foncé — hover         */
    --brand-accent:       var(--color-primary-600);   /* vert de marque — actions, liens, actif */
    --brand-accent-700:   var(--color-primary-700);

    /* Surfaces & texte — tokens du design system */
    --bg:        var(--color-surface-2);
    --surface:   var(--color-surface);
    --text:      var(--color-ink);
    --muted:     var(--color-muted);
    --border:    var(--color-line);

    /* Statuts (réutilisés par les dashboards) */
    --ok:    var(--color-success);
    --warn:  var(--color-warning);
    --danger:var(--color-danger);

    /* Forme */
    --radius:   12px;
    --radius-sm:8px;
    --shadow:   0 1px 3px rgba(16,24,40,.06), 0 1px 2px rgba(16,24,40,.04);
    --shadow-lg:0 10px 30px rgba(16,24,40,.10);
    --font:     var(--font-sans);

    /* Gabarit */
    --header-h: 58px;
    --sidebar-w:192px;
}

* { box-sizing: border-box; }

/* Icônes monochromes (jeu partagé avec le design system, sprite _ds_icons.html) */
.ds-ico {
    width: 18px; height: 18px; display: inline-block; vertical-align: -.18em;
    fill: none; stroke: currentColor; stroke-width: 2;
    stroke-linecap: round; stroke-linejoin: round; flex: none;
}
.ds-icon-sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

html, body {
    margin: 0;
    font-family: var(--font);
    color: var(--text);
    background: var(--bg);
    font-size: 15px;
    line-height: 1.5;
}

a { color: var(--brand-accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ---------- Header ------------------------------------------------------- */
.app-header {
    position: fixed; top: 0; left: 0; right: 0; height: var(--header-h);
    display: flex; align-items: center; justify-content: space-between;
    padding: 0 22px;
    background: var(--brand-primary);
    color: #fff;
    z-index: 100;
}
.app-header .brand {
    display: flex; align-items: center; gap: 10px;
    font-weight: 700; letter-spacing: .2px; font-size: 16px; color: #fff;
}
.app-header .brand .logo {
    width: 28px; height: 28px; border-radius: 7px;
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-300));
    display: grid; place-items: center; font-size: 15px;
}
.app-header .user-box { display: flex; align-items: center; gap: 12px; font-size: 14px; }
.app-header .user-box .name { color: #e5e7eb; }
.app-header .chip {
    background: rgba(255,255,255,.12); color: #fff;
    padding: 3px 10px; border-radius: 999px; font-size: 12px;
}

/* ---------- Sidebar ------------------------------------------------------ */
.app-sidebar {
    position: fixed; top: var(--header-h); bottom: 0; left: 0; width: var(--sidebar-w);
    background: var(--surface); border-right: 1px solid var(--border);
    padding: 16px 12px; overflow-y: auto;
}
.app-sidebar .nav-section {
    font-size: 11px; text-transform: uppercase; letter-spacing: .6px;
    color: var(--muted); margin: 14px 8px 6px;
}
.app-sidebar a.nav-link {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 12px; border-radius: var(--radius-sm);
    color: var(--text); font-weight: 500; font-size: 14px; margin-bottom: 2px;
}
.app-sidebar a.nav-link:hover { background: var(--color-primary-050); text-decoration: none; }
.app-sidebar a.nav-link.active {
    background: var(--brand-accent); color: #fff;
}
.app-sidebar .nav-ico { width: 18px; text-align: center; }

/* ---------- Layout principal --------------------------------------------- */
.app-main {
    margin-top: var(--header-h); margin-left: var(--sidebar-w);
    padding: 24px 12px; max-width: none;
}
.page-title { margin: 0 0 4px; font-size: 22px; font-weight: 700; }
.page-subtitle { color: var(--muted); margin: 0 0 24px; }

/* ---------- Cartes / tuiles ---------------------------------------------- */
.tiles { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.tile {
    display: block; padding: 20px; background: var(--surface);
    border: 1px solid var(--border); border-radius: var(--radius);
    box-shadow: var(--shadow); color: inherit;
    transition: box-shadow .15s, transform .15s, border-color .15s;
}
.tile:hover { box-shadow: var(--shadow-lg); transform: translateY(-2px); border-color: var(--color-line-strong); text-decoration: none; }
.tile .tile-ico {
    width: 42px; height: 42px; border-radius: 10px; margin-bottom: 14px;
    display: grid; place-items: center; font-size: 20px;
    background: var(--color-primary-100); color: var(--brand-accent);
}
.tile h3 { margin: 0 0 4px; font-size: 16px; }
.tile .tile-meta { font-size: 12px; color: var(--muted); }

/* ---------- Badges & divers ---------------------------------------------- */
.badge-soft {
    display: inline-block; padding: 3px 10px; border-radius: 999px;
    background: var(--color-primary-100); color: var(--brand-accent-700); font-size: 12px; font-weight: 600;
}
.empty-state {
    padding: 40px; text-align: center; color: var(--muted);
    background: var(--surface); border: 1px dashed var(--border); border-radius: var(--radius);
}

/* ---------- Boutons ------------------------------------------------------ */
.btn-brand {
    display: inline-block; background: var(--brand-accent); color: #fff;
    border: none; padding: 10px 20px; border-radius: var(--radius-sm);
    font-weight: 600; font-size: 14px; cursor: pointer; font-family: var(--font);
}
.btn-brand:hover { background: var(--brand-accent-700); text-decoration: none; }
.btn-link-light {
    background: none; border: none; color: #cbd5e1; cursor: pointer;
    padding: 0; font: inherit; font-size: 14px;
}
.btn-link-light:hover { color: #fff; text-decoration: underline; }

/* ---------- Login -------------------------------------------------------- */
.login-wrap { min-height: 100vh; display: grid; place-items: center; background: var(--brand-primary); }
.login-card {
    width: 380px; max-width: 92vw; background: var(--surface);
    border-radius: 16px; box-shadow: var(--shadow-lg); padding: 34px 32px;
}
.login-card .brand-row { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.login-card .brand-row .logo {
    width: 34px; height: 34px; border-radius: 9px;
    background: linear-gradient(135deg, var(--color-primary-500), var(--color-primary-300));
    display: grid; place-items: center; font-size: 18px; color: #fff;
}
.login-card h1 { font-size: 19px; margin: 0; }
.login-card .hint { color: var(--muted); font-size: 13px; margin: 2px 0 22px; }
.login-card label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 5px; }
.login-card input[type=text], .login-card input[type=password] {
    width: 100%; padding: 10px 12px; border: 1px solid var(--border);
    border-radius: var(--radius-sm); font-size: 14px; margin-bottom: 16px; font-family: var(--font);
}
.login-card input:focus { outline: none; border-color: var(--brand-accent); box-shadow: 0 0 0 3px rgba(0,126,83,.15); }
.login-card .btn-brand { width: 100%; }
.login-error { background: #fef2f2; color: var(--danger); padding: 10px 12px; border-radius: var(--radius-sm); font-size: 13px; margin-bottom: 16px; }
.demo-accounts { margin-top: 22px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 12.5px; color: var(--muted); }
.demo-accounts code { background: #f1f5f9; padding: 1px 6px; border-radius: 5px; color: var(--text); }

/* ---------- Embed dashboard --------------------------------------------- */
.dash-frame {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); box-shadow: var(--shadow); padding: 8px; margin-top: 16px;
}
.breadcrumb-link { font-size: 13px; color: var(--muted); }

/* ---------- Accessibilité : focus clavier & mouvement réduit ------------- */
.app-sidebar a.nav-link:focus-visible,
.tile:focus-visible,
a:focus-visible {
    outline: 2px solid var(--brand-accent); outline-offset: 2px; border-radius: var(--radius-sm);
}
/* Éléments sur l'en-tête sombre : anneau clair pour le contraste. */
.app-header .brand:focus-visible,
.btn-link-light:focus-visible {
    outline: 2px solid #fff; outline-offset: 2px; border-radius: var(--radius-sm);
}
.app-sidebar a.nav-link.active:focus-visible { outline-color: #fff; outline-offset: -2px; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: .001ms !important;
        transition-duration: .001ms !important;
    }
    .tile:hover { transform: none; }
}
