/* ── Variables ─────────────────────────────────────────────────────────── */
:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #eff6ff;
    --navbar-bg: #1e3a5f;
    --navbar-hover: rgba(255,255,255,0.1);
    --card-radius: 14px;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

body {
    background: #f4f6fb;
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* ── Navbar ────────────────────────────────────────────────────────────── */
.app-navbar {
    background: var(--navbar-bg);
    min-height: 58px;
}

.navbar-brand {
    color: #fff !important;
    font-size: 1.05rem;
}

.navbar-brand-icon {
    width: 32px;
    height: 32px;
    background: var(--primary);
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    color: #fff;
    flex-shrink: 0;
}

/* Select connexion */
.navbar-select-icon {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    border-right: none;
    color: #fff;
}

.navbar-select {
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 0.875rem;
}

.navbar-select:focus {
    background: rgba(255,255,255,0.15);
    border-color: rgba(255,255,255,0.4);
    box-shadow: none;
    color: #fff;
}

.navbar-select option {
    background: var(--navbar-bg);
    color: #fff;
}

/* Language switcher */
.lang-switcher {
    display: flex;
    align-items: center;
    gap: 4px;
}

.btn-lang {
    background: var(--navbar-hover);
    border: 1px solid rgba(255,255,255,0.15);
    color: rgba(255,255,255,0.6);
    border-radius: 6px;
    padding: 3px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.15s;
    letter-spacing: 0.2px;
}

.btn-lang:hover {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

.btn-lang.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

/* Admin button */
.btn-navbar-admin {
    background: rgba(234, 179, 8, 0.15);
    border: 1px solid rgba(234, 179, 8, 0.4);
    color: #fbbf24;
    font-size: 0.8rem;
}

.btn-navbar-admin:hover {
    background: rgba(234, 179, 8, 0.25);
    color: #fcd34d;
    border-color: rgba(234, 179, 8, 0.6);
}

/* User button */
.btn-navbar-user {
    background: var(--navbar-hover);
    border: 1px solid rgba(255,255,255,0.15);
    color: #fff;
    font-size: 0.8rem;
}

.btn-navbar-user:hover,
.btn-navbar-user:focus {
    background: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.3);
}

.btn-navbar-user::after {
    margin-left: 4px;
}

.user-avatar {
    width: 26px;
    height: 26px;
    background: var(--primary);
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
    color: #fff;
    flex-shrink: 0;
}

/* Dropdown */
.dropdown-menu {
    border-radius: 10px;
    font-size: 0.875rem;
    min-width: 210px;
}

.dropdown-item {
    padding: 0.5rem 1rem;
    border-radius: 6px;
    margin: 0 4px;
    width: calc(100% - 8px);
}

/* ── Report cards ──────────────────────────────────────────────────────── */
.report-card {
    background: #fff;
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    overflow: hidden;
    border: 1px solid #e8edf5;
}

.report-card-header {
    background: var(--primary-light);
    border-bottom: 1px solid #dbeafe;
    color: var(--primary-dark);
    font-weight: 600;
    font-size: 0.9rem;
    padding: 0.75rem 1.25rem;
}

/* ── Report table ──────────────────────────────────────────────────────── */
.report-table {
    font-size: 0.9rem;
}

.report-table thead tr th {
    background: #f8faff;
    color: #64748b;
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid #e2e8f0;
    padding: 0.65rem 1.25rem;
    white-space: nowrap;
}

.report-table tbody tr td {
    padding: 0.6rem 1.25rem;
    vertical-align: middle;
    border-color: #f1f5f9;
    color: #1e293b;
}

.report-table tbody tr:hover td {
    background: #f8faff;
}

.report-table tfoot tr.table-total td {
    padding: 0.7rem 1.25rem;
    border-top: 2px solid #dbeafe;
    background: #eff6ff;
    color: var(--primary-dark);
    font-size: 0.9rem;
}

.table-subtotal td {
    background: #fafafa;
    border-top: 1px dashed #e2e8f0 !important;
    border-bottom: 1px dashed #e2e8f0 !important;
    padding-top: 0.45rem !important;
    padding-bottom: 0.45rem !important;
    font-size: 0.85rem;
}

/* ── Mode badges ───────────────────────────────────────────────────────── */
.badge-mode {
    display: inline-block;
    padding: 0.2rem 0.55rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.3px;
    background: #e0e7ff;
    color: #3730a3;
}

/* ── Flash banner ──────────────────────────────────────────────────────── */
.flash-banner {
    display: flex;
    padding: 1rem 1.5rem;
    border-bottom: 1px solid transparent;
    animation: flashSlideIn 0.3s ease;
}

@keyframes flashSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.flash-danger  { background: #fef2f2; border-color: #fecaca; color: #991b1b; }
.flash-warning { background: #fffbeb; border-color: #fde68a; color: #92400e; }
.flash-success { background: #f0fdf4; border-color: #bbf7d0; color: #166534; }
.flash-info    { background: #eff6ff; border-color: #bfdbfe; color: #1e40af; }

.flash-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
}

.flash-danger  .flash-icon { background: #fee2e2; color: #dc2626; }
.flash-warning .flash-icon { background: #fef3c7; color: #d97706; }
.flash-success .flash-icon { background: #dcfce7; color: #16a34a; }
.flash-info    .flash-icon { background: #dbeafe; color: #2563eb; }

.flash-body {
    display: flex;
    flex-direction: column;
    gap: 1px;
    min-width: 0;
}

.flash-title {
    font-weight: 700;
    font-size: 0.875rem;
}

.flash-message {
    font-size: 0.8rem;
    opacity: 0.85;
    word-break: break-word;
}

.flash-close {
    background: none;
    border: none;
    font-size: 0.9rem;
    opacity: 0.5;
    cursor: pointer;
    padding: 0.25rem;
    color: inherit;
    flex-shrink: 0;
    align-self: flex-start;
}

.flash-close:hover { opacity: 1; }

/* ── Shortcut buttons ──────────────────────────────────────────────────── */
.btn-xs {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 6px;
    line-height: 1.5;
}

/* ── Date inputs ───────────────────────────────────────────────────────── */
.date-input {
    width: auto;
    border-radius: 8px;
    border-color: #d1dafe;
    font-size: 0.8rem;
    color: #1e293b;
    cursor: pointer;
}

.date-input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* ── PDF button ────────────────────────────────────────────────────────── */
#btnPdf {
    border-radius: 8px;
    font-size: 0.85rem;
    padding: 0.45rem 1rem;
}

#btnPdf:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
