/* ==========================================================
   Dashboard Suivi Reunions & Equipes - Light Theme (OCTAVE)
   Aligne sur le Brand Book Dental Addict v1.0 + design OCTAVE.
   Variables `--bg-*`, `--text-*`, `--border` conservent leur nom :
   les modules CSS satellites (expenses.css, prestations.css, etc.)
   heritent du nouveau palette sans modification.
   ========================================================== */

:root {
    /* === Identite Dental Addict (Brand Book v1.0, avril 2019) === */
    --brand-grey:   #214152;        /* Dental Grey (Pantone 7546C) */
    --brand-purple: #2c2d55;        /* Dental Purple (Pantone 5265C) */
    --brand-pink:   #e8327c;        /* Dental Pink (Pantone 213C) */
    --brand-pink-dark: #bd1758;     /* hover */
    --brand-pink-bg:   rgba(232,50,124,0.08);
    --brand-pink-50:   #fef0f6;
    --brand-pink-100:  #fde2ed;
    --brand-pink-700:  #bd1758;
    --brand-grey-50:   #f4f6f8;
    --brand-grey-100:  #e4ebef;
    --brand-grey-500:  #52768a;
    --brand-grey-700:  #2d4453;
    /* Alias retrocompat */
    --brand-primary: var(--brand-grey);
    --brand-accent:  var(--brand-pink);
    --brand-accent-bg: var(--brand-pink-bg);

    /* === Light theme OCTAVE === */
    --bg-primary:     #fafafa;      /* page background */
    --bg-card:        #ffffff;      /* card / panel */
    --bg-card-hover:  #f4f6f8;
    --bg-input:       #f4f6f8;      /* input + week-day + tabs container */
    --bg-elevated:    #ffffff;
    --border:         #e5e7eb;
    --border-soft:    #eef0f3;
    --text-primary:   #214152;      /* dental-grey */
    --text-secondary: #52768a;
    --text-muted:     #6e91a5;

    /* Categories metier (poles) */
    --sales:    #2563eb;
    --sales-bg: rgba(37,99,235,0.10);
    --customer: #059669;
    --customer-bg: rgba(5,150,105,0.10);
    --rh:       #d97706;
    --rh-bg:    rgba(217,119,6,0.10);
    --projets:  #7c3aed;
    --projets-bg: rgba(124,58,237,0.10);
    --office:   #db2777;
    --office-bg: rgba(219,39,119,0.10);

    --success: #16a34a;
    --warning: #f59e0b;
    --danger:  #dc2626;

    --gap: 16px;
    --radius: 12px;

    /* Ombres OCTAVE */
    --shadow-soft: 0 1px 3px 0 rgba(33,65,82,0.08), 0 1px 2px 0 rgba(33,65,82,0.04);
    --shadow-card: 0 4px 12px 0 rgba(33,65,82,0.08);
    --shadow-pop:  0 12px 28px rgba(33,65,82,0.12);
    --shadow-focus: 0 0 0 3px rgba(232,50,124,0.25);

    /* App shell */
    --sidebar-width: 224px;
    --topbar-height: 56px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    /* Brand Book : Ubuntu Light titres / Medium italic corps / Bold sous-titres. */
    font-family: 'Ubuntu', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    font-weight: 500;        /* Ubuntu Medium */
    font-style: italic;      /* signature brand pour le body */
    color: var(--text-primary);
    line-height: 1.55;
    min-height: 100vh;
    background: var(--bg-primary);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Ubuntu', 'Inter', sans-serif;
    font-weight: 300;        /* Ubuntu Light pour titres (Brand Book) */
    font-style: normal;      /* les titres ne sont jamais en italique */
    letter-spacing: -0.015em;
    color: var(--brand-grey);
}

h3, h4, h5, h6 {
    font-weight: 700;        /* Ubuntu Bold pour sous-titres */
}

/* Label "caps" premium : effet editorial brand */
.brand-overline {
    font-family: 'Ubuntu', sans-serif;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--brand-pink);
}

/* Chiffres + tableaux : Inter pour densite avec tabular-nums */
.entry-table,
.admin-grid-table,
.totals-grid,
.balance-remaining,
.total-item strong,
.summary-item strong,
.hero-number {
    font-family: 'Inter', 'Ubuntu', sans-serif;
    font-style: normal;
    font-variant-numeric: tabular-nums;
}

