/* ═══════════════════════════════════════════════════════════════════════════
   DjerbaBooking — Admin CSS
   ═══════════════════════════════════════════════════════════════════════════ */

/* ─── Variables ─────────────────────────────────────────────────────────────── */
:root {
    --sidebar-width: 260px;
    --topbar-h: 64px;
    --sidebar-bg: #1a1f2e;
    --sidebar-border: rgba(255,255,255,0.06);
    --sidebar-text: #8892a4;
    --sidebar-text-hover: #c5ccd8;
    --sidebar-text-active: #ffffff;
    --sidebar-accent: #2e86c1;
    --content-bg: #f0f2f5;
    --card-bg: #ffffff;
    --primary: #1a5276;
    --primary-light: #2e86c1;
    --secondary: #d4a017;
    --success: #27ae60;
    --danger: #e74c3c;
    --warning: #f39c12;
    --purple: #8e44ad;
    --teal: #1abc9c;
    --text: #2c3e50;
    --text-muted: #7f8c8d;
    --border: #e8ecf0;
    --radius: 10px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow: 0 2px 10px rgba(0,0,0,.1);
    --shadow-lg: 0 8px 30px rgba(0,0,0,.15);
    --transition: 0.2s ease;
}

/* ─── Reset ──────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 14px;
    color: var(--text);
    background: var(--content-bg);
    line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
input, select, textarea, button { font-family: inherit; }

/* ─── Layout Admin ───────────────────────────────────────────────────────────── */
.admin-body {
    display: flex;
    min-height: 100vh;
}

/* ─── Sidebar ────────────────────────────────────────────────────────────────── */
.admin-sidebar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    background: var(--sidebar-bg);
    position: fixed;
    top: 0; left: 0;
    height: 100vh;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 200;
    display: flex;
    flex-direction: column;
    transition: transform var(--transition);
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.1) transparent;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px;
    border-bottom: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.brand-logo { font-size: 28px; }

.brand-name {
    font-size: 17px;
    font-weight: 800;
    color: #fff;
    letter-spacing: -0.3px;
    line-height: 1.2;
}

.brand-tagline {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #3d4a5c;
    margin-top: 2px;
}

.sidebar-nav { padding: 12px 0; flex: 1; }

.nav-section-title {
    padding: 16px 20px 6px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: #3d4a5c;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 11px 20px;
    color: var(--sidebar-text);
    font-size: 13.5px;
    font-weight: 500;
    border-left: 3px solid transparent;
    transition: all var(--transition);
    cursor: pointer;
    position: relative;
}

.nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: var(--sidebar-text-hover);
}

.nav-item.active {
    background: rgba(46,134,193,0.18);
    color: var(--sidebar-text-active);
    border-left-color: var(--sidebar-accent);
}

.nav-icon { font-size: 16px; width: 20px; text-align: center; flex-shrink: 0; }

.badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 2px 7px;
    border-radius: 50px;
    font-size: 11px;
    font-weight: 700;
    line-height: 1;
    margin-left: auto;
}

