/* =====================================================================
   OPTITECH ERP — design system
   Palette tirée du logo officiel (voir docs/IDENTITE-VISUELLE.md) :
     Bleu OptiTech  #004AAD  — confiance, technologie : actions, navigation active
     Or OptiTech    #FEBD59  — ambition, énergie : accents, repères (jamais pour du texte sur blanc)
     Crème circuit  #FDE1B6  — motif « circuit » : décor, séparateurs
   ===================================================================== */

@font-face { font-family: "Inter"; font-weight: 400; font-display: swap; src: url("../vendor/inter/inter-latin-400-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 500; font-display: swap; src: url("../vendor/inter/inter-latin-500-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 600; font-display: swap; src: url("../vendor/inter/inter-latin-600-normal.woff2") format("woff2"); }
@font-face { font-family: "Inter"; font-weight: 700; font-display: swap; src: url("../vendor/inter/inter-latin-700-normal.woff2") format("woff2"); }

:root {
    /* Marque */
    --ot-blue: #004aad;
    --ot-blue-700: #003c8c;
    --ot-blue-900: #0a2552;      /* encre : titres, chiffres */
    --ot-blue-100: #d6e4f7;
    --ot-blue-50: #edf3fc;
    --ot-gold: #febd59;
    --ot-gold-600: #e9a23b;
    --ot-gold-text: #8a5a00;     /* or lisible sur fond clair (contraste AA) */
    --ot-gold-50: #fff6e6;
    --ot-cream: #fde1b6;

    /* Neutres */
    --ot-surface: #f6f7fb;
    --ot-card: #ffffff;
    --ot-border: #e4e8f0;
    --ot-text: #1f2a44;
    --ot-muted: #667085;
    --ot-success: #0f7b5f;
    --ot-danger: #c8322b;

    --ot-radius: 14px;
    --ot-sidebar-w: 260px;
    --ot-shadow: 0 1px 2px rgba(10, 37, 82, .04), 0 4px 16px rgba(10, 37, 82, .04);

    --bs-body-font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
    --bs-body-color: var(--ot-text);
    --bs-body-bg: var(--ot-surface);
    --bs-primary: var(--ot-blue);
    --bs-primary-rgb: 0, 74, 173;
    --bs-link-color: var(--ot-blue);
    --bs-link-color-rgb: 0, 74, 173;
    --bs-link-hover-color: var(--ot-blue-700);
    --bs-link-hover-color-rgb: 0, 60, 140;
    --bs-border-color: var(--ot-border);
    --bs-focus-ring-color: rgba(0, 74, 173, .2);
}

body { font-size: .9375rem; -webkit-font-smoothing: antialiased; }
h1, h2, h3, h4, h5 { color: var(--ot-blue-900); font-weight: 600; letter-spacing: -.015em; }
.text-muted { color: var(--ot-muted) !important; }
.text-primary { color: var(--ot-blue) !important; }
.tabular { font-variant-numeric: tabular-nums; }
::selection { background: var(--ot-cream); color: var(--ot-blue-900); }

/* ---------- Boutons et champs ---------- */
.btn { border-radius: 10px; font-weight: 500; }
.btn-primary {
    --bs-btn-bg: var(--ot-blue); --bs-btn-border-color: var(--ot-blue);
    --bs-btn-hover-bg: var(--ot-blue-700); --bs-btn-hover-border-color: var(--ot-blue-700);
    --bs-btn-active-bg: var(--ot-blue-900); --bs-btn-active-border-color: var(--ot-blue-900);
    --bs-btn-disabled-bg: var(--ot-blue); --bs-btn-disabled-border-color: var(--ot-blue);
    --bs-btn-focus-shadow-rgb: 0, 74, 173;
}
.btn-outline-primary {
    --bs-btn-color: var(--ot-blue); --bs-btn-border-color: var(--ot-blue-100);
    --bs-btn-hover-bg: var(--ot-blue-50); --bs-btn-hover-color: var(--ot-blue); --bs-btn-hover-border-color: var(--ot-blue);
    --bs-btn-active-bg: var(--ot-blue-50); --bs-btn-active-color: var(--ot-blue); --bs-btn-active-border-color: var(--ot-blue);
}
.btn-outline-secondary {
    --bs-btn-color: var(--ot-text); --bs-btn-border-color: var(--ot-border);
    --bs-btn-hover-bg: var(--ot-surface); --bs-btn-hover-color: var(--ot-blue-900); --bs-btn-hover-border-color: #cfd6e2;
    --bs-btn-active-bg: var(--ot-surface); --bs-btn-active-color: var(--ot-blue-900); --bs-btn-active-border-color: #cfd6e2;
}
.form-control, .form-select { border-radius: 10px; border-color: var(--ot-border); padding: .6rem .85rem; }
.form-control:focus, .form-select:focus { border-color: var(--ot-blue); box-shadow: 0 0 0 .2rem rgba(0, 74, 173, .14); }
.form-label { font-weight: 500; font-size: .875rem; color: var(--ot-blue-900); }
.input-group .btn { border-color: var(--ot-border); }

/* ---------- Motif « circuit » (repris des tracés du logo) ---------- */
.ot-circuit { position: relative; height: 10px; }
.ot-circuit::before { content: ""; position: absolute; left: 0; right: 14px; top: 50%; border-top: 2px solid var(--ot-cream); }
.ot-circuit::after {
    content: ""; position: absolute; right: 0; top: 50%; width: 10px; height: 10px; margin-top: -5px;
    border: 2px solid var(--ot-cream); border-radius: 50%; background: var(--ot-card);
}

/* ---------- Cartes ---------- */
.ot-card { background: var(--ot-card); border: 1px solid var(--ot-border); border-radius: var(--ot-radius); box-shadow: var(--ot-shadow); }
.ot-card-header { padding: 1rem 1.25rem; border-bottom: 1px solid var(--ot-border); display: flex; align-items: center; justify-content: space-between; gap: .75rem; }
.ot-card-header h2 { font-size: 1rem; margin: 0; }
.ot-card-body { padding: 1.25rem; }

.ot-kpi { padding: 1.15rem 1.25rem; height: 100%; }
.ot-kpi .label { font-size: .8125rem; color: var(--ot-muted); display: flex; align-items: center; gap: .55rem; font-weight: 500; }
.ot-kpi .label .bi {
    width: 30px; height: 30px; border-radius: 9px; display: inline-flex; align-items: center; justify-content: center;
    background: var(--ot-blue-50); color: var(--ot-blue); font-size: .95rem;
}
.ot-kpi.ot-kpi-gold .label .bi { background: var(--ot-gold-50); color: var(--ot-gold-text); }
.ot-kpi .value { font-size: 1.85rem; font-weight: 600; color: var(--ot-blue-900); font-variant-numeric: tabular-nums; line-height: 1.15; margin-top: .6rem; }
.ot-kpi .hint { font-size: .8rem; color: var(--ot-muted); margin-top: .15rem; }

.ot-roadmap-item { display: flex; gap: .75rem; padding: 1rem; border: 1px dashed var(--ot-border); border-radius: 12px; height: 100%; background: #fbfcfe; }
.ot-roadmap-item .bi { width: 34px; height: 34px; flex-shrink: 0; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center; background: var(--ot-gold-50); color: var(--ot-gold-text); }
.ot-pill { white-space: nowrap; display: inline-flex; align-items: center; gap: .35rem; font-size: .72rem; font-weight: 600; padding: .25rem .6rem; border-radius: 99px; background: var(--ot-gold-50); color: var(--ot-gold-text); border: 1px solid var(--ot-cream); }

/* ---------- Mise en page applicative ---------- */
.ot-shell { min-height: 100vh; }
.ot-sidebar {
    position: fixed; inset: 0 auto 0 0; width: var(--ot-sidebar-w); background: var(--ot-card);
    border-right: 1px solid var(--ot-border); display: flex; flex-direction: column; z-index: 1030; overflow-y: auto;
}
.ot-brand { padding: 1.2rem 1.4rem .6rem; }
.ot-brand a { display: inline-block; }
.ot-brand-logo { height: 54px; width: auto; max-width: 100%; display: block; }   /* proportions préservées */
.ot-brand .ot-circuit { margin-top: .6rem; }

.ot-nav { padding: .25rem .85rem 1rem; flex: 1; }
.ot-nav-section { font-size: .68rem; font-weight: 600; text-transform: uppercase; letter-spacing: .09em; color: #98a2b3; padding: 1.1rem .75rem .4rem; }
.ot-nav a, .ot-nav .ot-nav-soon {
    position: relative; display: flex; align-items: center; gap: .7rem; padding: .55rem .75rem; border-radius: 10px;
    color: #3b4865; text-decoration: none; font-size: .9rem; font-weight: 500;
}
.ot-nav a .bi { color: #7a869e; }
.ot-nav a:hover { background: var(--ot-surface); color: var(--ot-blue-900); }
.ot-nav a.active { background: var(--ot-blue-50); color: var(--ot-blue); font-weight: 600; }
.ot-nav a.active .bi { color: var(--ot-blue); }
.ot-nav a.active::before {           /* repère or, comme le nœud de circuit du logo */
    content: ""; position: absolute; left: -.85rem; top: 50%; width: 4px; height: 22px; margin-top: -11px;
    border-radius: 0 4px 4px 0; background: var(--ot-gold);
}
.ot-nav .bi { font-size: 1.05rem; width: 1.2rem; text-align: center; }
.ot-nav .ot-nav-soon { color: #a3acbd; cursor: default; font-weight: 400; }
.ot-nav .ot-nav-soon small { margin-left: auto; flex-shrink: 0; white-space: nowrap; font-size: .64rem; color: #98a2b3; border: 1px solid var(--ot-border); border-radius: 99px; padding: 0 .45rem; }
.ot-sidebar-foot { padding: 1rem 1.4rem 1.25rem; font-size: .72rem; color: var(--ot-muted); line-height: 1.4; }
.ot-sidebar-foot .ot-circuit { margin-bottom: .75rem; }

.ot-main { margin-left: var(--ot-sidebar-w); min-height: 100vh; display: flex; flex-direction: column; }
.ot-topbar {
    height: 66px; background: rgba(255, 255, 255, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--ot-border);
    display: flex; align-items: center; gap: 1rem; padding: 0 1.75rem; position: sticky; top: 0; z-index: 1020;
}
.ot-topbar-logo { display: none; height: 36px; width: auto; }
.ot-search { flex: 1; max-width: 440px; position: relative; }
.ot-search .bi { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--ot-muted); }
.ot-search input { padding-left: 2.3rem; background: var(--ot-surface); border-color: transparent; }
.ot-avatar {
    width: 38px; height: 38px; border-radius: 50%; background: var(--ot-blue); color: #fff;
    display: inline-flex; align-items: center; justify-content: center; font-weight: 600; font-size: .85rem;
    box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--ot-gold);
}
.ot-role-badge { display: inline-block; font-size: .68rem; font-weight: 600; letter-spacing: .03em; padding: .18rem .5rem; border-radius: 6px; }
.ot-role-ADMIN { background: var(--ot-blue); color: #fff; }
.ot-role-MANAGER { background: var(--ot-blue-50); color: var(--ot-blue); }
.ot-role-RECEPTIONNISTE { background: var(--ot-gold-50); color: var(--ot-gold-text); }

.ot-content { padding: 2rem 1.75rem 6rem; flex: 1; max-width: 1440px; width: 100%; }
.ot-page-title { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 1.6rem; flex-wrap: wrap; }
.ot-page-title h1 { font-size: 1.6rem; margin: 0; }
.ot-page-title p { margin: .25rem 0 0; color: var(--ot-muted); }

.table { --bs-table-bg: transparent; --bs-table-hover-bg: #f8fafd; margin: 0; }
.table thead th { font-size: .72rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ot-muted); font-weight: 600; border-bottom-color: var(--ot-border); white-space: nowrap; background: #fbfcfe; }
.table td { vertical-align: middle; border-color: var(--ot-border); }

.ot-status { display: inline-flex; align-items: center; gap: .4rem; font-size: .8rem; font-weight: 500; }
.ot-status::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.ot-status-active { color: var(--ot-success); }
.ot-status-disabled { color: var(--ot-muted); }

.alert { border-radius: 12px; }
.alert-success { --bs-alert-bg: #ecf8f3; --bs-alert-border-color: #c6eadb; --bs-alert-color: #0b5c46; }
.alert-warning { --bs-alert-bg: var(--ot-gold-50); --bs-alert-border-color: var(--ot-cream); --bs-alert-color: #6b4600; }

/* ---------- Navigation mobile ---------- */
.ot-bottom-nav { display: none; }
.ot-menu-btn { display: none; }

@media (max-width: 991.98px) {
    .ot-sidebar { transform: translateX(-100%); transition: transform .2s ease; }
    .ot-sidebar.open { transform: none; box-shadow: 0 0 0 100vmax rgba(10, 37, 82, .4); }
    .ot-main { margin-left: 0; }
    .ot-menu-btn { display: inline-flex; }
    .ot-topbar-logo { display: block; }
    .ot-topbar { padding: 0 1rem; }
    .ot-content { padding: 1.25rem 1rem 6rem; }
    .ot-bottom-nav {
        display: flex; position: fixed; bottom: 0; left: 0; right: 0; height: 64px; z-index: 1025;
        background: var(--ot-card); border-top: 1px solid var(--ot-border); padding-bottom: env(safe-area-inset-bottom);
    }
    .ot-bottom-nav a {
        position: relative; flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
        font-size: .68rem; color: var(--ot-muted); text-decoration: none; font-weight: 500;
    }
    .ot-bottom-nav a .bi { font-size: 1.25rem; }
    .ot-bottom-nav a.active { color: var(--ot-blue); }
    .ot-bottom-nav a.active::before { content: ""; position: absolute; top: 0; width: 28px; height: 3px; border-radius: 0 0 3px 3px; background: var(--ot-gold); }
}

/* ---------- Écran de connexion ---------- */
.ot-auth { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; background: var(--ot-card); }
.ot-auth-brand {
    position: relative; overflow: hidden; padding: 3rem 3.5rem; display: flex; flex-direction: column; justify-content: space-between; gap: 2rem;
    background: linear-gradient(160deg, #fffaf1 0%, #fff4e0 55%, #fdebd0 100%);
    border-right: 1px solid #f6e3c4;
}
.ot-auth-logo { height: 88px; width: auto; max-width: 100%; display: block; }
.ot-auth-tagline { margin-top: 1rem; font-size: 1rem; color: var(--ot-gold-text); font-weight: 500; }
.ot-auth-pitch { position: relative; z-index: 1; }
.ot-auth-brand h1 { font-size: 2.15rem; line-height: 1.18; max-width: 30rem; margin-bottom: 1.5rem; color: var(--ot-blue-900); }
.ot-auth-brand h1 em { font-style: normal; color: var(--ot-blue); background: linear-gradient(transparent 68%, rgba(254, 189, 89, .55) 68%); }
.ot-auth-brand ul { list-style: none; padding: 0; margin: 0; display: grid; gap: .9rem; max-width: 30rem; }
.ot-auth-brand li { display: flex; gap: .8rem; align-items: flex-start; color: #3b4865; }
.ot-auth-brand li .bi {
    flex-shrink: 0; width: 34px; height: 34px; border-radius: 10px; display: inline-flex; align-items: center; justify-content: center;
    background: #fff; color: var(--ot-blue); box-shadow: 0 1px 2px rgba(10, 37, 82, .08);
}
.ot-auth-foot { position: relative; z-index: 1; font-size: .8rem; color: #7a6a52; }
.ot-auth-traces { position: absolute; top: 56px; right: 32px; width: 300px; max-width: 42%; height: auto; pointer-events: none; }
.ot-auth-traces .t { fill: none; stroke: var(--ot-cream); stroke-width: 3; stroke-linecap: round; }
.ot-auth-traces .n { fill: #fff8ec; stroke: var(--ot-cream); stroke-width: 3; }
.ot-auth-traces .g { fill: var(--ot-gold); stroke: none; opacity: .9; }

.ot-auth-form { display: flex; align-items: center; justify-content: center; padding: 2.5rem 1.25rem; }
.ot-auth-form .inner { width: 100%; max-width: 390px; }
.ot-auth-form h2 { font-size: 1.75rem; }
.ot-auth-form .btn-primary { padding-top: .7rem; padding-bottom: .7rem; }
.ot-auth-mobile-logo { display: none; height: 56px; width: auto; margin-bottom: 1.75rem; }

@media (max-width: 991.98px) {
    .ot-auth { grid-template-columns: 1fr; }
    .ot-auth-brand { display: none; }
    .ot-auth-mobile-logo { display: block; }
    .ot-auth-form { align-items: flex-start; padding-top: 3rem; }
}

/* ---------- Pages d'erreur ---------- */
.ot-error-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; text-align: center; padding: 2rem; background: var(--ot-card); }
.ot-error-page .ot-error-logo { height: 40px; width: auto; margin-bottom: 2.5rem; }
.ot-error-code { font-size: 4.5rem; font-weight: 700; color: var(--ot-blue); line-height: 1; letter-spacing: -.03em; }
.ot-error-code span { color: var(--ot-gold); }

.ot-perm-row td { font-size: .85rem; }
.ot-inline-form { display: inline; }

/* ---------- Installation ---------- */
.ot-install { min-height: 100vh; display: flex; justify-content: center; padding: 3rem 1rem; background: linear-gradient(180deg, #fffaf1 0, var(--ot-surface) 320px); }
.ot-install-inner { width: 100%; max-width: 620px; }
.ot-install-logo { height: 64px; width: auto; }
.ot-check { display: flex; gap: .75rem; align-items: flex-start; padding: .8rem 1.25rem; border-bottom: 1px solid var(--ot-border); }
.ot-check:last-child { border-bottom: 0; }
.ot-check .bi { font-size: 1.1rem; margin-top: .1rem; }