/* Tableaux HTML standards = pas en italique (lisibilite densite) */
table, input, textarea, select, button, .form-input, .pill, .badge, .kbd,
.kpi-value, .kpi-label, .kpi-sub, .upcoming-time, .upcoming-title, .upcoming-category {
    font-style: normal;
}

a { color: var(--brand-pink); text-decoration: none; }
a:hover { color: var(--brand-pink-dark); }

.dashboard {
    max-width: 1440px;
    margin: 0 auto;
    padding: 32px;
}

/* ---- Header (legacy, page-local) ---- */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 28px;
    flex-wrap: wrap;
    gap: 16px;
}

.header-left { min-width: 0; flex: 1 1 300px; }

.header-left h1 {
    font-size: clamp(20px, 4.5vw, 28px);
    font-weight: 300;
    color: var(--brand-grey);
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: auto;
    font-style: normal;
}

.header-left p {
    color: var(--text-secondary);
    font-size: 14px;
    margin-top: 4px;
    overflow-wrap: break-word;
}

.header-right {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

.date-badge {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 7px 14px;
    font-size: 13px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: var(--shadow-soft);
    font-style: normal;
}

.date-badge i { color: var(--brand-pink); }

.btn-sync {
    background: var(--brand-pink);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 700;
    font-style: normal;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background-color .2s, transform .15s, box-shadow .2s;
    box-shadow: var(--shadow-soft);
}

.btn-sync:hover {
    background: var(--brand-pink-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.btn-sync.syncing { opacity: 0.7; pointer-events: none; }
.btn-sync.syncing i { animation: spin 1s linear infinite; }

/* Badge numerique sur boutons header (NDF Admin / Agenda) */
.btn-with-badge { position: relative; }
.btn-badge {
    background: var(--danger);
    color: white;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    padding: 1px 7px;
    border-radius: 999px;
    margin-left: 6px;
    line-height: 1.4;
    min-width: 20px;
    text-align: center;
    display: inline-block;
    box-shadow: 0 0 0 2px rgba(220,38,38,0.18);
    animation: pulse-badge 2s ease-in-out infinite;
}
@keyframes pulse-badge {
    0%, 100% { box-shadow: 0 0 0 2px rgba(220,38,38,0.18); }
    50%      { box-shadow: 0 0 0 4px rgba(220,38,38,0.32); }
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.btn-settings {
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 14px;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    transition: border-color .2s, color .2s, background-color .2s;
}

.btn-settings:hover {
    border-color: var(--brand-pink);
    color: var(--brand-pink);
    background: var(--brand-pink-bg);
}

.filter-select {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 14px;
    font-size: 13px;
    color: var(--text-primary);
    font-family: inherit;
    font-style: normal;
    cursor: pointer;
    outline: none;
    transition: border-color .2s;
    box-shadow: var(--shadow-soft);
}

.filter-select:hover { border-color: var(--brand-pink); }
.filter-select option { background: var(--bg-card); }

/* ---- KPI Row ---- */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: var(--gap);
    margin-bottom: 24px;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
    box-shadow: var(--shadow-soft);
    transition: transform .2s, box-shadow .2s;
    animation: fadeInUp 0.5s ease-out both;
}

.kpi-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.kpi-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
}

.kpi-card:nth-child(1)::before { background: var(--sales); }
.kpi-card:nth-child(2)::before { background: var(--customer); }
.kpi-card:nth-child(3)::before { background: var(--projets); }
.kpi-card:nth-child(4)::before { background: var(--rh); }
.kpi-card:nth-child(5)::before { background: var(--office); }

.kpi-card:nth-child(1) { animation-delay: 0.05s; }
.kpi-card:nth-child(2) { animation-delay: 0.10s; }
.kpi-card:nth-child(3) { animation-delay: 0.15s; }
.kpi-card:nth-child(4) { animation-delay: 0.20s; }
.kpi-card:nth-child(5) { animation-delay: 0.25s; }

.kpi-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    margin-bottom: 12px;
}

.kpi-label {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    line-height: 1;
    margin-bottom: 6px;
    color: var(--brand-grey);
}

.kpi-sub { font-size: 12px; color: var(--text-muted); }

/* ---- Sections ---- */
.section {
    margin-bottom: 24px;
    animation: fadeInUp 0.5s ease-out both;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.section-title {
    font-size: 16px;
    font-weight: 700;
    font-style: normal;
    color: var(--brand-grey);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    font-size: 14px;
    color: var(--brand-pink);
    opacity: 0.85;
}

/* ---- Grid Layouts ---- */
.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--gap);
}

.grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: var(--gap);
}

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-soft);
    transition: transform .2s, box-shadow .2s;
}

.card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.card-title {
    font-size: 14px;
    font-weight: 700;
    font-style: normal;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--brand-grey);
}

/* ---- Weekly Calendar ---- */
.week-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 8px;
}

.week-day {
    background: var(--bg-input);
    border-radius: 8px;
    padding: 12px;
    min-height: 180px;
    border: 1px solid var(--border-soft);
}

.week-day-header {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    margin-bottom: 10px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.week-event {
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 500;
    margin-bottom: 4px;
    border-left: 3px solid;
    cursor: default;
    transition: transform .15s;
}

.week-event:hover { transform: translateX(2px); }

.week-event.sales    { background: var(--sales-bg);    border-color: var(--sales);    color: var(--sales); }
.week-event.customer { background: var(--customer-bg); border-color: var(--customer); color: var(--customer); }
.week-event.rh       { background: var(--rh-bg);       border-color: var(--rh);       color: var(--rh); }
.week-event.projets  { background: var(--projets-bg);  border-color: var(--projets);  color: var(--projets); }
.week-event.office   { background: var(--office-bg);   border-color: var(--office);   color: var(--office); }

.week-event .time {
    font-size: 10px;
    opacity: 0.7;
    display: block;
}

/* ---- Tabs ---- */
.tabs {
    display: inline-flex;
    gap: 4px;
    margin-bottom: 16px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 4px;
}

.tab {
    padding: 7px 18px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 500;
    font-style: normal;
    cursor: pointer;
    color: var(--text-secondary);
    border: none;
    background: none;
    font-family: inherit;
    transition: all .2s;
}

.tab:hover { color: var(--brand-grey); }

.tab.active {
    background: var(--bg-card);
    color: var(--brand-grey);
    box-shadow: var(--shadow-soft);
    font-weight: 700;
}

.tab.sales.active    { color: var(--sales); }
.tab.customer.active { color: var(--customer); }
.tab.rh.active       { color: var(--rh); }
.tab.projets.active  { color: var(--projets); }

.tab-content { display: none; }
.tab-content.active { display: block; }

/* ---- Team Member Cards ---- */
.team-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.team-member {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: transform .2s, border-color .2s, box-shadow .2s;
    text-decoration: none;
    color: inherit;
}

.team-member:hover {
    transform: translateX(4px);
    border-color: var(--brand-pink);
    box-shadow: var(--shadow-soft);
}

.avatar {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-style: normal;
    font-size: 14px;
    flex-shrink: 0;
    color: #fff;
}

.team-member-info .name {
    font-size: 13px;
    font-weight: 700;
    font-style: normal;
    color: var(--brand-grey);
}

.team-member-info .role {
    font-size: 11px;
    color: var(--text-muted);
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin-left: auto;
    flex-shrink: 0;
}

.status-dot.done    { background: var(--success); }
.status-dot.pending { background: var(--warning); }

/* ---- 1-2-1 Table ---- */
.table-wrap { overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    text-align: left;
    padding: 10px 14px;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border);
    background: var(--bg-input);
}

table td {
    padding: 12px 14px;
    font-size: 13px;
    border-bottom: 1px solid var(--border-soft);
    font-style: normal;
}

table tr:hover td {
    background: var(--brand-pink-bg);
}

table tr:last-child td { border-bottom: none; }

.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.badge.done     { background: rgba(22,163,74,0.12);  color: #15803d; }
.badge.upcoming { background: rgba(37,99,235,0.12);  color: #1d4ed8; }
.badge.missed   { background: rgba(220,38,38,0.12);  color: #b91c1c; }

/* ---- CR Timeline ---- */
.timeline {
    position: relative;
    padding-left: 24px;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 8px;
    top: 0;
    bottom: 0;
    width: 2px;
    background: var(--border);
}

.timeline-item {
    position: relative;
    margin-bottom: 16px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: transform .2s, box-shadow .2s;
    box-shadow: var(--shadow-soft);
}

.timeline-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-card);
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -20px;
    top: 18px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--bg-primary);
}

