/* ================================================================
   FLUENT DESIGN SYSTEM — Windows 11 style for Admin Panel
   Font    : Segoe UI Variable › Segoe UI › Microsoft Sans Serif
   Accent  : #0067C0  (Windows 11 system blue)
   Radius  : 4 px (controls & buttons) / 8 px (cards & modals)
   ================================================================ */

/* ── 1. FONT STACK ─────────────────────────────────────────────── */
.admin-layout,
.admin-layout *,
.modal .modal-content,
.modal .modal-content * {
    font-family: "Segoe UI Variable", "Segoe UI", "Microsoft Sans Serif",
                 -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif !important;
    -webkit-font-smoothing: antialiased;
}

/* ── 2. DESIGN TOKENS (CSS custom properties) ──────────────────── */
.admin-layout {
    /* Accent */
    --fl-accent:            #0067C0;
    --fl-accent-hover:      #005AA6;
    --fl-accent-active:     #004F91;
    --fl-accent-light:      #EBF3FB;
    --fl-accent-text:       #003E6B;

    /* Surfaces */
    --fl-bg:                #F3F3F3;
    --fl-surface:           #FFFFFF;
    --fl-surface-alt:       #FAFAFA;
    --fl-surface-raised:    #FFFFFF;

    /* Text */
    --fl-text-primary:      #1A1A1A;
    --fl-text-secondary:    #5D5D5D;
    --fl-text-disabled:     #A0A0A0;
    --fl-text-on-accent:    #FFFFFF;

    /* Borders */
    --fl-border:            rgba(0, 0, 0, 0.12);
    --fl-border-strong:     rgba(0, 0, 0, 0.22);
    --fl-divider:           rgba(0, 0, 0, 0.065);

    /* States */
    --fl-hover:             rgba(0, 0, 0, 0.04);
    --fl-active:            rgba(0, 0, 0, 0.07);
    --fl-selected:          rgba(0, 103, 192, 0.08);

    /* Radius */
    --fl-r-xs:  2px;
    --fl-r-sm:  4px;
    --fl-r-md:  6px;
    --fl-r-lg:  8px;
    --fl-r-xl:  10px;

    /* Shadows */
    --fl-shadow-1: 0 1px 2px rgba(0,0,0,0.06);
    --fl-shadow-2: 0 2px 8px rgba(0,0,0,0.08), 0 0 1px rgba(0,0,0,0.04);
    --fl-shadow-4: 0 4px 16px rgba(0,0,0,0.10), 0 1px 4px rgba(0,0,0,0.06);
    --fl-shadow-8: 0 8px 32px rgba(0,0,0,0.14), 0 2px 8px rgba(0,0,0,0.06);

    /* Transition */
    --fl-ease:  all 0.13s cubic-bezier(0.4, 0, 0.2, 1);

    background: var(--fl-bg);
}

/* ══════════════════════════════════════════════════════════════════
   SIDEBAR
   ══════════════════════════════════════════════════════════════════ */
.admin-sidebar {
    background: #202020;
    border-right: 1px solid rgba(255,255,255,0.05);
    box-shadow: none;
}

.sidebar-header {
    padding: 0.9rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo span {
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: -0.01em;
}

.sidebar-logo svg { color: #60AAFF; }

.nav-section-label {
    font-size: 0.67rem;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.28);
    padding: 0 0.55rem 0.3rem;
    margin-top: 0.2rem;
}

.sidebar-link {
    border-radius: var(--fl-r-sm);
    padding: 0.5rem 0.65rem;
    font-size: 0.8125rem;
    font-weight: 400;
    color: rgba(255,255,255,0.72);
    margin-bottom: 1px;
    gap: 0.65rem;
    transition: background 0.1s ease, color 0.1s ease;
}

.sidebar-link:hover {
    background: rgba(255,255,255,0.06);
    color: rgba(255,255,255,0.93);
}

.sidebar-link.active {
    background: rgba(0,103,192,0.28);
    color: #60AAFF;
    font-weight: 500;
}

.sidebar-logout {
    border-radius: var(--fl-r-sm);
    padding: 0.5rem 0.65rem;
    font-size: 0.8125rem;
    transition: background 0.1s ease, color 0.1s ease;
}

.sidebar-footer {
    border-top: 1px solid rgba(255,255,255,0.06);
}

.admin-sidebar::-webkit-scrollbar { width: 4px; }
.admin-sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.14); border-radius: 2px; }

/* ══════════════════════════════════════════════════════════════════
   TOPBAR
   ══════════════════════════════════════════════════════════════════ */