.badge-danger  { background: var(--danger);  color: #fff; }
.badge-success { background: var(--success); color: #fff; }
.badge-warning { background: var(--warning); color: #fff; }

.sidebar-footer {
    padding: 16px 20px;
    border-top: 1px solid var(--sidebar-border);
    flex-shrink: 0;
}

.btn-view-site {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 14px;
    border-radius: var(--radius);
    background: rgba(255,255,255,0.06);
    color: var(--sidebar-text);
    font-size: 13px;
    transition: all var(--transition);
}

.btn-view-site:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
}

/* ─── Main + Topbar ──────────────────────────────────────────────────────────── */
.admin-main {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.admin-topbar {
    height: var(--topbar-h);
    background: #fff;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    padding: 0 24px;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: var(--shadow-sm);
}

.topbar-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
}

.topbar-toggle span {
    display: block;
    width: 22px;
    height: 2px;
    background: var(--text);
    border-radius: 2px;
    transition: all var(--transition);
}

.topbar-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text);
    flex: 1;
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-name { font-size: 13px; font-weight: 600; color: var(--text); }

.btn-logout {
    padding: 8px 14px;
    border-radius: var(--radius);
    background: #f8f9fa;
    color: var(--text);
    font-size: 13px;
    font-weight: 500;
    border: 1px solid var(--border);
    transition: all var(--transition);
}

.btn-logout:hover { background: var(--danger); color: #fff; border-color: var(--danger); }

/* ─── Flash messages ─────────────────────────────────────────────────────────── */
.flash-container { padding: 16px 24px 0; }

.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 16px;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 500;
    position: relative;
}

.alert-success { background: #d4edda; color: #155724; border-left: 4px solid var(--success); }
.alert-error   { background: #f8d7da; color: #721c24; border-left: 4px solid var(--danger); }
.alert-warning { background: #fff3cd; color: #856404; border-left: 4px solid var(--warning); }
.alert-info    { background: #d1ecf1; color: #0c5460; border-left: 4px solid #17a2b8; }

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: inherit;
    opacity: 0.6;
    line-height: 1;
}
.alert-close:hover { opacity: 1; }

/* ─── Contenu admin ──────────────────────────────────────────────────────────── */
.admin-content {
    padding: 24px;
    flex: 1;
}

/* ─── Stats Grid ─────────────────────────────────────────────────────────────── */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    padding: 22px 20px;
    box-shadow: var(--shadow);
    display: flex;
    align-items: center;
    gap: 16px;
    border-left: 4px solid transparent;
    position: relative;
    transition: box-shadow var(--transition), transform var(--transition);
}

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

.stat-card.blue   { border-left-color: var(--primary-light); }
.stat-card.green  { border-left-color: var(--success); }
.stat-card.gold   { border-left-color: var(--secondary); }
.stat-card.purple { border-left-color: var(--purple); }

.stat-icon {
    font-size: 26px;
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-card.blue   .stat-icon { background: rgba(46,134,193,0.12); }
.stat-card.green  .stat-icon { background: rgba(39,174,96,0.12); }
.stat-card.gold   .stat-icon { background: rgba(212,160,23,0.12); }
.stat-card.purple .stat-icon { background: rgba(142,68,173,0.12); }

.stat-body { flex: 1; }

.stat-value {
    font-size: 30px;
    font-weight: 800;
    color: var(--text);
    line-height: 1;
    display: flex;
    align-items: center;
    gap: 8px;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 5px;
    font-weight: 500;
}

.stat-link {
    position: absolute;
    top: 14px;
    right: 16px;
    font-size: 12px;
    color: var(--primary-light);
    font-weight: 600;
    opacity: 0.7;
    transition: opacity var(--transition);
}

.stat-link:hover { opacity: 1; }

/* ─── Dashboard Grid ─────────────────────────────────────────────────────────── */
.dashboard-grid {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 20px;
}

/* ─── Cards ──────────────────────────────────────────────────────────────────── */
.card {
    background: var(--card-bg);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 20px;
    border-bottom: 1px solid var(--border);
}

.card-header h3 {
    font-size: 15px;
    font-weight: 700;
    color: var(--text);
}

.card-link {
    font-size: 13px;
    color: var(--primary-light);
    font-weight: 600;
}

.card-body { padding: 20px; }
.card-body.p-0 { padding: 0; }

/* ─── Tables ─────────────────────────────────────────────────────────────────── */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.table th {
    background: #f8f9fa;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    color: var(--text-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border);
}

.table td {
    padding: 13px 16px;
    border-bottom: 1px solid #f0f2f5;
    vertical-align: middle;
}

.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: #fafbfc; }

.table-compact td,
.table-compact th { padding: 10px 16px; }

/* ─── Quick Actions ──────────────────────────────────────────────────────────── */
.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    transition: all var(--transition);
    border: 2px solid transparent;
}

.quick-action:hover { transform: translateY(-2px); filter: brightness(1.05); }

.quick-action.blue   { background: rgba(46,134,193,0.1);  color: var(--primary-light); border-color: rgba(46,134,193,0.2); }
.quick-action.green  { background: rgba(39,174,96,0.1);   color: var(--success);       border-color: rgba(39,174,96,0.2); }
.quick-action.gold   { background: rgba(212,160,23,0.1);  color: #b8860b;              border-color: rgba(212,160,23,0.2); }
.quick-action.gray   { background: rgba(127,140,141,0.1); color: var(--text-muted);    border-color: rgba(127,140,141,0.2); }
.quick-action.purple { background: rgba(142,68,173,0.1);  color: var(--purple);        border-color: rgba(142,68,173,0.2); }
.quick-action.teal   { background: rgba(26,188,156,0.1);  color: var(--teal);          border-color: rgba(26,188,156,0.2); }

.qa-icon { font-size: 22px; }
.qa-label { font-size: 12.5px; line-height: 1.3; }

/* ─── Action badges ──────────────────────────────────────────────────────────── */
.action-badge {
    display: inline-block;
    padding: 3px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 600;
    background: #e8f4fc;
    color: var(--primary);
}

/* ─── Empty state ────────────────────────────────────────────────────────────── */
.empty-state {
    padding: 40px;
    text-align: center;
    color: var(--text-muted);
}

/* ─── Utilitaires ────────────────────────────────────────────────────────────── */
.text-muted { color: var(--text-muted); }
.text-center { text-align: center; }
.mt-1 { margin-top: 4px; }
.mt-2 { margin-top: 8px; }
.ml-1 { margin-left: 4px; }
code { font-family: 'Consolas', monospace; font-size: 12px; background: #f0f2f5; padding: 2px 6px; border-radius: 4px; }

/* ══════════════════════════════════════════════════════════════════════════════
   PAGE LOGIN
═══════════════════════════════════════════════════════════════════════════════ */
.login-page {
    min-height: 100vh;
    background: var(--content-bg);
}

.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Côté gauche — décoration */
.login-deco {
    flex: 1;
    background: linear-gradient(145deg, #0d3b5e 0%, #1a5276 40%, #2e86c1 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px 48px;
    position: relative;
    overflow: hidden;
}

.login-deco::before {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    top: -150px; right: -150px;
}

.login-deco::after {
    content: '';
    position: absolute;
    width: 300px; height: 300px;
    background: rgba(255,255,255,0.04);
    border-radius: 50%;
    bottom: -100px; left: -100px;
}

.deco-content {
    position: relative;
    z-index: 1;
    color: #fff;
    max-width: 400px;
}

.deco-logo {
    font-size: 64px;
    margin-bottom: 20px;
}

.deco-title {
    font-size: 36px;
    font-weight: 900;
    line-height: 1.1;
    margin-bottom: 12px;
    letter-spacing: -0.5px;
}

.deco-subtitle {
    font-size: 16px;
    opacity: 0.75;
    line-height: 1.6;
    margin-bottom: 36px;
}

.deco-features {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.deco-feature {
    font-size: 14px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* Côté droit — formulaire */
.login-form-side {
    width: 460px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 48px;
    background: #fff;
}

.login-card { width: 100%; max-width: 380px; }

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

.login-header h2 {
    font-size: 26px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
}

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

.form-group { margin-bottom: 20px; }

.form-group label {
    display: block;
    font-size: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.7px;
}

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 14px;
    font-size: 16px;
    pointer-events: none;
    z-index: 1;
}

.input-wrapper input {
    width: 100%;
    padding: 13px 42px;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    font-size: 15px;
    color: var(--text);
    background: #f8fafc;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.input-wrapper input:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(46,134,193,0.12);
    background: #fff;
}

.input-toggle-pass {
    position: absolute;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 16px;
    padding: 4px;
    opacity: 0.6;
    transition: opacity var(--transition);
}

.input-toggle-pass:hover { opacity: 1; }

.btn-login {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.3px;
    transition: transform var(--transition), box-shadow var(--transition);
    margin-top: 8px;
}

.btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26,82,118,0.35);
}

.btn-login:active { transform: translateY(0); }

.login-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    font-size: 13px;
}

.back-site { color: var(--primary-light); font-weight: 500; }
.back-site:hover { text-decoration: underline; }

.login-version { color: var(--text-muted); }

/* ─── Sidebar overlay mobile ────────────────────────────────────────────────── */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.5);
    z-index: 150;
}

/* ─── Responsive ─────────────────────────────────────────────────────────────── */
@media (max-width: 1100px) {
    .stats-grid { grid-template-columns: repeat(2, 1fr); }
    .dashboard-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .sidebar-overlay.open { display: block; }
    .admin-main { margin-left: 0; }
    .topbar-toggle { display: flex; }
    .topbar-title { font-size: 15px; }
    .user-name { display: none; }
    .btn-logout { padding: 8px 10px; font-size: 12px; }
    .admin-content { padding: 16px; }
    .stats-grid { grid-template-columns: 1fr 1fr; gap: 12px; }
    .stat-card { padding: 16px; }
    .stat-value { font-size: 24px; }
    .quick-actions { grid-template-columns: 1fr; }
    /* Login responsive */
    .login-deco { display: none; }
    .login-form-side { width: 100%; padding: 32px 24px; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   PHASE 2 — COMPOSANTS GÉNÉRIQUES
   Boutons · Formulaires · Onglets · Upload · Grille images · Pagination
═══════════════════════════════════════════════════════════════════════════════ */

/* ─── Page header ────────────────────────────────────────────────────────────── */
.page-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 16px;
}

.page-subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* ─── Boutons génériques ────────────────────────────────────────────────────── */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    border: 1.5px solid transparent;
    cursor: pointer;
    text-decoration: none;
    transition: background var(--transition), color var(--transition),
                box-shadow var(--transition), transform var(--transition);
    white-space: nowrap;
    line-height: 1;
    background: none;
}

.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }

.btn-sm { padding: 5px 10px; font-size: 12px; border-radius: 6px; }
.btn-lg { padding: 12px 22px; font-size: 15px; }

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    border-color: transparent;
    box-shadow: 0 2px 8px rgba(26,82,118,0.25);
}
.btn-primary:hover { box-shadow: 0 4px 14px rgba(26,82,118,0.35); color: #fff; }

.btn-success {
    background: var(--success);
    color: #fff;
    border-color: transparent;
}
.btn-success:hover { background: #229954; color: #fff; }

.btn-danger {
    background: var(--danger);
    color: #fff;
    border-color: transparent;
}
.btn-danger:hover { background: #cb4335; color: #fff; }

.btn-warning {
    background: var(--warning);
    color: #fff;
    border-color: transparent;
}
.btn-warning:hover { background: #d68910; color: #fff; }

.btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--border);
}
.btn-ghost:hover { background: #f0f2f5; border-color: #d0d4da; }

/* ─── Badges supplémentaires ────────────────────────────────────────────────── */
.badge-gray { background: #e8ecf0; color: #5a6475; }
.badge-info { background: rgba(46,134,193,0.12); color: var(--primary-light); }
.ml-2  { margin-left: 8px; }
.mb-4  { margin-bottom: 20px; }
.mt-2  { margin-top: 8px; }

/* ─── Table extras ──────────────────────────────────────────────────────────── */
.table-responsive { overflow-x: auto; }

.table-thumb {
    width: 48px;
    height: 36px;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}

.table-thumb-empty {
    width: 48px;
    height: 36px;
    background: #f0f2f5;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.row-title {
    font-weight: 600;
    color: var(--primary);
}
.row-title:hover { color: var(--primary-light); text-decoration: underline; }

.table-actions { display: flex; gap: 6px; align-items: center; }

/* ─── Filtre bar ────────────────────────────────────────────────────────────── */
.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.filter-select {
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    background: #fff;
    cursor: pointer;
    min-width: 140px;
    outline: none;
}
.filter-select:focus { border-color: var(--primary-light); }

.filter-search {
    flex: 1;
    min-width: 180px;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text);
    outline: none;
}
.filter-search:focus { border-color: var(--primary-light); }

/* ─── Pagination ────────────────────────────────────────────────────────────── */
.pagination-wrapper {
    display: flex;
    justify-content: center;
    padding: 16px;
    border-top: 1px solid var(--border);
}

.pagination { display: flex; gap: 6px; align-items: center; }

.page-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    border-radius: var(--radius);
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: #fff;
    border: 1.5px solid var(--border);
    transition: all var(--transition);
    text-decoration: none;
}
.page-link:hover   { border-color: var(--primary-light); color: var(--primary-light); }
.page-link.active  { background: var(--primary); color: #fff; border-color: var(--primary); }

/* ─── Formulaires admin ─────────────────────────────────────────────────────── */
.form-row {
    display: flex;
    gap: 16px;
    margin-bottom: 0;
}

.form-col { flex: 1; min-width: 0; }

.field {
    margin-bottom: 18px;
}

.field label {
    display: block;
    font-size: 11.5px;
    font-weight: 700;
    color: var(--text);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin-bottom: 7px;
}

.field.required label::after {
    content: ' *';
    color: var(--danger);
}

.field-input,
.field-select,
.field-textarea {
    width: 100%;
    padding: 10px 13px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text);
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
    font-family: inherit;
}

.field-input:focus,
.field-select:focus,
.field-textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 3px rgba(46,134,193,0.1);
}

.field-textarea { resize: vertical; line-height: 1.6; }

.field-select { cursor: pointer; }

/* Checkboxes */
.checkbox-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 10px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    padding: 8px 12px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    transition: border-color var(--transition), background var(--transition);
}
.checkbox-label:hover { border-color: var(--primary-light); background: rgba(46,134,193,0.04); }