.timeline-item.sales::before    { background: var(--sales); }
.timeline-item.customer::before { background: var(--customer); }
.timeline-item.rh::before       { background: var(--rh); }
.timeline-item.projets::before  { background: var(--projets); }
.timeline-item.office::before   { background: var(--office); }

.timeline-date {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
    font-style: normal;
}

.timeline-title {
    font-size: 13px;
    font-weight: 700;
    font-style: normal;
    color: var(--brand-grey);
}

.timeline-pole {
    font-size: 11px;
    margin-top: 4px;
}

/* ---- Connectors ---- */
.connector-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
}

.connector {
    background: var(--bg-card);
    border-radius: 10px;
    padding: 20px;
    text-align: center;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-soft);
    transition: all .25s;
}

.connector:hover {
    border-color: var(--brand-pink);
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.connector-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    font-size: 22px;
}

.connector-name {
    font-size: 14px;
    font-weight: 700;
    font-style: normal;
    margin-bottom: 6px;
    color: var(--brand-grey);
}

.connector-status {
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.connector-status.connected    { color: var(--success); }
.connector-status.disconnected { color: var(--text-muted); }

/* ---- Upcoming Meetings ---- */
.upcoming-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.upcoming-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 12px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    transition: transform .2s, box-shadow .2s;
    border-left: 3px solid transparent;
}

.upcoming-item:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-soft);
}

.upcoming-item.sales    { border-left-color: var(--sales); }
.upcoming-item.customer { border-left-color: var(--customer); }
.upcoming-item.rh       { border-left-color: var(--rh); }
.upcoming-item.projets  { border-left-color: var(--projets); }
.upcoming-item.office   { border-left-color: var(--office); }

.upcoming-time {
    font-size: 12px;
    font-weight: 700;
    color: var(--text-secondary);
    min-width: 100px;
}

.upcoming-title {
    font-size: 13px;
    font-weight: 500;
    flex: 1;
    color: var(--brand-grey);
}

.upcoming-category {
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 999px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.upcoming-category.sales    { background: var(--sales-bg);    color: var(--sales); }
.upcoming-category.customer { background: var(--customer-bg); color: var(--customer); }
.upcoming-category.rh       { background: var(--rh-bg);       color: var(--rh); }
.upcoming-category.projets  { background: var(--projets-bg);  color: var(--projets); }
.upcoming-category.office   { background: var(--office-bg);   color: var(--office); }

/* ---- Charts ---- */
.chart-wrap {
    position: relative;
    height: 280px;
}

/* ---- Animations ---- */
@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.section:nth-child(3) { animation-delay: 0.10s; }
.section:nth-child(4) { animation-delay: 0.15s; }
.section:nth-child(5) { animation-delay: 0.20s; }
.section:nth-child(6) { animation-delay: 0.25s; }
.section:nth-child(7) { animation-delay: 0.30s; }

/* ---- Pulse / Live ---- */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.4; }
}

.live-dot {
    width: 8px;
    height: 8px;
    background: var(--success);
    border-radius: 50%;
    display: inline-block;
    animation: pulse 2s ease-in-out infinite;
}

/* ---- Scrollbar (light) ---- */
::-webkit-scrollbar         { width: 8px; height: 8px; }
::-webkit-scrollbar-track   { background: transparent; }
::-webkit-scrollbar-thumb   { background: var(--brand-grey-100); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--brand-grey-500); }

/* ---- Flash Messages ---- */
.flash-container {
    position: fixed;
    top: calc(var(--topbar-height) + 16px);
    right: 16px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
    max-width: 420px;
}

.flash-message {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 20px;
    font-size: 13px;
    font-style: normal;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--brand-grey);
    box-shadow: var(--shadow-pop);
    animation: slideInRight 0.3s ease-out;
}

.flash-message i { font-size: 16px; flex-shrink: 0; }

.flash-success { border-left: 3px solid var(--success); }
.flash-success i { color: var(--success); }

.flash-error   { border-left: 3px solid var(--danger); }
.flash-error i { color: var(--danger); }

.flash-warning { border-left: 3px solid var(--warning); }
.flash-warning i { color: var(--warning); }

