/* ==========================================================================
   TeoGest - Figma Design System (Pixel-Perfect)
   Colors, typography, and layout matching Figma reference exactly
   ========================================================================== */

/* --- CSS Variables --- */
:root {
    --navy: #010940;
    --accent-blue: #2563EB;
    --active-blue: #3B82F6;
    --blue-link: #3171EF;
    --danger: #EF4444;
    --success: #0E9669;
    --warning: #F97316;
    --purple: #9333EA;
    --cyan: #15C4FA;
    --text-primary: #1E293B;
    --text-secondary: #334155;
    --text-muted: #94A3B8;
    --text-light: #CBD5E1;
    --sidebar-text: #4B5563;
    --bg-page: #F8FAFC;
    --bg-card: #FFFFFF;
    --table-header-bg: #F9FAFB;
    --table-alt-bg: #F9FAFB;
    --border-subtle: #E2E8F0;
    --border-table: #EAECF0;
    --border-input: #D0D5DD;
    --active-item-bg: #EFF6FF;
    --active-item-border: #1E3A8A;
    --progress-bg: #F5F8FE;
    --orange-badge-bg: #FFF7ED;
    --red-badge-bg: #FDF3F3;
    --green-badge-bg: #EBF5F1;
    --purple-badge-bg: #F5E9FD;
}

/* --- Reset & Base --- */
*, *::before, *::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--text-primary);
    background-color: var(--bg-page);
    margin: 0;
    padding: 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    line-height: 1.5;
}

a {
    color: var(--accent-blue);
    text-decoration: none;
    transition: color 0.2s;
}

a:hover {
    color: var(--active-blue);
    text-decoration: none;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 500;
    color: var(--text-primary);
    margin-top: 0;
}

/* ==========================================================================
   LOGIN PAGE
   ========================================================================== */
.login-page {
    background: var(--bg-page);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.login-box {
    width: 420px;
    background: var(--bg-card);
    border-radius: 12px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.login-box-header {
    background: var(--navy);
    padding: 28px 32px;
    text-align: center;
}

.login-box-header h1 {
    color: #FFFFFF;
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    letter-spacing: 1px;
}

.login-box-header h1 span {
    color: var(--active-blue);
}

.login-box-header p {
    color: var(--text-muted);
    font-size: 13px;
    margin: 8px 0 0 0;
}

.login-box-body {
    padding: 32px;
}

.login-box-body .form-group {
    margin-bottom: 20px;
}

.login-box-body label {
    display: block;
    font-weight: 500;
    color: var(--text-primary);
    font-size: 13px;
    margin-bottom: 6px;
}

.login-box-body .login-input-wrap {
    position: relative;
}

.login-box-body .login-input-wrap .login-input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 14px;
    pointer-events: none;
}

.login-box-body .login-input-wrap input {
    width: 100%;
    height: 44px;
    border: 1px solid var(--border-input);
    border-radius: 8px;
    padding: 10px 14px 10px 40px;
    font-size: 14px;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
    outline: none;
}

.login-box-body .login-input-wrap input:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.login-box-body .login-input-wrap input::placeholder {
    color: var(--text-muted);
}

.login-box-body .btn-login {
    display: block;
    width: 100%;
    height: 46px;
    background: var(--navy);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 8px;
}

.login-box-body .btn-login:hover {
    background: #0a1560;
}

.login-box-body .forgot-link {
    text-align: center;
    margin-top: 16px;
}

.login-box-body .forgot-link a {
    color: var(--accent-blue);
    font-size: 13px;
    font-weight: 500;
}

.login-box-body .text-danger {
    color: var(--danger) !important;
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.login-box-body .validation-summary-errors ul {
    list-style: none;
    padding: 0;
    margin: 0 0 16px 0;
}

.login-box-body .validation-summary-errors ul li {
    background: var(--red-badge-bg);
    border: 1px solid #FECACA;
    border-radius: 8px;
    padding: 10px 14px;
    color: #DC2626;
    font-size: 13px;
    margin-bottom: 8px;
}

/* Legacy login classes redirect */
.login-split { display: none; }

/* ==========================================================================
   SIDEBAR (Dashboard mode)
   ========================================================================== */
.layout-dashboard {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: 220px;
    min-width: 220px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    overflow-y: auto;
}

.sidebar-logo {
    padding: 20px 20px 16px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.sidebar-logo .logo-diamond {
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sidebar-logo .logo-diamond svg {
    width: 28px;
    height: 28px;
}

.sidebar-logo .logo-text {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
    letter-spacing: 0.5px;
}

.sidebar-logo .logo-text span {
    font-weight: 400;
    color: var(--text-muted);
    font-size: 10px;
    margin-left: 2px;
    vertical-align: super;
}

/* Sidebar dropdowns */
.sidebar-dropdown {
    padding: 0 16px;
    margin-bottom: 8px;
}

.sidebar-dropdown-label {
    font-size: 11px;
    font-weight: 500;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    padding-left: 4px;
}

.sidebar-dropdown-select {
    width: 100%;
    height: 36px;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 0 12px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text-primary);
    background: var(--bg-card);
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg width='10' height='6' viewBox='0 0 10 6' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L5 5L9 1' stroke='%2394A3B8' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
}

/* Sidebar sections */
.sidebar-section {
    padding: 8px 0;
}

.sidebar-section-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--sidebar-text);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 8px 20px 4px;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 20px;
    font-size: 14px;
    font-weight: 400;
    color: var(--sidebar-text);
    text-decoration: none;
    transition: all 0.15s;
    border-left: 3px solid transparent;
    margin: 1px 0;
}

.sidebar-nav li a:hover {
    background: #F9FAFB;
    color: var(--text-primary);
}

.sidebar-nav li a.active {
    background: var(--active-item-bg);
    color: var(--accent-blue);
    border-left-color: var(--accent-blue);
    font-weight: 500;
}

.sidebar-nav li a i {
    width: 18px;
    text-align: center;
    font-size: 14px;
    color: inherit;
    opacity: 0.7;
}

.sidebar-nav li a.active i {
    opacity: 1;
}

.sidebar-nav li a .nav-chevron {
    margin-left: auto;
    font-size: 10px;
    opacity: 0.5;
}

/* Sidebar bottom */
.sidebar-bottom {
    margin-top: auto;
    border-top: 1px solid var(--border-subtle);
    padding: 8px 0;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px;
}

.sidebar-user .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.sidebar-user .user-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

/* Dashboard content area */
.dashboard-content {
    flex: 1;
    margin-left: 220px;
    display: flex;
    min-height: 100vh;
}

.dashboard-main {
    flex: 1;
    padding: 24px 28px;
    overflow-y: auto;
    min-width: 0;
}

/* Assistant panel (right) */
.assistant-panel {
    width: 300px;
    min-width: 300px;
    background: var(--bg-card);
    border-left: 1px solid var(--border-subtle);
    padding: 24px 20px;
    overflow-y: auto;
    position: sticky;
    top: 0;
    height: 100vh;
}

.assistant-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 16px;
}