.admin-topbar {
    height: 48px;
    background: var(--fl-surface);
    border-bottom: 1px solid var(--fl-border);
    box-shadow: none;
    padding: 0 1.25rem;
}

.sidebar-toggle {
    border-radius: var(--fl-r-sm);
    color: var(--fl-text-secondary);
}

.sidebar-toggle:hover {
    background: var(--fl-hover);
    color: var(--fl-text-primary);
}

.topbar-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--fl-text-primary);
}

/* User dropdown */
.user-dropdown-btn {
    border-radius: var(--fl-r-sm);
}

.user-dropdown-btn:hover {
    background: var(--fl-hover);
    border-color: var(--fl-border);
}

.user-dropdown-menu {
    border-radius: var(--fl-r-lg) !important;
    border: 1px solid var(--fl-border) !important;
    box-shadow: var(--fl-shadow-4) !important;
}

.user-dropdown-header { background: var(--fl-surface-alt); }

.user-dropdown-item {
    border-radius: var(--fl-r-sm);
    font-size: 0.8125rem;
    color: var(--fl-text-primary);
}

.user-dropdown-item:hover {
    background: var(--fl-hover);
    color: var(--fl-text-primary);
}

/* ══════════════════════════════════════════════════════════════════
   CONTENT AREA
   ══════════════════════════════════════════════════════════════════ */
.admin-content {
    padding: 1.5rem;
}

/* Page heading */
.admin-layout h2.mb-0.fw-bold,
.admin-layout h2.fw-bold {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--fl-text-primary);
    letter-spacing: -0.01em;
}

.admin-layout .cms-page-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--fl-text-primary);
    margin: 0;
}

/* ══════════════════════════════════════════════════════════════════
   CARDS
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .card {
    border: 1px solid var(--fl-border) !important;
    border-radius: var(--fl-r-lg) !important;
    box-shadow: var(--fl-shadow-1) !important;
    background: var(--fl-surface-raised);
}

.admin-layout .card-body { padding: 1.1rem 1.25rem; }

.admin-layout .card-header {
    background: var(--fl-surface-alt) !important;
    border-bottom: 1px solid var(--fl-border) !important;
    border-radius: var(--fl-r-lg) var(--fl-r-lg) 0 0 !important;
    font-size: 0.8125rem;
    font-weight: 600;
    padding: 0.65rem 1.25rem;
}

/* ══════════════════════════════════════════════════════════════════
   BUTTONS
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .btn {
    border-radius: var(--fl-r-sm) !important;
    font-family: "Segoe UI Variable", "Segoe UI", "Microsoft Sans Serif", sans-serif !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    height: 32px;
    padding: 0 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 6px !important;
    border-width: 1px !important;
    line-height: 1 !important;
    letter-spacing: 0;
    transition: var(--fl-ease) !important;
}

/* Accent / Primary */
.admin-layout .btn-primary {
    background: var(--fl-accent) !important;
    border-color: var(--fl-accent) !important;
    color: #fff !important;
    box-shadow: 0 1px 2px rgba(0,103,192,0.18) !important;
}
.admin-layout .btn-primary:hover {
    background: var(--fl-accent-hover) !important;
    border-color: var(--fl-accent-hover) !important;
    box-shadow: 0 2px 6px rgba(0,103,192,0.22) !important;
}
.admin-layout .btn-primary:active,
.admin-layout .btn-primary.active {
    background: var(--fl-accent-active) !important;
    border-color: var(--fl-accent-active) !important;
}

/* Secondary */
.admin-layout .btn-secondary {
    background: transparent !important;
    border-color: var(--fl-border-strong) !important;
    color: var(--fl-text-primary) !important;
    box-shadow: none !important;
}
.admin-layout .btn-secondary:hover {
    background: var(--fl-hover) !important;
    border-color: rgba(0,0,0,0.28) !important;
}
.admin-layout .btn-secondary:active { background: var(--fl-active) !important; }

/* Outline Secondary */
.admin-layout .btn-outline-secondary {
    background: transparent !important;
    border-color: var(--fl-border-strong) !important;
    color: var(--fl-text-primary) !important;
    box-shadow: none !important;
}
.admin-layout .btn-outline-secondary:hover {
    background: var(--fl-hover) !important;
    border-color: rgba(0,0,0,0.28) !important;
    color: var(--fl-text-primary) !important;
}
.admin-layout .btn-outline-secondary:active { background: var(--fl-active) !important; }