.flash-info    { border-left: 3px solid var(--sales); }
.flash-info i  { color: var(--sales); }

.flash-close {
    margin-left: auto;
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
}

@keyframes slideInRight {
    from { opacity: 0; transform: translateX(50px); }
    to   { opacity: 1; transform: translateX(0); }
}

/* ---- Login Page ---- */
.login-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 24px;
    background:
        radial-gradient(ellipse 70% 60% at 100% 0%,  rgba(232,50,124,0.08), transparent 60%),
        radial-gradient(ellipse 60% 50% at 0% 100%,  rgba(44,45,85,0.06),  transparent 60%),
        var(--bg-primary);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow-pop);
    animation: fadeInUp 0.5s ease-out;
}

.login-header {
    text-align: center;
    margin-bottom: 32px;
}

.login-header h1 {
    font-size: 26px;
    font-weight: 300;
    color: var(--brand-grey);
    margin-bottom: 8px;
}

.login-header p {
    color: var(--text-secondary);
    font-size: 14px;
}

.login-help {
    color: var(--text-secondary);
    font-size: 12px;
    text-align: center;
    margin-top: 14px;
    line-height: 1.5;
}

/* ---- Forms ---- */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    font-style: normal;
    color: var(--text-secondary);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.form-input {
    width: 100%;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 11px 14px;
    font-size: 14px;
    color: var(--text-primary);
    font-family: inherit;
    font-style: normal;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.form-input:focus {
    border-color: var(--brand-pink);
    box-shadow: var(--shadow-focus);
}

.form-input::placeholder { color: var(--text-muted); }

.btn-primary {
    background: var(--brand-pink);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 700;
    font-style: normal;
    font-family: inherit;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
    transition: background-color .2s, transform .15s, box-shadow .2s;
    box-shadow: var(--shadow-soft);
}

.btn-primary:hover {
    background: var(--brand-pink-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-card);
}

.btn-full {
    width: 100%;
    justify-content: center;
}

.btn-google {
    background: #fff;
    color: #1f1f1f;
    border: 1px solid #dadce0;
    border-radius: 8px;
    padding: 11px 24px;
    font-size: 14px;
    font-weight: 700;
    font-style: normal;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    transition: background-color .2s, box-shadow .2s;
}

.btn-google:hover {
    background: #f8f9fa;
    box-shadow: var(--shadow-soft);
}

.btn-google svg {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
}

.login-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    font-size: 12px;
    font-style: normal;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin: 18px 0;
}

.login-separator::before,
.login-separator::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---- Responsive ---- */
@media (max-width: 1100px) {
    .kpi-row { grid-template-columns: repeat(3, 1fr); }
    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .connector-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Week block */
.week-block {
    background: var(--bg-card); border: 1px solid var(--border); border-radius: 8px;
    padding: 12px;
    border-left: 3px solid var(--border);
    box-shadow: var(--shadow-soft);
    transition: border-color .15s;
}
.week-block:hover { border-left-color: var(--brand-pink); }

/* Clickable rows */
.clickable-row { cursor: pointer; transition: background .15s; }
.clickable-row:hover { background: var(--brand-pink-bg) !important; }

/* Detail Modal */
[hidden] { display: none !important; }

.modal-overlay {
    position: fixed; inset: 0; z-index: 9999;
    background: rgba(33, 65, 82, 0.45); backdrop-filter: blur(4px);
    display: flex; align-items: center; justify-content: center;
    padding: 20px;
}
.modal-content {
    background: var(--bg-card); border: 1px solid var(--border);
    border-radius: var(--radius); width: 100%; max-width: 600px;
    max-height: 80vh; overflow-y: auto;
    box-shadow: 0 24px 48px rgba(33,65,82,0.18);
}
.modal-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 20px 24px 12px; border-bottom: 1px solid var(--border);
}
.modal-body { padding: 16px 24px 24px; }
.modal-meta-row {
    display: flex; align-items: center; gap: 8px;
    font-size: 13px; color: var(--text-secondary); margin-bottom: 6px;
}
.modal-notes { margin-top: 8px; }