.assistant-header i {
    color: var(--cyan);
    font-size: 16px;
}

.assistant-header h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.assistant-greeting {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.assistant-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.assistant-tab {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.assistant-tab.active {
    color: var(--accent-blue);
    border-bottom-color: var(--accent-blue);
}

.assistant-notification {
    display: flex;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #F1F5F9;
}

.assistant-notification:last-child {
    border-bottom: none;
}

.assistant-notif-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.assistant-notif-icon.icon-warning {
    background: var(--orange-badge-bg);
    color: var(--warning);
}

.assistant-notif-icon.icon-danger {
    background: var(--red-badge-bg);
    color: var(--danger);
}

.assistant-notif-icon.icon-info {
    background: var(--active-item-bg);
    color: var(--accent-blue);
}

.assistant-notif-icon.icon-success {
    background: var(--green-badge-bg);
    color: var(--success);
}

.assistant-notif-content {
    flex: 1;
    min-width: 0;
}

.assistant-notif-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.assistant-notif-desc {
    font-size: 12px;
    color: var(--text-muted);
    line-height: 1.4;
}

.assistant-notif-date {
    font-size: 11px;
    color: var(--text-light);
    white-space: nowrap;
    flex-shrink: 0;
}

/* ==========================================================================
   DASHBOARD PAGE CONTENT
   ========================================================================== */
.dash-title {
    font-size: 24px;
    font-weight: 400;
    color: var(--text-primary);
    margin: 0 0 20px 0;
}

/* Dashboard tabs */
.dash-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 24px;
    border-bottom: 1px solid var(--border-subtle);
}

.dash-tab {
    padding: 10px 20px;
    font-size: 16px;
    font-weight: 400;
    color: var(--text-muted);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
    transition: color 0.2s;
}

.dash-tab:hover {
    color: var(--text-primary);
}

.dash-tab.active {
    color: var(--text-primary);
    font-weight: 500;
    border-bottom-color: var(--accent-blue);
}

/* Section headers */
.dash-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
}

.dash-section-title {
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.dash-section-link {
    font-size: 13px;
    color: var(--accent-blue);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 4px;
}

/* KPI indicator cards */
.kpi-row {
    display: flex;
    gap: 12px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 16px;
    min-width: 120px;
    flex: 1;
    text-align: center;
}

.kpi-card-label {
    font-size: 12px;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 8px;
    line-height: 1.3;
}

.kpi-card-value {
    font-size: 32px;
    font-weight: 500;
    color: var(--text-primary);
    line-height: 1.1;
}

/* Depot OCR card */
.depot-ocr-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-width: 160px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.depot-ocr-card:hover {
    border-color: var(--accent-blue);
}

.depot-ocr-card i {
    font-size: 24px;
    color: var(--text-muted);
    margin-bottom: 8px;
}

.depot-ocr-card .depot-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.depot-ocr-card .depot-sub {
    font-size: 12px;
    color: var(--text-muted);
}

/* Echeances */
.echeance-list {
    display: flex;
    gap: 20px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.echeance-item {
    flex: 1;
    min-width: 180px;
}

.echeance-item-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 4px;
}

.echeance-item-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.echeance-item-date {
    font-size: 12px;
    color: var(--text-muted);
}

.echeance-item-amount {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 8px;
}

.echeance-item-amount .echeance-link {
    color: var(--accent-blue);
    font-size: 14px;
}

/* Status badge pills */
.badge-pill {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 12px;
    font-size: 11px;
    font-weight: 500;
}

.badge-pill.badge-validated {
    background: var(--green-badge-bg);
    color: var(--success);
}

.badge-pill.badge-in-progress {
    background: var(--active-item-bg);
    color: var(--accent-blue);
}

.badge-pill.badge-pending {
    background: var(--orange-badge-bg);
    color: var(--warning);
}

.badge-pill.badge-waiting {
    background: var(--purple-badge-bg);
    color: var(--purple);
}

.badge-pill.badge-alert {
    background: var(--red-badge-bg);
    color: var(--danger);
}

.badge-pill.badge-coming {
    background: #EFF6FF;
    color: var(--accent-blue);
}

/* Taches section */
.taches-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.taches-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.taches-header .taches-count {
    background: #F1F5F9;
    color: var(--text-muted);
    font-size: 12px;
    padding: 2px 10px;
    border-radius: 12px;
    font-weight: 500;
}

/* Tache KPI cards (like revision) */
.tache-kpi-row {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.tache-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 12px 20px;
    text-align: center;
    min-width: 100px;
    flex: 1;
}

.tache-kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.tache-kpi-value {
    font-size: 28px;
    font-weight: 600;
    line-height: 1.1;
}

.tache-kpi-value.text-danger { color: var(--danger); }
.tache-kpi-value.text-warning { color: var(--warning); }
.tache-kpi-value.text-blue { color: var(--accent-blue); }
.tache-kpi-value.text-success { color: var(--success); }
.tache-kpi-value.text-purple { color: var(--purple); }
.tache-kpi-value.text-navy { color: var(--navy); }
.tache-kpi-value.text-muted-val { color: var(--text-muted); }

.tache-kpi-sub {
    font-size: 11px;
    color: var(--accent-blue);
    margin-top: 2px;
}

.tache-kpi-sub.text-success { color: var(--success) !important; }
.tache-kpi-sub.text-purple { color: var(--purple) !important; }

/* Task table */
.tache-table {
    width: 100%;
    border-collapse: collapse;
}

.tache-table th {
    text-align: left;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 10px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.tache-table td {
    padding: 12px 14px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid #F5F5F5;
    vertical-align: middle;
}

.tache-table tr:last-child td {
    border-bottom: none;
}

.tache-table .status-cell {
    text-align: center;
}

.tache-table .action-cell {
    text-align: center;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
}

/* Synthese client - analyse section */
.analyse-section {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 24px;
}

.analyse-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0 0 16px 0;
}

.analyse-section p {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 8px;
}

.analyse-section p strong {
    color: var(--text-primary);
}

/* Chiffres cles section */
.chiffres-section {
    margin-bottom: 24px;
}

.chiffres-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.chiffres-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.chiffres-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 12px;
}