/* Outline Primary */
.admin-layout .btn-outline-primary {
    background: transparent !important;
    border-color: var(--fl-accent) !important;
    color: var(--fl-accent) !important;
    box-shadow: none !important;
}
.admin-layout .btn-outline-primary:hover {
    background: var(--fl-accent-light) !important;
    color: var(--fl-accent) !important;
}
.admin-layout .btn-outline-primary:active { background: rgba(0,103,192,0.12) !important; }

/* Danger */
.admin-layout .btn-danger {
    background: #C42B1C !important;
    border-color: #C42B1C !important;
    color: #fff !important;
}
.admin-layout .btn-danger:hover  { background: #AA2418 !important; border-color: #AA2418 !important; }
.admin-layout .btn-danger:active { background: #921E15 !important; }

/* Outline Danger */
.admin-layout .btn-outline-danger {
    background: transparent !important;
    border-color: #C42B1C !important;
    color: #C42B1C !important;
}
.admin-layout .btn-outline-danger:hover { background: #FDF3F2 !important; }

/* Success */
.admin-layout .btn-success {
    background: #107C10 !important;
    border-color: #107C10 !important;
    color: #fff !important;
}
.admin-layout .btn-success:hover { background: #0D6B0D !important; }

/* Outline Success */
.admin-layout .btn-outline-success {
    background: transparent !important;
    border-color: #107C10 !important;
    color: #107C10 !important;
}
.admin-layout .btn-outline-success:hover { background: #F0FAF0 !important; }

/* Warning */
.admin-layout .btn-warning {
    background: #F7630C !important;
    border-color: #F7630C !important;
    color: #fff !important;
}
.admin-layout .btn-warning:hover { background: #D4550A !important; }

/* Info */
.admin-layout .btn-info {
    background: #0078D4 !important;
    border-color: #0078D4 !important;
    color: #fff !important;
}
.admin-layout .btn-info:hover { background: #006ABE !important; }

.admin-layout .btn-outline-info {
    background: transparent !important;
    border-color: #0078D4 !important;
    color: #0078D4 !important;
}
.admin-layout .btn-outline-info:hover { background: #EFF6FD !important; color: #0078D4 !important; }

/* Sizes */
.admin-layout .btn-sm {
    height: 26px !important;
    padding: 0 10px !important;
    font-size: 0.75rem !important;
}
.admin-layout .btn-lg {
    height: 40px !important;
    padding: 0 22px !important;
    font-size: 0.9375rem !important;
}

/* Focus ring */
.admin-layout .btn:focus-visible {
    outline: 2px solid var(--fl-accent) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

/* btn-close */
.admin-layout .btn-close {
    border-radius: var(--fl-r-sm) !important;
    opacity: 0.45;
    transition: opacity 0.1s, background 0.1s;
}
.admin-layout .btn-close:hover {
    opacity: 0.85;
    background-color: var(--fl-hover) !important;
}

/* ══════════════════════════════════════════════════════════════════
   FORM CONTROLS (TextBox / Input)
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .form-control,
.admin-layout .form-select {
    border: 1px solid var(--fl-border) !important;
    border-bottom: 1.5px solid rgba(0,0,0,0.22) !important;
    border-radius: var(--fl-r-sm) !important;
    height: 32px;
    font-size: 0.8125rem !important;
    font-family: "Segoe UI Variable", "Segoe UI", "Microsoft Sans Serif", sans-serif !important;
    color: var(--fl-text-primary) !important;
    background-color: rgba(255,255,255,0.82) !important;
    padding: 4px 10px !important;
    box-shadow: none !important;
    outline: none !important;
    transition: border-color 0.12s, background 0.12s !important;
}

.admin-layout .form-control:hover,
.admin-layout .form-select:hover {
    background: rgba(255,255,255,0.96) !important;
    border-color: rgba(0,0,0,0.18) !important;
    border-bottom-color: rgba(0,0,0,0.44) !important;
}

.admin-layout .form-control:focus,
.admin-layout .form-select:focus {
    border-color: var(--fl-border) !important;
    border-bottom: 2px solid var(--fl-accent) !important;
    background: #fff !important;
    box-shadow: none !important;
    outline: none !important;
    color: var(--fl-text-primary) !important;
}

.admin-layout textarea.form-control {
    height: auto !important;
    min-height: 72px;
    resize: vertical;
    padding: 6px 10px !important;
}

.admin-layout .form-control::placeholder {
    color: var(--fl-text-disabled) !important;
    font-size: 0.8125rem;
}

.admin-layout .form-label {
    font-size: 0.79rem !important;
    font-weight: 500 !important;
    color: var(--fl-text-secondary) !important;
    margin-bottom: 4px !important;
}

.admin-layout .form-text {
    font-size: 0.74rem !important;
    color: var(--fl-text-disabled) !important;
}

/* Input group */
.admin-layout .input-group-text {
    background: var(--fl-surface-alt) !important;
    border: 1px solid var(--fl-border) !important;
    border-radius: var(--fl-r-sm) !important;
    font-size: 0.8125rem !important;
    color: var(--fl-text-secondary) !important;
    height: 32px;
    padding: 4px 10px !important;
}

/* Select arrow — override Bootstrap's CSS variable so only ONE arrow renders */
.admin-layout .form-select {
    --bs-form-select-bg-img: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%235D5D5D' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m2 5 6 6 6-6'/%3e%3c/svg%3e");
    background-size: 12px 9px !important;
    padding-right: 28px !important;
    background-position: right 10px center !important;
}

/* ══════════════════════════════════════════════════════════════════
   CHECKBOXES, RADIO & SWITCH
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .form-check-input {
    border: 1.5px solid rgba(0,0,0,0.32) !important;
    border-radius: var(--fl-r-xs) !important;
    width: 16px !important;
    height: 16px !important;
    background-color: rgba(255,255,255,0.85) !important;
    /* do NOT set background shorthand — it would erase Bootstrap's background-image (checkmark/dot SVG) */
    transition: border-color 0.1s, background-color 0.1s !important;
    cursor: pointer;
    box-shadow: none !important;
    flex-shrink: 0;
}

.admin-layout .form-check-input:hover {
    border-color: rgba(0,0,0,0.55) !important;
}

.admin-layout .form-check-input:checked {
    background-color: var(--fl-accent) !important;
    border-color: var(--fl-accent) !important;
    /* Bootstrap sets the checkmark/radio-dot via --bs-form-check-bg-image; keep it */
}

.admin-layout .form-check-input:focus {
    box-shadow: 0 0 0 2px rgba(0,103,192,0.22) !important;
    outline: none !important;
}

.admin-layout .form-check-input[type="radio"] {
    border-radius: 50% !important;
}

.admin-layout .form-switch .form-check-input {
    width: 38px !important;
    height: 20px !important;
    border-radius: 10px !important;
    border-color: rgba(0,0,0,0.25) !important;
    background-color: rgba(0,0,0,0.10) !important;
    /* Bootstrap's --bs-form-switch-bg (thumb circle) must remain — don't override background shorthand */
    background-image: var(--bs-form-switch-bg) !important;
    background-position: left center !important;
    background-repeat: no-repeat !important;
    background-size: 1.125em !important;
    transition: background-color 0.2s ease, background-position 0.15s ease-in-out, border-color 0.15s ease-in-out !important;
}

.admin-layout .form-switch .form-check-input:checked {
    background-color: var(--fl-accent) !important;
    border-color: var(--fl-accent) !important;
    background-position: right center !important;
}

.admin-layout .form-check-label {
    font-size: 0.8125rem !important;
    color: var(--fl-text-primary) !important;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════
   TABLES
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .table {
    font-size: 0.8125rem !important;
    color: var(--fl-text-primary) !important;
    border-color: var(--fl-divider);
    margin: 0;
}

.admin-layout .table thead th,
.admin-layout .table-light th {
    background: #F5F5F5 !important;
    color: var(--fl-text-secondary) !important;
    font-size: 0.73rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.055em !important;
    border-bottom: 1px solid var(--fl-border) !important;
    border-top: none !important;
    padding: 0.55rem 1rem !important;
}

.admin-layout .table tbody td {
    padding: 0.55rem 1rem !important;
    border-bottom: 1px solid var(--fl-divider) !important;
    vertical-align: middle !important;
    color: var(--fl-text-primary) !important;
}

.admin-layout .table-hover tbody tr:hover td {
    background: var(--fl-hover) !important;
}

.admin-layout .table tbody tr:last-child td {
    border-bottom: none !important;
}

.admin-layout .table-responsive {
    border-radius: 0 0 var(--fl-r-lg) var(--fl-r-lg);
}

/* ══════════════════════════════════════════════════════════════════
   BADGES
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .badge {
    font-family: "Segoe UI Variable", "Segoe UI", "Microsoft Sans Serif", sans-serif !important;
    font-size: 0.69rem !important;
    font-weight: 600 !important;
    border-radius: var(--fl-r-xs) !important;
    padding: 2px 7px !important;
    letter-spacing: 0.02em !important;
}

.admin-layout .badge.bg-primary   { background: var(--fl-accent)  !important; }
.admin-layout .badge.bg-success   { background: #107C10 !important; }
.admin-layout .badge.bg-danger    { background: #C42B1C !important; }
.admin-layout .badge.bg-warning   { background: #F7630C !important; color: #fff !important; }
.admin-layout .badge.bg-info      { background: #0078D4 !important; }
.admin-layout .badge.bg-secondary { background: #767676 !important; }
.admin-layout .badge.bg-light     { background: #EBEBEB !important; color: var(--fl-text-secondary) !important; border: 1px solid var(--fl-border); }
.admin-layout .badge.bg-dark      { background: #2C2C2C !important; }

/* ══════════════════════════════════════════════════════════════════
   ALERTS
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .alert {
    border-radius: var(--fl-r-md) !important;
    font-size: 0.8125rem !important;
    padding: 0.65rem 1rem !important;
    border-width: 1px !important;
    border-left-width: 3px !important;
}

.admin-layout .alert-success {
    background: #EFF9EF !important;
    border-color: #A8D5A8 !important;
    border-left-color: #107C10 !important;
    color: #1A5C1A !important;
}
.admin-layout .alert-danger {
    background: #FEF0EE !important;
    border-color: #F4AFAA !important;
    border-left-color: #C42B1C !important;
    color: #8E1F14 !important;
}
.admin-layout .alert-warning {
    background: #FFF4E6 !important;
    border-color: #FACB8A !important;
    border-left-color: #F7630C !important;
    color: #7A4100 !important;
}
.admin-layout .alert-info {
    background: #EFF6FD !important;
    border-color: #9EC8EE !important;
    border-left-color: #0078D4 !important;
    color: #0B3D6E !important;
}

/* ══════════════════════════════════════════════════════════════════
   MODALS
   ══════════════════════════════════════════════════════════════════ */
.modal .modal-content {
    border: 1px solid var(--fl-border) !important;
    border-radius: var(--fl-r-xl) !important;
    box-shadow: var(--fl-shadow-8) !important;
    overflow: hidden;
}

.modal .modal-header {
    background: var(--fl-surface-alt) !important;
    border-bottom: 1px solid var(--fl-border) !important;
    padding: 0.875rem 1.25rem !important;
    border-radius: 0 !important;
}

.modal .modal-title {
    font-family: "Segoe UI Variable", "Segoe UI", "Microsoft Sans Serif", sans-serif !important;
    font-size: 0.9375rem !important;
    font-weight: 600 !important;
    color: var(--fl-text-primary) !important;
}

.modal .modal-body {
    background: var(--fl-surface) !important;
    padding: 1.25rem !important;
}

.modal .modal-footer {
    background: var(--fl-surface-alt) !important;
    border-top: 1px solid var(--fl-border) !important;
    padding: 0.7rem 1.25rem !important;
    gap: 0.5rem !important;
    border-radius: 0 !important;
}

/* ══════════════════════════════════════════════════════════════════
   DROPDOWNS
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .dropdown-menu {
    border: 1px solid var(--fl-border) !important;
    border-radius: var(--fl-r-lg) !important;
    box-shadow: var(--fl-shadow-4) !important;
    padding: 4px !important;
    font-size: 0.8125rem !important;
}

.admin-layout .dropdown-item {
    border-radius: var(--fl-r-sm) !important;
    padding: 5px 10px !important;
    font-size: 0.8125rem !important;
    color: var(--fl-text-primary) !important;
    transition: background 0.1s !important;
}

.admin-layout .dropdown-item:hover,
.admin-layout .dropdown-item:focus {
    background: var(--fl-hover) !important;
    color: var(--fl-text-primary) !important;
}

.admin-layout .dropdown-divider {
    border-color: var(--fl-divider) !important;
    margin: 3px 0 !important;
}

/* ══════════════════════════════════════════════════════════════════
   TABS
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .nav-tabs {
    border-bottom: 1px solid var(--fl-border) !important;
    gap: 0 !important;
}

.admin-layout .nav-tabs .nav-link {
    border: none !important;
    border-bottom: 2px solid transparent !important;
    border-radius: 0 !important;
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--fl-text-secondary) !important;
    padding: 8px 14px !important;
    transition: color 0.12s !important;
    background: none !important;
}

.admin-layout .nav-tabs .nav-link:hover {
    color: var(--fl-text-primary) !important;
    border-bottom-color: var(--fl-border-strong) !important;
    background: none !important;
}

.admin-layout .nav-tabs .nav-link.active {
    color: var(--fl-accent) !important;
    border-bottom-color: var(--fl-accent) !important;
    background: none !important;
    font-weight: 600 !important;
}

/* Settings page tabs */
.admin-layout .settings-tab {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    height: 38px;
    padding: 0 14px !important;
    border-bottom: 2px solid transparent !important;
}

.admin-layout .settings-tab:hover {
    background: none !important;
    color: var(--fl-text-primary) !important;
}

.admin-layout .settings-tab.active {
    color: var(--fl-accent) !important;
    border-bottom-color: var(--fl-accent) !important;
    background: none !important;
}

/* ══════════════════════════════════════════════════════════════════
   STAT CARDS & DASHBOARD
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .stat-card {
    border-radius: var(--fl-r-lg) !important;
    border: 1px solid var(--fl-border) !important;
    box-shadow: var(--fl-shadow-1) !important;
}

.admin-layout .stat-card:hover {
    box-shadow: var(--fl-shadow-2) !important;
    transform: translateY(-1px);
}

.admin-layout .stat-icon { border-radius: var(--fl-r-md) !important; }

.admin-layout .stat-value {
    font-size: 1.625rem !important;
    font-weight: 600 !important;
    letter-spacing: -0.02em !important;
}

.admin-layout .stat-label {
    font-size: 0.79rem !important;
    color: var(--fl-text-secondary) !important;
}

.admin-layout .dashboard-section {
    border-radius: var(--fl-r-lg) !important;
    border: 1px solid var(--fl-border) !important;
    box-shadow: var(--fl-shadow-1) !important;
}

.admin-layout .section-header {
    background: var(--fl-surface-alt) !important;
    border-bottom: 1px solid var(--fl-divider) !important;
    padding: 0.75rem 1.25rem !important;
}

.admin-layout .section-header h3 {
    font-size: 0.875rem !important;
}

.admin-layout .quick-action-card {
    border-radius: var(--fl-r-lg) !important;
    border: 1px solid var(--fl-border) !important;
    box-shadow: var(--fl-shadow-1) !important;
    transition: var(--fl-ease) !important;
}

.admin-layout .quick-action-card:hover {
    border-color: var(--fl-accent) !important;
    box-shadow: var(--fl-shadow-2) !important;
    transform: translateY(-1px);
}

.admin-layout .quick-action-card svg { color: var(--fl-accent) !important; }

/* ══════════════════════════════════════════════════════════════════
   TOOLBAR (search & filter)
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .crud-search .form-control {
    height: 32px !important;
    border-radius: var(--fl-r-sm) !important;
}

.admin-layout .crud-filter {
    height: 32px !important;
    border-radius: var(--fl-r-sm) !important;
}

/* ══════════════════════════════════════════════════════════════════
   CODE TAGS
   ══════════════════════════════════════════════════════════════════ */
.admin-layout code {
    font-family: "Cascadia Code", "Fira Code", "Consolas", monospace !important;
    background: #F0F0F0 !important;
    color: var(--fl-accent) !important;
    border-radius: 3px !important;
    padding: 1px 6px !important;
    font-size: 0.78rem !important;
}

/* ══════════════════════════════════════════════════════════════════
   COLOR INPUT
   ══════════════════════════════════════════════════════════════════ */
.admin-layout input[type="color"] {
    height: 32px !important;
    border-radius: var(--fl-r-sm) !important;
    border: 1px solid var(--fl-border) !important;
    padding: 2px 3px !important;
    cursor: pointer;
}

/* ══════════════════════════════════════════════════════════════════
   RANGE SLIDER
   ══════════════════════════════════════════════════════════════════ */
.admin-layout input[type="range"] {
    accent-color: var(--fl-accent) !important;
    height: 4px;
}

/* ══════════════════════════════════════════════════════════════════
   SCROLLBARS (Fluent thin style)
   ══════════════════════════════════════════════════════════════════ */
.admin-layout ::-webkit-scrollbar { width: 5px; height: 5px; }
.admin-layout ::-webkit-scrollbar-track { background: transparent; }
.admin-layout ::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.16);
    border-radius: 3px;
}
.admin-layout ::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.28);
}

/* ══════════════════════════════════════════════════════════════════
   FOCUS RING (global override inside admin)
   ══════════════════════════════════════════════════════════════════ */
.admin-layout *:focus-visible {
    outline: 2px solid var(--fl-accent) !important;
    outline-offset: 2px !important;
    box-shadow: none !important;
}

.admin-layout .form-control:focus,
.admin-layout .form-select:focus,
.admin-layout .form-check-input:focus {
    outline: none !important;
}

/* ══════════════════════════════════════════════════════════════════
   BUTTON GROUPS
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .btn-group .btn { border-radius: 0 !important; }
.admin-layout .btn-group .btn:first-child {
    border-radius: var(--fl-r-sm) 0 0 var(--fl-r-sm) !important;
}
.admin-layout .btn-group .btn:last-child {
    border-radius: 0 var(--fl-r-sm) var(--fl-r-sm) 0 !important;
}

/* ══════════════════════════════════════════════════════════════════
   SPINNER
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .spinner-border {
    width: 1.125rem !important;
    height: 1.125rem !important;
    border-width: 2px !important;
}

.admin-layout .spinner-border.text-primary { color: var(--fl-accent) !important; }

/* ══════════════════════════════════════════════════════════════════
   PAGE HEADER (cms-page-header)
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .cms-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1rem;
    padding-bottom: 0.875rem;
    border-bottom: 1px solid var(--fl-divider);
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* ══════════════════════════════════════════════════════════════════
   MEDIA LIBRARY — skeleton loader + spacing
   ══════════════════════════════════════════════════════════════════ */

/* Skeleton shimmer animation */
@keyframes fl-shimmer {
    0%   { background-position: -600px 0; }
    100% { background-position:  600px 0; }
}

.media-skeleton-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
    padding-bottom: 2rem;
}

.media-skeleton-card {
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    border: 1px solid var(--fl-border);
}

.media-skeleton-thumb {
    width: 100%;
    aspect-ratio: 1;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 37%, #f0f0f0 63%);
    background-size: 600px 100%;
    animation: fl-shimmer 1.4s infinite;
}

.media-skeleton-name {
    height: 14px;
    margin: 8px 10px;
    border-radius: 3px;
    background: linear-gradient(90deg, #f0f0f0 25%, #e8e8e8 37%, #f0f0f0 63%);
    background-size: 600px 100%;
    animation: fl-shimmer 1.4s infinite;
    animation-delay: 0.1s;
}

.media-loading-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6rem 1rem;
    background: var(--fl-accent-light);
    border: 1px solid rgba(0,103,192,0.18);
    border-radius: var(--fl-r-md);
    font-size: 0.8125rem;
    color: var(--fl-accent-text);
    margin-bottom: 1rem;
    border-left: 3px solid var(--fl-accent);
}

.media-loading-bar .spinner-border {
    color: var(--fl-accent) !important;
    width: 1rem !important;
    height: 1rem !important;
    border-width: 2px !important;
}

/* ══════════════════════════════════════════════════════════════════
   MENU LIST & DRAG-DROP REORDER
   ══════════════════════════════════════════════════════════════════ */

/* Tree depth row tinting */
.admin-layout .menu-row-depth-1 td { background: rgba(99,102,241,.025); }
.admin-layout .menu-row-depth-2 td { background: rgba(99,102,241,.05); }

/* Status dot */
.menu-item-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}
.menu-dot--active  { background: #22c55e; }
.menu-dot--hidden  { background: #94a3b8; }

/* opacity helper */
.opacity-60 { opacity: 0.6; }

/* Reorder group heading */
.reorder-group { border-bottom: 1px solid var(--fl-border); }
.reorder-group:last-child { border-bottom: none; }

.reorder-group-header {
    display: flex;
    align-items: center;
    gap: .4rem;
    padding: .55rem 1.25rem;
    background: var(--fl-bg);
    font-size: .8rem;
    font-weight: 600;
    color: var(--fl-text-secondary);
    border-bottom: 1px solid var(--fl-border);
    text-transform: uppercase;
    letter-spacing: .04em;
}

/* Drag & drop reorder list */
.menu-reorder-list {
    max-height: 260px;
    overflow-y: auto;
}

.menu-reorder-item {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem 1.25rem;
    border-bottom: 1px solid var(--fl-border);
    background: #fff;
    cursor: grab;
    transition: background .1s, box-shadow .1s;
    user-select: none;
}
.menu-reorder-item:last-child { border-bottom: none; }
.menu-reorder-item:hover { background: var(--fl-hover); }
.menu-reorder-item.dragging { opacity: .45; cursor: grabbing; }
.menu-reorder-item.drag-over {
    background: var(--fl-accent-light);
    border-top: 2px solid var(--fl-accent);
}

.reorder-handle {
    color: #94a3b8;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    cursor: grab;
}
.reorder-pos { min-width: 20px; flex-shrink: 0; text-align: right; }
.reorder-info { min-width: 0; }

/* ══════════════════════════════════════════════════════════════════
   VERSION HISTORY SIDE PANEL
   ══════════════════════════════════════════════════════════════════ */

.history-panel {
    position: fixed;
    top: 0;
    right: 0;
    width: 440px;
    max-width: 96vw;
    height: 100vh;
    background: #fff;
    border-left: 1px solid var(--fl-border);
    box-shadow: -4px 0 24px rgba(0,0,0,0.12);
    z-index: 1060;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideInRight 0.22s ease;
}

@keyframes slideInRight {
    from { transform: translateX(100%); opacity: 0; }
    to   { transform: translateX(0);    opacity: 1; }
}

.history-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--fl-border);
    background: var(--fl-bg);
    flex-shrink: 0;
}

.history-live-banner {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.6rem 1.25rem;
    background: #f0fdf4;
    border-bottom: 1px solid #bbf7d0;
    font-size: 0.8125rem;
    flex-shrink: 0;
    flex-wrap: wrap;
}

.history-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.history-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
    text-align: center;
}

.history-item {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 0.75rem 1.25rem;
    border-bottom: 1px solid var(--fl-border);
    gap: 0.75rem;
    transition: background 0.1s;
}

.history-item:hover { background: var(--fl-hover); }
.history-item--previewing { background: #eff6ff; }

.history-item-meta {
    display: flex;
    align-items: flex-start;
    gap: 0.6rem;
    flex: 1;
    min-width: 0;
}

.history-rev-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 32px;
    padding: 2px 6px;
    background: var(--fl-accent-light);
    color: var(--fl-accent);
    border: 1px solid rgba(0,103,192,0.2);
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    flex-shrink: 0;
    margin-top: 2px;
    letter-spacing: 0.02em;
}

.history-item-actions {
    display: flex;
    gap: 0.4rem;
    flex-shrink: 0;
}

.btn-xs {
    padding: 2px 8px !important;
    font-size: 0.75rem !important;
    border-radius: var(--fl-r-sm) !important;
    line-height: 1.4 !important;
}

.history-preview-wrap {
    padding: 0.75rem 1.25rem;
    background: #f8fafc;
    border-bottom: 1px solid var(--fl-border);
}

.history-preview-iframe {
    width: 100%;
    height: 260px;
    border: 1px solid var(--fl-border);
    border-radius: var(--fl-r-md);
    background: #fff;
}

/* ══════════════════════════════════════════════════════════════════
   DASHBOARD TABLE (cms-table)
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .cms-table thead th {
    background: #F5F5F5 !important;
    font-size: 0.72rem !important;
    letter-spacing: 0.055em !important;
}

.admin-layout .cms-table tbody td {
    font-size: 0.8125rem !important;
    padding: 0.6rem 1.5rem !important;
}

/* ══════════════════════════════════════════════════════════════════
   ACCORDION (SEO, etc.)
   ══════════════════════════════════════════════════════════════════ */
.admin-layout .accordion-button {
    font-size: 0.8125rem !important;
    font-weight: 500 !important;
    color: var(--fl-text-primary) !important;
    background: var(--fl-surface-alt) !important;
    border-radius: var(--fl-r-sm) !important;
}

.admin-layout .accordion-button:not(.collapsed) {
    background: var(--fl-accent-light) !important;
    color: var(--fl-accent-text) !important;
    box-shadow: none !important;
}

.admin-layout .accordion-button::after {
    filter: none !important;
}

.admin-layout .accordion-item {
    border: 1px solid var(--fl-border) !important;
    border-radius: var(--fl-r-sm) !important;
}

/* ══════════════════════════════════════════════════════════════════
   MISC UTILITY
   ══════════════════════════════════════════════════════════════════ */

/* Make fw-bold headings use Segoe weight 600 */
.admin-layout .fw-bold   { font-weight: 600 !important; }
.admin-layout .fw-semibold { font-weight: 500 !important; }

/* Text muted colour */
.admin-layout .text-muted { color: var(--fl-text-secondary) !important; }

/* Small text */
.admin-layout small,
.admin-layout .small {
    font-size: 0.75rem !important;
}

/* Link colour */
.admin-layout a:not(.btn):not(.nav-link):not(.sidebar-link):not(.navbar-brand) {
    color: var(--fl-accent);
    text-decoration: none;
}

.admin-layout a:not(.btn):not(.nav-link):not(.sidebar-link):not(.navbar-brand):hover {
    color: var(--fl-accent-hover);
    text-decoration: underline;
}

/* Border radius on shadow-sm cards */
.admin-layout .shadow-sm {
    box-shadow: var(--fl-shadow-1) !important;
    border-radius: var(--fl-r-lg) !important;
}

/* Rounded-pill stays as-is */
.admin-layout .rounded-pill {
    border-radius: 999px !important;
}