.checkbox-label input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--primary-light);
    flex-shrink: 0;
}

/* ─── Onglets ───────────────────────────────────────────────────────────────── */
.page-tabs {
    display: flex;
    border-bottom: 2px solid var(--border);
    margin-bottom: 24px;
    gap: 0;
    overflow-x: auto;
}

.tab-btn {
    padding: 11px 20px;
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    font-size: 13.5px;
    font-weight: 600;
    color: var(--text-muted);
    cursor: pointer;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: color var(--transition), border-color var(--transition);
}
.tab-btn:hover  { color: var(--text); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }

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

/* ─── Zone d'upload ────────────────────────────────────────────────────────── */
.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius-lg);
    padding: 36px 24px;
    text-align: center;
    cursor: pointer;
    transition: border-color var(--transition), background var(--transition);
    margin-bottom: 20px;
    user-select: none;
}
.upload-zone:hover,
.upload-zone:focus  { border-color: var(--primary-light); background: rgba(46,134,193,0.03); outline: none; }
.upload-zone.drag-over {
    border-color: var(--primary-light);
    background: rgba(46,134,193,0.07);
    box-shadow: inset 0 0 0 2px rgba(46,134,193,0.3);
}

.upload-state { pointer-events: none; }

.upload-bar {
    width: 100%;
    max-width: 280px;
    height: 6px;
    background: #e8ecf0;
    border-radius: 3px;
    margin: 14px auto 0;
    overflow: hidden;
}