.chiffres-tab {
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    background: #F1F5F9;
    color: var(--text-muted);
    border-radius: 0;
}

.chiffres-tab:first-child {
    border-radius: 6px 0 0 6px;
}

.chiffres-tab:last-child {
    border-radius: 0 6px 6px 0;
}

.chiffres-tab.active {
    background: var(--navy);
    color: #FFFFFF;
}

.chiffres-period {
    font-size: 13px;
    color: var(--text-muted);
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* CSS Charts */
.chart-container {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
}

.chart-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 16px;
}

.chart-legend {
    display: flex;
    gap: 20px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.chart-legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

.chart-legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.chart-kpi {
    text-align: right;
    margin-left: auto;
}

.chart-kpi-value {
    font-size: 20px;
    font-weight: 700;
    color: var(--accent-blue);
}

.chart-kpi-change {
    font-size: 12px;
    color: var(--success);
    font-weight: 500;
}

/* Line chart (CSS) */
.line-chart {
    position: relative;
    height: 200px;
    display: flex;
    align-items: flex-end;
    gap: 0;
    border-bottom: 1px solid var(--border-subtle);
    border-left: 1px solid var(--border-subtle);
    padding-left: 40px;
    margin-bottom: 8px;
}

.line-chart-labels {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    padding: 0 4px;
}

.line-chart-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: right;
}

.line-chart-bar {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    position: relative;
}

.line-chart-point {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--accent-blue);
    position: absolute;
    z-index: 2;
}

.line-chart-fill {
    width: 100%;
    background: linear-gradient(180deg, rgba(37, 99, 235, 0.15) 0%, rgba(37, 99, 235, 0.02) 100%);
    border-radius: 2px 2px 0 0;
}

.line-chart-months {
    display: flex;
    padding-left: 40px;
}

.line-chart-month {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}

/* Bar chart (stacked) */
.bar-chart {
    display: flex;
    align-items: flex-end;
    gap: 4px;
    height: 200px;
    padding-top: 10px;
    border-bottom: 1px solid var(--border-subtle);
    padding-left: 40px;
    position: relative;
    margin-bottom: 8px;
}

.bar-chart-labels {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 40px;
    display: flex;
    flex-direction: column-reverse;
    justify-content: space-between;
    padding: 0 4px;
}

.bar-chart-label {
    font-size: 10px;
    color: var(--text-muted);
    text-align: right;
}

.bar-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    height: 100%;
    justify-content: flex-end;
}

.bar-item .bar-stack {
    width: 80%;
    max-width: 40px;
    display: flex;
    flex-direction: column-reverse;
}

.bar-item .bar-segment {
    width: 100%;
    min-height: 2px;
}

.bar-item .bar-segment:last-child {
    border-radius: 3px 3px 0 0;
}

.bar-chart-months {
    display: flex;
    padding-left: 40px;
}

.bar-chart-month {
    flex: 1;
    text-align: center;
    font-size: 11px;
    color: var(--text-muted);
}

/* Donut chart */
.donut-chart-wrap {
    display: flex;
    align-items: center;
    gap: 32px;
}

.donut-chart {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    position: relative;
    flex-shrink: 0;
}

.donut-chart::after {
    content: '';
    position: absolute;
    top: 35px;
    left: 35px;
    right: 35px;
    bottom: 35px;
    background: var(--bg-card);
    border-radius: 50%;
}

.donut-center {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    z-index: 2;
}

.donut-center-label {
    font-size: 10px;
    color: var(--text-muted);
}

.donut-center-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.donut-legend {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.donut-legend-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-secondary);
}

.donut-legend-item .legend-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    flex-shrink: 0;
}

.donut-legend-item .legend-value {
    font-weight: 600;
    color: var(--text-primary);
    margin-left: auto;
}

/* ==========================================================================
   APP HEADER (Revision / App mode - full width, no sidebar)
   ========================================================================== */
.app-header {
    background: var(--navy);
    height: 56px;
    display: flex;
    align-items: center;
    padding: 0 20px;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
}

.app-header .header-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
    margin-right: 24px;
    flex-shrink: 0;
}

.app-header .header-logo .logo-text {
    font-size: 18px;
    font-weight: 700;
    color: #FFFFFF;
    letter-spacing: 0.5px;
}

.app-header .header-logo .logo-sub {
    font-size: 9px;
    color: var(--text-muted);
    margin-left: 2px;
}