/* Modal large pour la preview Drive d'un CR */
.modal-content.is-wide {
    max-width: 1200px;
    max-height: 92vh;
}
.cr-split {
    display: grid;
    grid-template-columns: minmax(0, 1.6fr) minmax(280px, 1fr);
    gap: 16px;
    align-items: start;
}
.cr-doc-frame {
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--border);
    height: 72vh;
}
.cr-doc-frame iframe {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}
.cr-side {
    position: sticky;
    top: 0;
    max-height: 72vh;
    overflow-y: auto;
}
.cr-summary-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-left: 3px solid var(--brand-pink);
    border-radius: 8px;
    padding: 12px 14px;
    box-shadow: var(--shadow-soft);
}
.cr-summary-card .sum-head {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    font-style: normal;
    color: var(--brand-pink);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: .08em;
}
.cr-summary-card .sum-body { font-size: 13px; line-height: 1.55; }
.cr-summary-card .sum-body p { margin: 0 0 8px; }
.cr-summary-card .sum-body ul { margin: 0 0 10px; padding-left: 18px; }
.cr-summary-card .sum-body li { margin-bottom: 4px; }
.cr-summary-card .sum-body h5.sum-section {
    font-size: 11px;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 10px 0 4px;
    letter-spacing: .08em;
    font-style: normal;
}

@media (max-width: 900px) {
    .cr-split { grid-template-columns: 1fr; }
    .cr-doc-frame { height: 55vh; }
    .cr-side { position: static; max-height: none; }
}

@media (max-width: 768px) {
    .dashboard { padding: 16px; }
    .kpi-row { grid-template-columns: repeat(2, 1fr); }
    .week-grid { grid-template-columns: 1fr; }
    .header { flex-direction: column; align-items: flex-start; }
    .connector-grid { grid-template-columns: 1fr 1fr; }
    .tabs { flex-wrap: wrap; }
    .modal-content { max-width: 100%; }
    .grid-3 { grid-template-columns: 1fr; }
}

/* -----------------------------------------------------------------------
   Badge global de fraicheur de synchronisation (services/sync)
   Inclus dans base.html, pilote par static/js/sync_badge.js.
   Repositionne sous la topbar pour ne pas masquer le bouton "+ Brief".
   ----------------------------------------------------------------------- */
.sync-badge {
    position: fixed;
    top: calc(var(--topbar-height) + 14px);
    right: 14px;
    z-index: 50;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 11px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 700;
    font-style: normal;
    line-height: 1;
    color: #fff;
    background: rgba(33, 65, 82, 0.92);
    border: 1px solid rgba(255, 255, 255, 0.10);
    box-shadow: var(--shadow-card);
    cursor: help;
    white-space: pre-line;
    backdrop-filter: blur(4px);
    transition: background .2s ease, border-color .2s ease;
}

.sync-badge .sync-badge-icon { font-size: 12px; }
.sync-badge .sync-badge-text { letter-spacing: .02em; }

.sync-badge[data-freshness="fresh"]   { background: rgba(22, 163, 74, 0.92);  border-color: rgba(60, 200, 110, 0.4); }
.sync-badge[data-freshness="stale"]   { background: rgba(217, 119, 6, 0.92);  border-color: rgba(255, 200, 70, 0.4); }
.sync-badge[data-freshness="old"]     { background: rgba(220, 38, 38, 0.92);  border-color: rgba(255, 90, 90, 0.4); }
.sync-badge[data-freshness="never"]   { background: rgba(110, 145, 165, 0.92); border-color: rgba(229, 231, 235, 0.6); }
.sync-badge[data-freshness="syncing"] { background: rgba(37, 99, 235, 0.92);  border-color: rgba(100, 160, 240, 0.4); }

@media (max-width: 600px) {
    .sync-badge { top: calc(var(--topbar-height) + 8px); right: 8px; font-size: 11px; padding: 5px 9px; }
    .sync-badge .sync-badge-text { display: none; }
}

/* Settings : bandeau "owner only" affiche pour les admins non-owner.
   Indique en lecture seule + bloque les fieldset des forms. */
.settings-owner-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    background: #fff7ed;
    border: 1px solid #fed7aa;
    border-radius: 8px;
    color: #9a3412;
    font-size: 13px;
    line-height: 1.4;
}
.settings-owner-notice i { font-size: 16px; flex-shrink: 0; }

.settings-fieldset {
    border: none;
    padding: 0;
    margin: 0;
}
.settings-fieldset:disabled {
    opacity: 0.55;
    pointer-events: none;
}