#uploadBarFill {
    height: 100%;
    width: 60%;
    background: var(--primary-light);
    border-radius: 3px;
    animation: barPulse 1.2s ease-in-out infinite;
}

@keyframes barPulse {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0.45; }
}

/* ─── Grille images ─────────────────────────────────────────────────────────── */
.img-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 14px;
    margin-top: 4px;
}

.img-card {
    border: 2px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    background: #fff;
    transition: border-color var(--transition), box-shadow var(--transition);
}
.img-card:hover       { box-shadow: var(--shadow); }
.img-card.is-main     { border-color: var(--secondary); box-shadow: 0 0 0 2px rgba(212,160,23,0.25); }

.img-card-thumb {
    position: relative;
    aspect-ratio: 4/3;
    overflow: hidden;
    background: #f0f2f5;
}
.img-card-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}
.img-card:hover .img-card-thumb img { transform: scale(1.04); }

.img-main-badge {
    position: absolute;
    top: 6px;
    left: 6px;
    background: var(--secondary);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 50px;
    line-height: 1;
}

.img-card-actions {
    display: flex;
    gap: 4px;
    padding: 8px 8px 0;
    flex-wrap: wrap;
}

.img-card-meta {
    display: flex;
    justify-content: space-between;
    padding: 6px 8px 8px;
    font-size: 11px;
    color: var(--text-muted);
    overflow: hidden;
}
.img-card-meta span:first-child {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ─── Responsive Phase 2 ────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .form-row       { flex-direction: column; gap: 0; }
    .page-header    { flex-direction: column; }
    .img-grid       { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
    .checkbox-grid  { grid-template-columns: 1fr 1fr; }
    .filter-form    { gap: 8px; }
    .filter-select,
    .filter-search  { min-width: 0; width: 100%; }
}

/* ══════════════════════════════════════════════════════════════════════════════
   PHASE 4 — GRILLE DE TRADUCTIONS
═══════════════════════════════════════════════════════════════════════════════ */

.translations-table th,
.translations-table td {
    padding: 8px 10px;
    vertical-align: middle;
}

.translations-table .field-input {
    padding: 7px 10px;
    font-size: 13px;
    min-width: 130px;
    width: 100%;
}

/* Colonne FR = langue source : légèrement mise en valeur */
.translations-table input[data-fr="1"] {
    background: rgba(46,134,193,0.05);
    border-color: rgba(46,134,193,0.25);
    font-weight: 600;
}
.translations-table input[data-fr="1"]:focus {
    background: #fff;
}

.translations-table code {
    white-space: nowrap;
    font-size: 11.5px;
}

.btn-translate-row {
    font-size: 15px;
    line-height: 1;
    padding: 6px 9px;
}

.btn-add-row {
    color: var(--primary-light);
    font-weight: 600;
}
.btn-add-row:hover {
    background: rgba(46,134,193,0.08);
    border-color: rgba(46,134,193,0.3);
}

/* ══════════════════════════════════════════════════════════════════════════════
   PHASE 4 — PAGE PARAMÈTRES
═══════════════════════════════════════════════════════════════════════════════ */

.field.has-error .field-input,
.field.has-error .field-select,
.field.has-error .field-textarea {
    border-color: var(--danger);
    background: rgba(231,76,60,0.04);
}

.color-field {
    display: flex;
    gap: 10px;
    align-items: center;
}
.color-field input[type="color"] {
    width: 50px;
    height: 38px;
    padding: 2px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    cursor: pointer;
    background: #fff;
}

.password-field {
    display: flex;
    gap: 8px;
}
.password-field input {
    flex: 1;
}
.btn-toggle-pw {
    font-size: 15px;
    padding: 0 14px;
    flex-shrink: 0;
}

/* ═══ PAGE STATISTIQUES (/admin/statistiques) ════════════════════════════════ */

/* ── Grille à 2 colonnes égales (top maisons / top voitures) ─────────────── */
.stats-two-col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

/* ── Sélecteur de période (graphique) ─────────────────────────────────────── */
.period-toggle {
    display: flex;
    gap: 4px;
    background: var(--content-bg);
    padding: 4px;
    border-radius: var(--radius);
}
.period-btn {
    border: none;
    background: transparent;
    padding: 6px 14px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 700;
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}
.period-btn:hover { color: var(--text); }
.period-btn.active {
    background: var(--card-bg);
    color: var(--primary);
    box-shadow: var(--shadow-sm);
}

/* ── Conteneur du graphique ─────────────────────────────────────────────── */
.chart-wrap {
    position: relative;
    width: 100%;
    min-height: 280px;
}

/* ── Ligne d'un élément du classement (top maisons/voitures) ─────────────── */
.top-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    border-bottom: 1px solid var(--border);
}
.top-row:last-child { border-bottom: none; }
.top-rank {
    flex-shrink: 0;
    width: 26px;
    font-size: 12px;
    font-weight: 800;
    color: var(--text-muted);
    text-align: center;
}
.top-info { flex: 1; min-width: 0; }
.top-title {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.top-meta {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 2px;
}

@media (max-width: 1100px) {
    .stats-two-col { grid-template-columns: 1fr; }
}

/* ═══ PAGE JOURNAUX (/admin/logs) ═══════════════════════════════════════════ */

.log-pre {
    display: block;
    background: #0d1117;
    color: #c9d1d9;
    font-family: 'Consolas', 'SFMono-Regular', 'Courier New', monospace;
    font-size: 11.5px;
    line-height: 1.65;
    padding: 18px 20px;
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
    max-height: 560px;
    overflow-y: auto;
    border-radius: 0 0 var(--radius) var(--radius);
}