/* App header navigation */
.app-header-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    list-style: none;
    margin: 0;
    padding: 0;
    height: 56px;
}

.app-header-nav > li {
    position: relative;
    height: 56px;
    display: flex;
    align-items: center;
}

.app-header-nav > li > a,
.app-header-nav > li > button {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 0 14px;
    height: 36px;
    color: #CBD5E1;
    font-size: 13px;
    font-weight: 400;
    text-decoration: none;
    transition: all 0.15s;
    border: none;
    background: none;
    cursor: pointer;
    font-family: inherit;
    border-radius: 6px;
    white-space: nowrap;
}

.app-header-nav > li > a:hover,
.app-header-nav > li > button:hover {
    color: #FFFFFF;
    background: rgba(255, 255, 255, 0.08);
}

.app-header-nav > li > a.active,
.app-header-nav > li > button.active {
    color: #FFFFFF;
    background: var(--warning);
    border-radius: 6px;
    font-weight: 500;
}

.app-header-nav > li > a .caret-icon,
.app-header-nav > li > button .caret-icon {
    font-size: 9px;
    opacity: 0.6;
}

/* Dropdown in app header */
.app-header-nav > li .nav-dropdown {
    position: absolute;
    top: 52px;
    left: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    min-width: 220px;
    padding: 6px 0;
    list-style: none;
    margin: 0;
    display: none;
    z-index: 1010;
}

.app-header-nav > li:hover .nav-dropdown {
    display: block;
}

.app-header-nav > li .nav-dropdown li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s;
}

.app-header-nav > li .nav-dropdown li a:hover {
    background: #F1F5F9;
    color: var(--accent-blue);
}

.app-header-nav > li .nav-dropdown li a i {
    width: 18px;
    text-align: center;
    color: #64748B;
    font-size: 13px;
}

/* Header right section */
.app-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
    flex-shrink: 0;
}

.app-header-right .header-client {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #CBD5E1;
    font-size: 13px;
    cursor: pointer;
}

.app-header-right .header-client i {
    font-size: 14px;
}

.app-header-right .header-dossier {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #CBD5E1;
    font-size: 12px;
    padding: 0 10px;
}

.app-header-right .header-dossier i {
    font-size: 14px;
}

.app-header-right .header-star {
    color: #F59E0B;
    font-size: 20px;
}

.app-header-right .user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #FFFFFF;
    font-size: 11px;
    font-weight: 600;
    flex-shrink: 0;
}

.app-header-right .user-info {
    display: flex;
    flex-direction: column;
    line-height: 1.2;
}

.app-header-right .user-info .user-name {
    color: #FFFFFF;
    font-size: 12px;
    font-weight: 500;
}

.app-header-right .user-info .user-role {
    color: var(--text-muted);
    font-size: 10px;
}

.app-header-right .header-icon {
    color: #CBD5E1;
    font-size: 16px;
    cursor: pointer;
    transition: color 0.15s;
    background: none;
    border: none;
    padding: 4px;
}

.app-header-right .header-icon:hover {
    color: #FFFFFF;
}

/* ==========================================================================
   APP CONTENT (full width mode)
   ========================================================================== */
.app-content {
    margin-top: 56px;
    padding: 16px 24px;
    min-height: calc(100vh - 56px);
}

/* Breadcrumb */
.breadcrumb-bar {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.breadcrumb-bar a {
    font-size: 13px;
    color: var(--accent-blue);
}

.breadcrumb-bar span {
    font-size: 13px;
    color: var(--text-muted);
}

/* Page title row */
.page-title-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 16px;
}

.page-title-row h1 {
    font-size: 20px;
    font-weight: 700;
    color: var(--navy);
    margin: 0;
}

.page-title-row .page-icons {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 18px;
}

.page-title-row .page-icons button {
    background: none;
    border: none;
    color: inherit;
    cursor: pointer;
    font-size: inherit;
    padding: 2px;
}

.badge-revision {
    display: inline-flex;
    align-items: center;
    padding: 4px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
    background: var(--orange-badge-bg);
    color: var(--warning);
}

.page-right-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

.btn-contact {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: var(--accent-blue);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s;
}

.btn-contact:hover {
    background: #1D4ED8;
    color: #FFFFFF;
}

.raccourcis-clavier {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    cursor: pointer;
}

.raccourcis-clavier i {
    font-size: 16px;
    color: var(--text-muted);
}

/* ==========================================================================
   REVISION KPI CARDS
   ========================================================================== */
.revision-kpi-row {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
    flex-wrap: nowrap;
    overflow-x: auto;
}

.revision-kpi-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    padding: 14px 16px;
    flex: 1;
    min-width: 130px;
    display: flex;
    flex-direction: column;
    position: relative;
}

.revision-kpi-card .kpi-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
    font-weight: 400;
}

.revision-kpi-card .kpi-value-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.revision-kpi-card .kpi-value {
    font-size: 28px;
    font-weight: 600;
    line-height: 1;
}

.revision-kpi-card .kpi-chevron {
    color: var(--text-muted);
    font-size: 14px;
}

.revision-kpi-card .kpi-sub {
    font-size: 11px;
    margin-top: 4px;
}

.revision-kpi-card .kpi-sub a {
    font-size: 11px;
}

/* Progress bar */
.revision-progress {
    margin-top: 4px;
}

.revision-progress-bar {
    height: 8px;
    background: #E8EDFB;
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 6px;
}

.revision-progress-fill {
    height: 100%;
    background: var(--accent-blue);
    border-radius: 4px;
    transition: width 0.3s;
}

.revision-progress-text {
    font-size: 24px;
    font-weight: 700;
    color: var(--accent-blue);
    text-align: right;
}

.revision-progress-detail {
    font-size: 11px;
    color: var(--text-muted);
}

/* ==========================================================================
   REVISION FILTER BAR
   ========================================================================== */
.revision-filters {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 16px;
    flex-wrap: wrap;
}

.revision-filters .filter-group {
    display: flex;
    align-items: center;
    gap: 6px;
}

.revision-filters .filter-label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
}

.revision-filters .filter-input {
    height: 36px;
    border: 1px solid var(--border-input);
    border-radius: 6px;
    padding: 0 10px;
    font-size: 13px;
    font-family: inherit;
    color: var(--text-primary);
    background: var(--bg-card);
}

.revision-filters .filter-input:focus {
    border-color: var(--accent-blue);
    outline: none;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.1);
}

.revision-filters .filter-btn-group {
    display: flex;
    gap: 0;
}

.revision-filters .filter-btn {
    width: 32px;
    height: 36px;
    border: 1px solid var(--border-input);
    background: var(--bg-card);
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: inherit;
}

.revision-filters .filter-btn:first-child {
    border-radius: 6px 0 0 6px;
}

.revision-filters .filter-btn:last-child {
    border-radius: 0 6px 6px 0;
}

.revision-filters .filter-btn:not(:last-child) {
    border-right: none;
}

.revision-filters .filter-btn.active {
    background: var(--accent-blue);
    color: #FFFFFF;
    border-color: var(--accent-blue);
}

.revision-filters .filter-search {
    position: relative;
}

.revision-filters .filter-search input {
    padding-right: 32px;
}

.revision-filters .filter-search .search-icon {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 13px;
    pointer-events: none;
}

/* ==========================================================================
   REVISION 3-COLUMN LAYOUT
   ========================================================================== */
.revision-layout {
    display: flex;
    gap: 0;
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    background: var(--bg-card);
    min-height: 500px;
    overflow: hidden;
}

/* Cycle panel (left) */
.cycle-panel {
    width: 180px;
    min-width: 180px;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
}

.cycle-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.cycle-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cycle-panel-header .toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
}

.cycle-link {
    font-size: 13px;
    color: var(--accent-blue);
    padding: 10px 14px;
    display: block;
    border-bottom: 1px solid var(--border-subtle);
}

.cycle-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cycle-item {
    border-bottom: 1px solid var(--border-subtle);
    padding: 12px 14px;
    cursor: pointer;
    transition: background 0.15s;
}

.cycle-item:hover {
    background: #F9FAFB;
}

.cycle-item.active {
    background: var(--active-item-bg);
    border-left: 3px solid var(--accent-blue);
}

.cycle-item-name {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.cycle-item-progress {
    font-size: 11px;
    color: var(--text-muted);
    margin-bottom: 4px;
}

.cycle-item-badge {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

.cycle-item-badge.badge-modified {
    background: var(--orange-badge-bg);
    color: var(--warning);
}

.cycle-item-badge.badge-validated {
    background: var(--green-badge-bg);
    color: var(--success);
}

.cycle-item-badge.badge-pending {
    background: var(--purple-badge-bg);
    color: var(--purple);
}

/* Comptes panel (middle) */
.comptes-panel {
    width: 280px;
    min-width: 280px;
    border-right: 1px solid var(--border-subtle);
    display: flex;
    flex-direction: column;
    overflow-y: auto;
}

.comptes-panel-header {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.comptes-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comptes-panel-header .toggle-btn {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 2px;
}

.comptes-result {
    font-size: 12px;
    color: var(--text-muted);
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.comptes-result strong {
    color: var(--text-primary);
}

.comptes-toggles {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 8px 14px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 12px;
    color: var(--text-secondary);
}

.comptes-sub-tabs {
    display: flex;
    gap: 0;
    padding: 0 14px;
    border-bottom: 1px solid var(--border-subtle);
}

.comptes-sub-tab {
    padding: 8px 12px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    cursor: pointer;
    background: none;
    border-top: none;
    border-left: none;
    border-right: none;
    font-family: inherit;
}

.comptes-sub-tab.active {
    color: var(--text-primary);
    border-bottom-color: var(--accent-blue);
}

.compte-item {
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-subtle);
    cursor: pointer;
    transition: background 0.15s;
}

.compte-item:hover {
    background: #F9FAFB;
}

.compte-item.active {
    background: var(--active-item-bg);
}

.compte-item-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2px;
}

.compte-item-number {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.compte-item-status {
    display: inline-flex;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
}

.compte-item-name {
    font-size: 12px;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.compte-item-soldes {
    display: flex;
    gap: 16px;
    font-size: 11px;
}

.compte-item-solde {
    display: flex;
    flex-direction: column;
}

.compte-item-solde-label {
    color: var(--text-muted);
    font-size: 10px;
}

.compte-item-solde-value {
    color: var(--text-primary);
    font-weight: 500;
    font-size: 12px;
}

.compte-item-var {
    display: flex;
    flex-direction: column;
}

.compte-item-var-label {
    color: var(--text-muted);
    font-size: 10px;
}

.compte-item-var-value {
    font-size: 12px;
    font-weight: 500;
}

.compte-item-edit {
    color: var(--accent-blue);
    font-size: 14px;
    margin-left: auto;
    align-self: flex-end;
}

/* Ecritures panel (right, main) */
.ecritures-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
}

.ecritures-panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-subtle);
    flex-wrap: wrap;
}

.ecritures-panel-header h3 {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.ecritures-panel-header .compte-selected {
    font-size: 13px;
    color: var(--accent-blue);
}

.ecritures-panel-header .compte-status {
    font-size: 12px;
    color: var(--warning);
    font-weight: 500;
}

.ecritures-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: auto;
}

.btn-commenter {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--bg-card);
    color: var(--text-primary);
    border: 1px solid var(--border-input);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-commenter:hover {
    background: #F9FAFB;
    color: var(--text-primary);
}

.btn-new-ecriture {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--navy);
    color: #FFFFFF;
    border: 1px solid var(--navy);
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-new-ecriture:hover {
    background: #0a1560;
    color: #FFFFFF;
}

.btn-valider {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: var(--success);
    color: #FFFFFF;
    border: none;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: inherit;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.btn-valider:hover {
    background: #0a8058;
    color: #FFFFFF;
}

.btn-more {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 18px;
    cursor: pointer;
    padding: 4px;
}

/* Ecritures toolbar */
.ecritures-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 13px;
}

.ecritures-toolbar-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.ecritures-toolbar-left .tool-icon {
    color: var(--text-muted);
    font-size: 15px;
    cursor: pointer;
    transition: color 0.15s;
}

.ecritures-toolbar-left .tool-icon:hover {
    color: var(--text-primary);
}

.ecritures-toolbar-left .toggle-label {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-secondary);
}

/* Toggle switch */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 36px;
    height: 20px;
}

.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}

.toggle-slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #CBD5E1;
    border-radius: 10px;
    transition: 0.2s;
}

.toggle-slider:before {
    content: '';
    position: absolute;
    height: 16px;
    width: 16px;
    left: 2px;
    bottom: 2px;
    background: white;
    border-radius: 50%;
    transition: 0.2s;
}

.toggle-switch input:checked + .toggle-slider {
    background: var(--accent-blue);
}

.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(16px);
}

/* Pagination */
.pagination-bar {
    display: flex;
    align-items: center;
    gap: 4px;
}

.pagination-bar .page-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    background: var(--bg-card);
    color: var(--text-secondary);
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
    text-decoration: none;
}

.pagination-bar .page-btn:hover {
    background: #F9FAFB;
    color: var(--text-primary);
}

.pagination-bar .page-btn.active {
    background: var(--navy);
    color: #FFFFFF;
    border-color: var(--navy);
}

.pagination-bar .page-btn.nav-btn {
    color: var(--text-muted);
}

.pagination-bar .page-dots {
    font-size: 13px;
    color: var(--text-muted);
    padding: 0 4px;
}

/* ==========================================================================
   ECRITURES TABLE
   ========================================================================== */
.ecritures-table-wrap {
    flex: 1;
    overflow-y: auto;
}

.ecritures-table {
    width: 100%;
    border-collapse: collapse;
}

.ecritures-table th {
    position: sticky;
    top: 0;
    background: var(--table-header-bg);
    font-size: 12px;
    font-weight: 500;
    color: var(--text-muted);
    padding: 10px 12px;
    text-align: left;
    border-bottom: 1px solid var(--border-table);
    white-space: nowrap;
}

.ecritures-table th .sort-icon {
    font-size: 10px;
    margin-left: 4px;
    opacity: 0.5;
}

.ecritures-table td {
    padding: 10px 12px;
    font-size: 13px;
    color: var(--text-primary);
    border-bottom: 1px solid #F5F5F5;
    vertical-align: middle;
}

.ecritures-table tbody tr:hover {
    background: #FAFBFE;
}

.ecritures-table .check-cell {
    width: 40px;
    text-align: center;
}

.ecritures-table .check-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.ecritures-table .amount-cell {
    text-align: right;
    font-variant-numeric: tabular-nums;
}

.ecritures-table .actions-cell {
    white-space: nowrap;
    text-align: right;
}

.ecritures-table .actions-cell i {
    color: var(--text-muted);
    margin-left: 6px;
    cursor: pointer;
    font-size: 14px;
    transition: color 0.15s;
}

.ecritures-table .actions-cell i:hover {
    color: var(--text-primary);
}

/* ==========================================================================
   STANDARD TABLES (reused in many views)
   ========================================================================== */
.table {
    font-size: 13px;
    margin-bottom: 0;
    border-collapse: collapse;
    width: 100%;
}

.table > thead > tr > th {
    background: var(--table-header-bg);
    color: var(--text-muted);
    font-weight: 500;
    border: none;
    padding: 10px 14px;
    font-size: 12px;
    text-transform: none;
    letter-spacing: 0;
    border-bottom: 1px solid var(--border-table);
}

.table > tbody > tr > td {
    padding: 10px 14px;
    vertical-align: middle;
    border-top: none;
    border-bottom: 1px solid #F5F5F5;
    color: var(--text-primary);
}

.table-striped > tbody > tr:nth-of-type(odd) {
    background-color: var(--table-alt-bg);
}

.table-hover > tbody > tr:hover {
    background-color: #FAFBFE;
}

.table > tfoot > tr > td {
    padding: 10px 14px;
    font-weight: 600;
    background: var(--table-header-bg);
    border-top: 1px solid var(--border-table);
}

/* ==========================================================================
   PANELS / CARDS
   ========================================================================== */
.t-panel {
    margin-bottom: 20px;
    border-radius: 8px;
    overflow: hidden;
    background: var(--bg-card);
    box-shadow: none;
    border: 1px solid var(--border-subtle);
}

.t-panel-header {
    background: var(--table-header-bg);
    color: var(--text-primary);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-subtle);
    border-radius: 8px 8px 0 0;
}

.t-panel-header i {
    margin-right: 8px;
    color: var(--text-muted);
}

.t-content {
    background: var(--bg-card);
    border: none;
    border-top: none;
    padding: 16px;
    margin-bottom: 0;
    border-radius: 0 0 8px 8px;
}

/* ==========================================================================
   BUTTONS
   ========================================================================== */
.btn-teogest {
    background: var(--accent-blue);
    color: #FFFFFF;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-teogest:hover,
.btn-teogest:focus {
    background: #1D4ED8;
    color: #FFFFFF;
    text-decoration: none;
}

.btn-teogest-secondary {
    background: #F1F5F9;
    color: var(--sidebar-text);
    border: 1px solid var(--border-subtle);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-teogest-secondary:hover,
.btn-teogest-secondary:focus {
    background: var(--border-subtle);
    color: var(--text-primary);
    text-decoration: none;
}

.btn-teogest-success {
    background: var(--success);
    color: #FFFFFF;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-teogest-success:hover,
.btn-teogest-success:focus {
    background: #0a8058;
    color: #FFFFFF;
    text-decoration: none;
}

.btn-teogest-danger {
    background: var(--danger);
    color: #FFFFFF;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    font-family: 'Inter', system-ui, sans-serif;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    text-decoration: none;
}

.btn-teogest-danger:hover,
.btn-teogest-danger:focus {
    background: #DC2626;
    color: #FFFFFF;
    text-decoration: none;
}

/* Small buttons */
.btn-teogest.btn-xs,
.btn-teogest-secondary.btn-xs,
.btn-teogest-success.btn-xs,
.btn-teogest-danger.btn-xs {
    padding: 4px 10px;
    font-size: 12px;
    border-radius: 6px;
}

.btn-teogest.btn-sm,
.btn-teogest-secondary.btn-sm,
.btn-teogest-success.btn-sm,
.btn-teogest-danger.btn-sm {
    padding: 6px 14px;
    font-size: 13px;
}

/* Override Bootstrap default btn */
.btn-default {
    background: #F1F5F9;
    color: var(--sidebar-text);
    border: 1px solid var(--border-subtle);
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.2s;
}

.btn-default:hover {
    background: var(--border-subtle);
    color: var(--text-primary);
    border-color: var(--text-light);
}

/* ==========================================================================
   FORMS
   ========================================================================== */
.form-control {
    border: 1px solid var(--border-input);
    border-radius: 8px;
    padding: 10px 14px;
    height: 42px;
    font-size: 14px;
    font-family: 'Inter', system-ui, sans-serif;
    color: var(--text-primary);
    background: var(--bg-card);
    transition: border-color 0.2s, box-shadow 0.2s;
    box-shadow: none;
}

.form-control:focus {
    border-color: var(--accent-blue);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control.input-sm {
    height: 38px;
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 8px;
}

select.form-control {
    appearance: auto;
}

.form-group {
    margin-bottom: 16px;
}

.form-group-xs {
    margin-bottom: 14px;
}

.form-group-xs label,
.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-horizontal .control-label {
    text-align: right;
    padding-top: 8px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
}

.input-group-addon {
    background: #F1F5F9;
    border: 1px solid var(--border-subtle);
    color: #64748B;
    font-size: 13px;
    border-radius: 8px 0 0 8px;
    padding: 8px 12px;
}

.input-group .form-control {
    border-radius: 0 8px 8px 0;
}

.input-group .form-control:first-child {
    border-radius: 8px 0 0 8px;
}

.form-check-input {
    width: 18px;
    height: 18px;
    accent-color: var(--accent-blue);
    cursor: pointer;
}

.required-star {
    color: var(--danger);
    font-weight: bold;
    margin-left: 2px;
}

/* ==========================================================================
   FILTER BAR
   ========================================================================== */
.filter-bar {
    background: var(--bg-card);
    padding: 14px 16px;
    margin-bottom: 16px;
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
}

.filter-bar .form-control {
    font-size: 13px;
    height: 36px;
    border-radius: 6px;
}

.filter-bar label {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-right: 6px;
}

.filter-bar .form-group {
    margin-bottom: 0;
}

.action-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}

/* ==========================================================================
   ALERTS
   ========================================================================== */
.alert-teogest {
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 16px;
    font-size: 14px;
    border: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.alert-teogest .close {
    margin-left: auto;
    opacity: 0.6;
    font-size: 18px;
}

.alert-success.alert-teogest {
    background: #F0FDF4;
    color: #166534;
    border: 1px solid #BBF7D0;
}

.alert-danger.alert-teogest {
    background: #FEF2F2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.alert-info {
    background: var(--active-item-bg);
    color: #1E40AF;
    border: 1px solid #BFDBFE;
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
}

/* ==========================================================================
   BADGES / LABELS
   ========================================================================== */
.label {
    font-size: 11px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 4px;
    letter-spacing: 0;
    text-transform: none;
}

.label-success {
    background: var(--green-badge-bg);
    color: var(--success);
}

.label-default {
    background: #F1F5F9;
    color: var(--sidebar-text);
}

.label-info {
    background: var(--active-item-bg);
    color: var(--accent-blue);
}

.label-warning {
    background: var(--orange-badge-bg);
    color: var(--warning);
}

.label-danger {
    background: var(--red-badge-bg);
    color: var(--danger);
}

/* Status badges */
.badge-statut {
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 500;
    text-transform: none;
    letter-spacing: 0;
}

.badge-a-demarrer {
    background: #F1F5F9;
    color: var(--sidebar-text);
}

.badge-en-cours {
    background: var(--active-item-bg);
    color: var(--accent-blue);
}

.badge-en-attente {
    background: var(--orange-badge-bg);
    color: var(--warning);
}

.badge-terminee {
    background: var(--green-badge-bg);
    color: var(--success);
}

.badge-annulee {
    background: var(--red-badge-bg);
    color: var(--danger);
}

/* ==========================================================================
   PAGE TITLE BAR (legacy for non-dashboard pages)
   ========================================================================== */
.page-title-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.page-title-bar h2 {
    font-size: 20px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.page-title-bar h2 i {
    color: var(--text-muted);
    margin-right: 8px;
    font-size: 18px;
}

.page-title-bar .page-date {
    color: #64748B;
    font-size: 14px;
    font-weight: 400;
}

.page-header {
    margin-top: 0;
    margin-bottom: 20px;
    padding-bottom: 0;
    border-bottom: none;
}

.page-header h2 {
    margin: 0;
    color: var(--text-primary);
    font-size: 20px;
    font-weight: 600;
}

.page-header h2 i {
    color: var(--text-muted);
    margin-right: 8px;
    font-size: 18px;
}

/* ==========================================================================
   CONTENT WRAPPER (app mode)
   ========================================================================== */
.content-wrapper {
    margin-top: 56px;
    padding: 20px 24px;
    min-height: calc(100vh - 56px);
    max-width: 1400px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   MISC OVERRIDES for Bootstrap 3
   ========================================================================== */
.panel {
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    box-shadow: none;
}

.nav-tabs > li > a {
    border-radius: 8px 8px 0 0;
}

.form-control-static {
    padding-top: 8px;
    font-size: 14px;
    color: var(--text-primary);
}

.modal-content {
    border-radius: 12px;
    border: none;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

.row {
    margin-left: -12px;
    margin-right: -12px;
}

[class*="col-"] {
    padding-left: 12px;
    padding-right: 12px;
}

/* Hamburger for mobile */
.header-hamburger {
    display: none;
    background: none;
    border: none;
    color: #FFFFFF;
    font-size: 20px;
    cursor: pointer;
    padding: 4px 8px;
}

/* User dropdown (header) */
.user-dropdown-menu {
    position: absolute;
    top: 100%;
    right: 0;
    margin-top: 8px;
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.12);
    min-width: 200px;
    padding: 6px 0;
    display: none;
    z-index: 1010;
}

.user-dropdown-menu.show {
    display: block;
}

.user-dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: var(--text-primary);
    font-size: 13px;
    text-decoration: none;
    transition: background 0.15s;
}

.user-dropdown-menu a:hover {
    background: #F1F5F9;
    color: var(--accent-blue);
}

.user-dropdown-menu a i {
    width: 18px;
    text-align: center;
    color: #64748B;
    font-size: 14px;
}

.user-dropdown-menu .dropdown-divider {
    border-top: 1px solid var(--border-subtle);
    margin: 4px 0;
}

/* Validation */
.field-validation-error {
    color: var(--danger);
    font-size: 12px;
    margin-top: 4px;
    display: block;
}

.validation-summary-errors {
    color: var(--danger);
    margin-bottom: 16px;
}

.validation-summary-errors ul {
    padding-left: 20px;
}

/* Utility text colors */
.text-muted {
    color: #64748B !important;
}

.text-success {
    color: var(--success) !important;
}

.text-danger {
    color: var(--danger) !important;
}

.text-warning {
    color: var(--warning) !important;
}

/* HR */
hr {
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 20px 0;
}

/* Focus visible */
*:focus-visible {
    outline: 2px solid var(--accent-blue);
    outline-offset: 2px;
}

/* ==========================================================================
   TACHE LIST (Synthese portefeuille - left column tasks)
   ========================================================================== */
.tache-list-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #F5F5F5;
}

.tache-list-item:last-child {
    border-bottom: none;
}

.tache-list-badge {
    flex-shrink: 0;
    margin-top: 2px;
}

.tache-list-content {
    flex: 1;
    min-width: 0;
}

.tache-list-title {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 2px;
}

.tache-list-sub {
    font-size: 12px;
    color: var(--text-muted);
}

.tache-list-arrow {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--accent-blue);
    color: #FFFFFF;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    align-self: center;
}

/* ==========================================================================
   RESPONSIVE
   ========================================================================== */
@media (max-width: 1200px) {
    .assistant-panel {
        display: none;
    }

    .revision-kpi-row {
        flex-wrap: wrap;
    }
}

@media (max-width: 992px) {
    .sidebar {
        display: none;
    }

    .dashboard-content {
        margin-left: 0;
    }

    .revision-layout {
        flex-direction: column;
    }

    .cycle-panel,
    .comptes-panel {
        width: 100%;
        min-width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-subtle);
    }

    .app-header-nav {
        display: none;
    }

    .header-hamburger {
        display: block;
    }
}

@media (max-width: 768px) {
    .content-wrapper,
    .app-content {
        padding: 12px 16px;
    }

    .kpi-row {
        flex-direction: column;
    }

    .page-title-bar {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }

    .revision-filters {
        flex-direction: column;
        align-items: stretch;
    }
}

/* ==========================================================================
   DASHBOARD CARDS (legacy compat for existing pages)
   ========================================================================== */
.dashboard-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.dashboard-card {
    background: var(--bg-card);
    border-radius: 8px;
    padding: 20px;
    border: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: transform 0.2s, box-shadow 0.2s;
    min-height: 90px;
}

.dashboard-card:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.dashboard-card .card-icon {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.dashboard-card.card-primary .card-icon {
    background: rgba(37, 99, 235, 0.1);
    color: var(--accent-blue);
}

.dashboard-card.card-success .card-icon {
    background: rgba(14, 150, 105, 0.1);
    color: var(--success);
}

.dashboard-card.card-warning .card-icon {
    background: rgba(249, 115, 22, 0.1);
    color: var(--warning);
}

.dashboard-card.card-danger .card-icon {
    background: rgba(239, 68, 68, 0.1);
    color: var(--danger);
}

.dashboard-card .card-info {
    flex: 1;
}

.dashboard-card .card-value {
    font-size: 28px;
    font-weight: 600;
    color: var(--text-primary);
    line-height: 1.2;
}

.dashboard-card .card-label {
    font-size: 13px;
    color: #64748B;
    font-weight: 400;
    margin-top: 2px;
}

/* Dashboard charts (legacy) */
.dashboard-charts {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: var(--bg-card);
    border-radius: 8px;
    border: 1px solid var(--border-subtle);
    overflow: hidden;
}

.chart-card-header {
    padding: 14px 16px;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.chart-card-header i {
    color: var(--text-muted);
    margin-right: 8px;
}

.chart-card-body {
    padding: 16px;
}

/* Chart placeholder */
.chart-placeholder {
    background: var(--bg-page);
    border: 2px dashed var(--border-subtle);
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
    font-size: 14px;
}

.chart-placeholder i {
    font-size: 40px;
    display: block;
    margin-bottom: 10px;
    color: var(--text-light);
}
