/* ITSWEBER CMS – Admin Styles */
/* Token system loaded via tokens.css (must be included before this file) */

:root {
    /* ── Legacy aliases → Token references ──
       These map existing variable names to the new token system.
       All existing CSS that uses these variables continues to work unchanged. */
    --admin-primary: var(--interactive-primary);
    --admin-primary-dark: var(--interactive-primary-hover);
    --admin-primary-light: var(--interactive-primary-light);
    --admin-accent: var(--interactive-accent);
    --admin-accent-light: var(--interactive-accent-light);
    --admin-accent-bg: var(--interactive-accent-bg);
    --admin-success: var(--feedback-success);
    --admin-danger: var(--feedback-danger);
    --admin-warning: var(--feedback-warning);
    --admin-sidebar-bg: var(--sidebar-bg);
    --admin-sidebar-bg-gradient: var(--sidebar-bg-gradient);
    --admin-sidebar-hover: var(--sidebar-hover-bg);
    --admin-sidebar-active-bg: var(--sidebar-active-bg);
    --admin-sidebar-active-text: var(--sidebar-accent);
    --admin-sidebar-text: var(--sidebar-text);
    --admin-sidebar-text-hover: var(--sidebar-text-hover);
    --admin-sidebar-active: var(--sidebar-text-active);
    --admin-sidebar-width: var(--sidebar-width);
    --admin-sidebar-border: var(--sidebar-border);
    --admin-topbar-height: var(--topbar-height);
    --gray-50: var(--p-gray-50);
    --gray-100: var(--p-gray-100);
    --gray-200: var(--p-gray-200);
    --gray-300: var(--p-gray-300);
    --gray-400: var(--p-gray-400);
    --gray-500: var(--p-gray-500);
    --gray-600: var(--p-gray-600);
    --gray-700: var(--p-gray-700);
    --gray-800: var(--p-gray-800);
    --gray-900: var(--p-gray-900);
    --font-sans: var(--font-family);
    --font-mono: var(--font-family-mono);
    --radius: var(--radius-md);
    --radius-sm: var(--p-radius-sm);
    --radius-lg: var(--p-radius-lg);
    --shadow-xs: var(--p-shadow-xs);
    --shadow: var(--p-shadow-sm);
    --shadow-md: var(--p-shadow-md);
    --shadow-lg: var(--p-shadow-lg);
    --transition: var(--transition-normal);
}

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

body { font-family: var(--font-sans); background: var(--gray-50); color: var(--gray-900); line-height: 1.5; }

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

.admin-sidebar {
    width: var(--admin-sidebar-width);
    background: var(--admin-sidebar-bg);
    background-image: var(--admin-sidebar-bg-gradient);
    color: var(--admin-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.25s ease;
    border-right: 1px solid var(--admin-sidebar-border);
    box-shadow: 4px 0 24px rgba(0,0,0,0.25), 1px 0 0 rgba(13,148,136,0.06);
}

.sidebar-header {
    padding: 1.5rem 1.25rem 1.25rem;
    border-bottom: 1px solid var(--admin-sidebar-border);
    background: rgba(13,148,136,0.04);
}

.sidebar-logo {
    display: flex;
    justify-content: center;
    font-size: 1.125rem;
    font-weight: 700;
    color: #fff;
    text-decoration: none;
    letter-spacing: -0.025em;
}

.sidebar-logo span { color: var(--admin-accent-light); }

.sidebar-brand-logo {
    max-height: 48px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 0.92;
    transition: opacity 0.2s;
}
.sidebar-logo:hover .sidebar-brand-logo { opacity: 1; }

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(255,255,255,0.08) transparent;
}
.sidebar-nav::-webkit-scrollbar { width: 4px; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 2px; }

/* Section label for system group */
.nav-section-label {
    padding: 1rem 1.25rem 0.375rem;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(94,234,212,0.3);
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5625rem 1rem;
    margin: 2px 0.625rem;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    font-size: 0.8375rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    border-left: 3px solid transparent;
}

.nav-item:hover {
    background: var(--admin-sidebar-hover);
    color: var(--admin-sidebar-text-hover);
    border-left-color: rgba(13,148,136,0.3);
}
.nav-item.active {
    background: var(--admin-sidebar-active-bg);
    color: var(--admin-sidebar-active-text);
    font-weight: 600;
    border-left-color: var(--admin-accent-light);
    box-shadow: 0 0 20px rgba(13,148,136,0.12), inset 0 0 0 1px rgba(13,148,136,0.08);
}

.nav-icon {
    font-size: 1rem;
    width: 1.375rem;
    text-align: center;
    opacity: 0.6;
    transition: opacity 0.2s, transform 0.2s;
}
.nav-item:hover .nav-icon { opacity: 0.9; }
.nav-item.active .nav-icon { opacity: 1; filter: drop-shadow(0 0 4px rgba(45,212,191,0.4)); }

.nav-divider { height: 1px; background: var(--admin-sidebar-border); margin: 0.5rem 1rem; }

/* Sub-navigation items (e.g. Blog → Categories / Tags) */
.nav-sub-item { padding-left: 2.5rem; font-size: 0.8rem; opacity: 0.8; }
.nav-sub-item:hover { opacity: 1; }
.nav-sub-item.active { opacity: 1; font-weight: 500; }

/* Nav group concept: parent item with collapsible children */
.nav-group { display: flex; flex-direction: column; }
.nav-group-toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5625rem 1rem;
    margin: 2px 0.625rem;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    font-size: 0.8375rem;
    border-radius: var(--radius-sm);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    width: calc(100% - 1.25rem);
    text-align: left;
    font-family: inherit;
}
.nav-group-toggle:hover {
    background: var(--admin-sidebar-hover);
    color: var(--admin-sidebar-text-hover);
    border-left-color: rgba(13,148,136,0.3);
}
.nav-group-toggle.active {
    background: var(--admin-sidebar-active-bg);
    color: var(--admin-sidebar-active-text);
    font-weight: 600;
    border-left-color: var(--admin-accent-light);
    box-shadow: 0 0 20px rgba(13,148,136,0.12);
}
.nav-group-chevron {
    margin-left: auto; flex-shrink: 0; transition: transform 0.25s ease;
    font-size: 0.625rem; opacity: 0.4; display: inline-block;
}
.nav-group-chevron::after { content: '▾'; }
.nav-group.open .nav-group-chevron { transform: rotate(180deg); opacity: 0.6; }

.nav-group-children {
    display: none;
    flex-direction: column;
    padding: 2px 0;
}
.nav-group.open .nav-group-children { display: flex; }
.nav-group-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.375rem 1rem 0.375rem 2.5rem;
    margin: 0 0.5rem;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    font-size: 0.8rem;
    border-radius: var(--radius-sm);
    transition: background 0.18s ease, color 0.18s ease;
    opacity: 0.85;
}
.nav-group-item:hover {
    background: var(--admin-sidebar-hover);
    color: var(--admin-sidebar-text-hover);
    opacity: 1;
}
.nav-group-item.active { opacity: 1; font-weight: 500; }

/* Warning badge for maintenance mode */
.nav-item--warn { color: var(--admin-warning); }
.nav-badge { font-size: 0.625rem; padding: 0.125rem 0.375rem; border-radius: 9999px; font-weight: 600; }
.nav-badge--warn { background: rgba(217,119,6,0.15); color: var(--admin-warning); }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--admin-sidebar-border);
    font-size: 0.6875rem;
    color: rgba(94,234,212,0.35);
    background: rgba(0,0,0,0.15);
}
.sidebar-version { letter-spacing: 0.04em; font-weight: 500; }

/* Main Area */
.admin-main {
    flex: 1;
    margin-left: var(--admin-sidebar-width);
    min-width: 0;
}

.admin-topbar {
    height: var(--admin-topbar-height);
    background: rgba(255,255,255,0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid var(--gray-200);
    box-shadow: 0 1px 4px rgba(0,0,0,0.04);
    display: flex;
    align-items: center;
    padding: 0 1.5rem;
    gap: 1rem;
    position: sticky;
    top: 0;
    z-index: 50;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0.375rem;
    border-radius: var(--radius-sm);
    color: var(--gray-600);
    transition: background 0.15s, color 0.15s;
}
.sidebar-toggle:hover { background: var(--gray-100); color: var(--gray-800); }

.topbar-title {
    font-weight: 600;
    font-size: 1rem;
    color: var(--gray-800);
    letter-spacing: -0.01em;
}
.topbar-actions {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.8125rem;
}
.topbar-link {
    color: var(--admin-accent);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--transition);
    padding: 0.25rem 0.5rem;
    border-radius: var(--radius-sm);
}
.topbar-link:hover { color: var(--admin-accent-light); background: var(--admin-accent-bg); }
.topbar-user {
    color: var(--gray-600);
    font-weight: 500;
    padding: 0.25rem 0.5rem;
    background: var(--gray-100);
    border-radius: var(--radius-sm);
}
.topbar-lang-select {
    font-size: 0.8125rem;
    padding: 0.25rem 0.5rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: #fff;
    color: var(--gray-600);
    cursor: pointer;
    transition: border-color 0.15s;
}
.topbar-lang-select:hover { border-color: var(--gray-300); }

.admin-content { padding: 1.5rem; }
.admin-content:has(.dash-welcome) { padding: 0; }
.admin-content:has(.dash-welcome) > .alert { margin: 1rem 2.5rem 0; }

/* Alerts */
.alert {
    padding: 0.875rem 1.125rem;
    border-radius: var(--radius);
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    border-left: 4px solid;
    border-right: none;
    border-top: none;
    border-bottom: none;
    box-shadow: var(--shadow-xs);
}
.alert-success { background: #f0fdf4; color: var(--admin-success); border-left-color: var(--admin-success); }
.alert-warning { background: #fffbeb; color: var(--admin-warning); border-left-color: var(--admin-warning); }
.alert-error { background: #fef2f2; color: var(--admin-danger); border-left-color: var(--admin-danger); }

/* Content Header */
.content-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
    padding-bottom: 1rem;
}
.content-header h2 {
    font-size: 1.375rem;
    font-weight: 800;
    color: var(--gray-900);
    letter-spacing: -0.02em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5625rem 1.25rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-sans);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    gap: 0.5rem;
    letter-spacing: 0.01em;
    position: relative;
    overflow: hidden;
}
.btn:active { transform: translateY(1px) scale(0.98); }
.btn-primary {
    background: linear-gradient(135deg, var(--admin-primary) 0%, #0a7c8f 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(14,116,144,0.3), 0 1px 2px rgba(14,116,144,0.15);
}
.btn-primary:hover {
    background: linear-gradient(135deg, var(--admin-primary-dark) 0%, var(--admin-primary) 100%);
    box-shadow: 0 6px 20px rgba(14,116,144,0.4), 0 2px 6px rgba(14,116,144,0.2);
    transform: translateY(-2px);
}
.btn-secondary {
    background: #fff;
    color: var(--gray-700);
    border: 1px solid var(--gray-300);
    box-shadow: 0 1px 3px rgba(0,0,0,0.04);
}
.btn-secondary:hover {
    background: var(--gray-50);
    border-color: var(--admin-primary-light);
    color: var(--admin-primary);
    box-shadow: 0 3px 10px rgba(14,116,144,0.1);
    transform: translateY(-1px);
}
.btn-danger {
    background: linear-gradient(135deg, var(--admin-danger) 0%, #b91c1c 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(220,38,38,0.3);
}
.btn-danger:hover {
    background: linear-gradient(135deg, #b91c1c 0%, #991b1b 100%);
    box-shadow: 0 6px 20px rgba(220,38,38,0.4);
    transform: translateY(-2px);
}
.btn-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(245,158,11,0.3);
}
.btn-warning:hover {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
    box-shadow: 0 6px 20px rgba(245,158,11,0.4);
    transform: translateY(-2px);
}
.btn-success {
    background: linear-gradient(135deg, var(--admin-success) 0%, #047857 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(5,150,105,0.3);
}
.btn-success:hover {
    background: linear-gradient(135deg, #047857 0%, #065f46 100%);
    box-shadow: 0 6px 20px rgba(5,150,105,0.4);
    transform: translateY(-2px);
}
.btn-sm { padding: 0.3125rem 0.75rem; font-size: 0.8125rem; }
.btn-xs { padding: 0.25rem 0.625rem; font-size: 0.775rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-ghost { background: none; border: none; color: var(--admin-accent); padding: 0.25rem 0.5rem; border-radius: var(--radius-sm); }
.btn-ghost:hover { background: var(--admin-accent-bg); color: var(--admin-primary); text-decoration: none; }

/* Data Table */
.data-table-wrap {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.data-table th, .data-table td { padding: 0.8125rem 1rem; text-align: left; font-size: 0.875rem; }
.data-table th {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    font-weight: 700;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.6875rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    padding: 0.75rem 1rem;
}
.data-table td { border-bottom: 1px solid var(--gray-100); }
.data-table tbody tr { transition: all 0.15s ease; }
.data-table tbody tr:hover td { background: var(--admin-accent-bg); }
.data-table tbody tr:hover { box-shadow: inset 3px 0 0 var(--admin-accent); }
.data-table tr:last-child td { border-bottom: none; }
.data-table code { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--admin-primary); background: var(--admin-accent-bg); padding: 0.15rem 0.5rem; border-radius: var(--radius-sm); }
.actions { display: flex; gap: 0.375rem; }
.actions .btn { padding: 0.3125rem 0.625rem; font-size: 0.775rem; }
.inline-form { display: inline; }

/* Badges */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 700;
    border-radius: 20px;
    letter-spacing: 0.02em;
    line-height: 1.3;
    text-transform: uppercase;
    gap: 0.25rem;
}
.badge-primary { background: var(--admin-accent-bg); color: var(--admin-accent); border: 1px solid rgba(13,148,136,0.15); }
.badge-success { background: #ecfdf5; color: var(--admin-success); border: 1px solid rgba(5,150,105,0.15); }
.badge-draft { background: var(--gray-100); color: var(--gray-500); border: 1px solid var(--gray-200); }
.badge-danger { background: #fef2f2; color: var(--admin-danger); border: 1px solid rgba(220,38,38,0.15); }
.badge-warning { background: #fffbeb; color: var(--admin-warning); border: 1px solid rgba(217,119,6,0.15); }
.badge-secondary { background: var(--gray-100); color: var(--gray-600); border: 1px solid var(--gray-200); }
.badge-info { background: #eff6ff; color: #2563eb; border: 1px solid rgba(37,99,235,0.15); }
.badge-format { background: #ecfdf5; color: #059669; border: 1px solid rgba(5,150,105,0.15); font-size: 0.6rem; padding: 0.1rem 0.3rem; }

/* Forms */
.admin-form .form-group { margin-bottom: 1.125rem; }
.admin-form label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: var(--gray-700);
    letter-spacing: 0.01em;
}
.admin-form input[type="text"],
.admin-form input[type="email"],
.admin-form input[type="password"],
.admin-form input[type="number"],
.admin-form input[type="url"],
.admin-form input[type="date"],
.admin-form input[type="time"],
.admin-form input[type="datetime-local"],
.admin-form textarea,
.admin-form select {
    width: 100%;
    padding: 0.625rem 0.875rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    background: #fff;
    color: var(--gray-800);
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
.admin-form input[type="text"]:hover,
.admin-form input[type="email"]:hover,
.admin-form input[type="password"]:hover,
.admin-form input[type="number"]:hover,
.admin-form input[type="url"]:hover,
.admin-form input[type="date"]:hover,
.admin-form input[type="time"]:hover,
.admin-form input[type="datetime-local"]:hover,
.admin-form textarea:hover,
.admin-form select:hover {
    border-color: var(--admin-primary-light);
    box-shadow: 0 2px 6px rgba(14,116,144,0.08);
}
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12), 0 2px 8px rgba(13,148,136,0.08);
}
.admin-form input::placeholder, .admin-form textarea::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}
.admin-form textarea { resize: vertical; min-height: 100px; }
/* Datetime inputs – consistent with the design system */
.admin-form input[type="datetime-local"],
.admin-form input[type="date"],
.admin-form input[type="time"] {
    color-scheme: light;
    cursor: pointer;
}
.admin-form input[type="datetime-local"]::-webkit-calendar-picker-indicator,
.admin-form input[type="date"]::-webkit-calendar-picker-indicator,
.admin-form input[type="time"]::-webkit-calendar-picker-indicator {
    cursor: pointer;
    opacity: 0.5;
    transition: opacity 0.2s;
    filter: none;
}
.admin-form input[type="datetime-local"]:hover::-webkit-calendar-picker-indicator,
.admin-form input[type="date"]:hover::-webkit-calendar-picker-indicator,
.admin-form input[type="time"]:hover::-webkit-calendar-picker-indicator {
    opacity: 0.8;
}
.admin-form select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
}
/* Checkbox and radio modernization */
.admin-form input[type="checkbox"],
.admin-form input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--admin-primary);
    cursor: pointer;
    margin: 0;
}
.admin-form fieldset {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.admin-form fieldset:hover {
    border-color: var(--gray-300);
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.admin-form legend {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gray-800);
    padding: 0 0.625rem;
    letter-spacing: -0.01em;
}

.form-grid { display: grid; grid-template-columns: 1fr 300px; gap: 1.5rem; }
.form-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    box-shadow: var(--shadow);
    transition: box-shadow var(--transition), border-color var(--transition);
}
.form-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--gray-300);
}
.form-card h4 {
    font-size: 0.9375rem;
    font-weight: 700;
    margin-bottom: 0.875rem;
    color: var(--gray-800);
    border-left: 3px solid var(--admin-accent);
    padding-left: 0.75rem;
}

.checkbox-label { display: flex; align-items: center; gap: 0.5rem; font-weight: 400; cursor: pointer; }
.checkbox-label input { width: auto; }

/* ── Dashboard ─────────────────────────────────────────────────────────── */

/* Welcome Banner */
.dash-welcome {
    background: linear-gradient(135deg, var(--sidebar-bg) 0%, var(--p-teal-700) 50%, var(--p-teal-600) 100%);
    color: #fff;
    padding: 2rem 2.5rem;
    position: relative;
    overflow: hidden;
    margin: calc(var(--topbar-height) * -1 + var(--topbar-height)) 0 0 0;
}
.dash-welcome::before {
    content: ''; position: absolute; top: -50%; right: -10%; width: 400px; height: 400px;
    background: radial-gradient(circle, rgba(45,212,191,0.12) 0%, transparent 70%);
    pointer-events: none;
}
.dash-welcome-inner {
    display: flex; align-items: flex-start; justify-content: space-between;
    flex-wrap: wrap; gap: 1rem; position: relative; z-index: 1;
}
.dash-welcome h2 { font-size: 1.5rem; font-weight: 700; margin: 0; line-height: 1.3; color: #fff; }
.dash-welcome-date { font-size: 0.875rem; opacity: 0.7; margin-top: 0.25rem; }
.dash-welcome-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.dash-welcome-btn {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.5rem 1rem; border-radius: var(--radius-sm);
    font-size: 0.8125rem; font-weight: 600; text-decoration: none; color: var(--p-teal-700);
    background: rgba(255,255,255,0.92); border: 1px solid rgba(255,255,255,0.5);
    transition: all var(--transition);
}
.dash-welcome-btn:hover { background: #fff; color: var(--p-teal-600); }

/* Content Area (below banner) */
.dash-content-area { padding: 1.5rem 2.5rem 2.5rem; }

/* Primary Stat Cards (overlapping banner) */
.dash-stats-primary {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem;
    margin-top: -2rem; margin-bottom: 1.5rem; position: relative; z-index: 2;
}
.dash-stat-card {
    display: block; background: #fff; border-radius: var(--radius-lg); padding: 1.25rem;
    box-shadow: var(--shadow-md); text-decoration: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1); border: 1px solid transparent;
}
.dash-stat-card:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,0.12); border-color: var(--gray-200); }
.dash-stat-top { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 0.75rem; }
.dash-stat-icon {
    width: 40px; height: 40px; border-radius: var(--radius);
    display: flex; align-items: center; justify-content: center;
}
.dash-stat-icon--pages  { background: #eef2ff; color: #4f46e5; }
.dash-stat-icon--blog   { background: #f0fdf4; color: var(--admin-success); }
.dash-stat-icon--gallery { background: #faf5ff; color: #8b5cf6; }
.dash-stat-icon--events  { background: #fff7ed; color: var(--admin-warning); }
.dash-stat-number { font-size: 1.75rem; font-weight: 800; color: var(--gray-900); line-height: 1; letter-spacing: -0.03em; }
.dash-stat-label { font-size: 0.8125rem; color: var(--gray-500); margin-top: 0.125rem; font-weight: 500; }
.dash-stat-sub { display: flex; gap: 0.375rem; margin-top: 0.5rem; flex-wrap: wrap; }

/* Secondary Stats */
.dash-stats-secondary {
    display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1.5rem;
}
.dash-stat-mini {
    display: flex; align-items: center; gap: 0.75rem;
    background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius);
    padding: 0.75rem 1rem; text-decoration: none;
    box-shadow: var(--shadow-xs); transition: all var(--transition);
}
.dash-stat-mini:hover { border-color: var(--gray-300); box-shadow: var(--shadow); }
.dash-stat-mini-icon {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
    background: var(--gray-50); color: var(--gray-500);
}
.dash-stat-mini-num { font-size: 1.125rem; font-weight: 800; color: var(--gray-900); line-height: 1; letter-spacing: -0.02em; }
.dash-stat-mini-label { font-size: 0.75rem; color: var(--gray-500); font-weight: 500; }

/* Content Grid */
.dash-content-grid { display: grid; grid-template-columns: 3fr 2fr; gap: 1.5rem; align-items: start; }
.dash-content-col { display: flex; flex-direction: column; gap: 1rem; }

/* Panels */
.dash-panel {
    background: #fff; border: 1px solid var(--gray-200); border-radius: var(--radius-lg);
    box-shadow: var(--shadow); overflow: hidden; transition: box-shadow var(--transition);
}
.dash-panel:hover { box-shadow: var(--shadow-md); }
.dash-panel-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-100);
}
.dash-panel-header-left { display: flex; align-items: center; gap: 0.5rem; }
.dash-panel-icon {
    width: 28px; height: 28px; border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center;
}
.dash-panel-icon--posts  { background: #f0fdf4; color: var(--admin-success); }
.dash-panel-icon--pages  { background: #eef2ff; color: #4f46e5; }
.dash-panel-icon--events { background: #fff7ed; color: var(--admin-warning); }
.dash-panel-icon--system { background: #f0fdfa; color: var(--admin-primary); }
.dash-panel-header h3 { font-size: 0.8125rem; font-weight: 600; margin: 0; color: var(--gray-700); }
.dash-panel-link { font-size: 0.75rem; color: var(--admin-accent); text-decoration: none; font-weight: 500; }
.dash-panel-link:hover { text-decoration: underline; }
.dash-panel-body { padding: 0; }
.dash-panel-empty { font-size: 0.875rem; color: var(--gray-400); padding: 1.25rem; margin: 0; }

/* List Items */
.dash-list-item {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
    padding: 0.625rem 1.25rem; border-bottom: 1px solid var(--gray-50); transition: background 0.15s;
}
.dash-list-item:last-child { border-bottom: none; }
.dash-list-item:hover { background: var(--gray-50); }
.dash-list-title {
    font-size: 0.8125rem; color: var(--gray-800); text-decoration: none; font-weight: 500;
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.dash-list-title:hover { color: var(--admin-accent); }
.dash-list-meta { display: flex; align-items: center; gap: 0.375rem; flex-shrink: 0; }
.dash-list-date { font-size: 0.6875rem; color: var(--gray-400); font-variant-numeric: tabular-nums; }

/* Event Items */
.dash-event-item {
    display: flex; gap: 0.75rem; align-items: flex-start;
    padding: 0.625rem 1.25rem; border-bottom: 1px solid var(--gray-50);
}
.dash-event-item:last-child { border-bottom: none; }
.dash-event-date-block {
    width: 44px; height: 44px; flex-shrink: 0; border-radius: var(--radius-sm);
    display: flex; flex-direction: column; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--sidebar-bg), var(--p-teal-700)); color: #fff; line-height: 1;
}
.dash-event-day { font-size: 1rem; font-weight: 700; }
.dash-event-month { font-size: 0.5625rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; opacity: 0.7; }
.dash-event-info { flex: 1; min-width: 0; }
.dash-event-title {
    display: block; font-size: 0.8125rem; color: var(--gray-800); text-decoration: none;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500;
}
.dash-event-title:hover { color: var(--admin-accent); }
.dash-event-time { font-size: 0.75rem; color: var(--gray-400); }

/* System Info */
.dash-system-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; margin: 0; }
.dash-system-item { padding: 0.75rem 1.25rem; border-bottom: 1px solid var(--gray-50); display: flex; flex-direction: column; gap: 0.125rem; }
.dash-system-item:nth-last-child(-n+2) { border-bottom: none; }
.dash-system-item dt { font-size: 0.6875rem; color: var(--gray-400); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.dash-system-item dd { font-size: 0.8125rem; color: var(--gray-800); margin: 0; font-weight: 500; }
.dash-system-link { color: var(--admin-accent); text-decoration: none; }
.dash-system-link:hover { text-decoration: underline; }

/* Settings Form */
.settings-section { margin-bottom: 2rem; }
.settings-section h3 { font-size: 1rem; font-weight: 800; margin-bottom: 1rem; padding-bottom: 0.625rem; border-bottom: 2px solid var(--admin-accent); color: var(--gray-900); letter-spacing: -0.01em; display: inline-block; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg, #0f172a 0%, #071320 50%, #0c1e35 100%); }
.login-container { width: 100%; max-width: 420px; padding: 2rem; }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo { font-size: 1.625rem; font-weight: 700; letter-spacing: -0.025em; color: #fff; }
.login-logo span { color: var(--admin-accent-light); }
.login-form { background: rgba(255,255,255,0.97); padding: 2.25rem; border-radius: var(--radius-lg); box-shadow: 0 25px 60px rgba(0,0,0,0.4), 0 8px 20px rgba(0,0,0,0.2), 0 0 0 1px rgba(13,148,136,0.1); backdrop-filter: blur(8px); }
.login-form .form-group { margin-bottom: 1rem; }
.login-form label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 0.25rem; color: var(--gray-700); }
.login-form input { width: 100%; padding: 0.625rem 0.75rem; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); font-size: 0.9375rem; }
.login-form input:focus { outline: none; border-color: var(--admin-accent); box-shadow: 0 0 0 3px rgba(13,148,136,0.12); }

/* Utilities */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--gray-500); }
.text-secondary { color: var(--gray-500); }
.text-danger { color: var(--admin-danger); }
.mt-1 { margin-top: 0.5rem; }
.mb-1 { margin-bottom: 0.5rem; }

/* ── Table Thumb Cells (blog list, etc.) ────────────────────────────────── */
.table-thumb-cell { width: 52px; padding: 6px 8px; }
.table-thumb { width: 44px; height: 44px; object-fit: cover; border-radius: var(--radius-sm); display: block; }
.table-thumb-placeholder {
    width: 44px; height: 44px; background: var(--gray-100); border-radius: var(--radius-sm);
    display: flex; align-items: center; justify-content: center; font-size: 1rem; color: var(--gray-400);
}

/* Row highlight (e.g. current user) */
.row-highlight td { background: var(--admin-accent-bg); }

/* ── Topbar Language Select ─────────────────────────────────────────────── */
.topbar-language-form { display: inline-flex; align-items: center; margin: 0 0.5rem; }
.topbar-lang-select {
    padding: 0.25rem 0.5rem; font-size: 0.8125rem; cursor: pointer;
    border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
    background-color: #fff; color: var(--gray-700); font-family: var(--font-sans);
    transition: border-color var(--transition);
}
.topbar-lang-select:hover { border-color: var(--gray-400); }
.topbar-lang-select:focus { outline: none; border-color: var(--admin-accent); }

/* ── Nav Badges & Section Labels ────────────────────────────────────────── */
.nav-section-label {
    font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em;
    color: rgba(255,255,255,0.3); padding: 0.75rem 1.25rem 0.25rem; user-select: none;
}
.nav-badge {
    font-size: 0.6rem; font-weight: 600; border-radius: 3px; padding: 1px 5px;
    margin-left: 4px; vertical-align: middle; line-height: 1.4;
}
.nav-badge--warn { background: var(--admin-warning); color: #000; }
.nav-item--warn { color: var(--admin-warning) !important; }

/* ── Phase 12c: Responsive Admin-UI ──────────────────────────────────────── */

/* Filter bar – shared layout for list-view filter forms */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 1.25rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 0.875rem 1.125rem;
    box-shadow: var(--shadow-xs);
}
.filter-bar input[type="text"],
.filter-bar input[type="search"],
.filter-bar select {
    padding: 0.4375rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    background: #fff;
    color: var(--gray-700);
}
.filter-bar input[type="text"],
.filter-bar input[type="search"] {
    flex: 1;
    min-width: 140px;
}

/* Horizontal-scroll wrapper for wide data tables */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Mobile sidebar backdrop */
.sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
    cursor: pointer;
}

/* Responsive */
@media (max-width: 768px) {
    .admin-sidebar { transform: translateX(-100%); }
    .admin-sidebar.open { transform: translateX(0); }
    .admin-main { margin-left: 0; }
    .sidebar-toggle { display: block; }

    /* Sidebar backdrop: shown when sidebar is open */
    .sidebar-backdrop.open { display: block; }

    /* Content header: allow wrapping on small screens */
    .content-header { flex-wrap: wrap; gap: 0.75rem; }
    .header-actions { flex-wrap: wrap; gap: 0.375rem; }

    /* Dashboard responsive: tablet */
    .dash-stats-primary { grid-template-columns: repeat(2, 1fr); }
    .dash-stats-secondary { grid-template-columns: repeat(3, 1fr); }
    .dash-content-grid { grid-template-columns: 1fr; }

    /* Media manager: stack folder sidebar above grid */
    .mm-layout { grid-template-columns: 1fr; }
    .mm-sidebar { position: static; }
}

/* Settings form: collapse sidebar below genuinely narrow viewports only.
   Kept separate from the 768px sidebar-toggle breakpoint so that Retina
   displays (CSS viewport ≈ 756px) still show the two-column form layout. */
@media (max-width: 640px) {
    .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    /* Reduce content padding on very small screens */
    .admin-content { padding: 1rem; }

    /* Topbar: hide username label, tighten gaps */
    .topbar-user { display: none; }
    .topbar-actions { gap: 0.5rem; font-size: 0.8125rem; }

    /* Dashboard responsive: phone */
    .dash-welcome { flex-direction: column; align-items: flex-start; }
    .dash-welcome-actions { width: 100%; }
    .dash-stats-primary { grid-template-columns: repeat(2, 1fr); }
    .dash-stats-secondary { grid-template-columns: 1fr; }
    .dash-system-grid { grid-template-columns: 1fr; }
}

/* ── Phase 3: Editor & Content UX ─────────────────────────────────────── */

/* Required field marker */
.required { color: var(--admin-danger); font-weight: 400; }

/* Form hints */
.form-hint { display: block; font-size: 0.8rem; color: var(--gray-500); margin-top: 0.25rem; line-height: 1.4; }
.editor-hint { margin-top: 0.375rem; }

/* Slug preview row */
.slug-preview-wrap { display: flex; align-items: center; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); overflow: hidden; background: #fff; }
.slug-preview-wrap:focus-within { border-color: var(--admin-accent); box-shadow: 0 0 0 3px rgba(13,148,136,0.12); }
.slug-prefix { padding: 0.5rem 0.625rem; background: var(--gray-100); color: var(--gray-500); font-size: 0.8125rem; white-space: nowrap; border-right: 1px solid var(--gray-300); }
.slug-preview-wrap input { border: none !important; box-shadow: none !important; border-radius: 0 !important; flex: 1; }
.slug-preview-wrap input:focus { outline: none !important; box-shadow: none !important; }

/* SEO character counter */
.seo-counter { font-size: 0.775rem; color: var(--gray-400); margin-top: 0.25rem; text-align: right; }
.seo-counter .seo-warn { color: var(--admin-warning); font-weight: 600; }
.seo-counter .seo-over { color: var(--admin-danger); font-weight: 600; }

/* Jodit editor integration – ensure it fits the form layout */
.jodit-container { border-color: var(--gray-300) !important; border-radius: var(--radius-sm) !important; }
.jodit-container:not(.jodit_fullsize) { max-width: 100%; }
.jodit-toolbar__box { background: var(--gray-50) !important; border-bottom: 1px solid var(--gray-200) !important; }
.jodit-wysiwyg { font-family: var(--font-sans) !important; font-size: 0.9375rem !important; line-height: 1.6 !important; padding: 1rem !important; }
.jodit-source__mirror { font-family: var(--font-mono) !important; font-size: 0.8125rem !important; }

/* Tag input */
#tags { font-family: var(--font-sans); }

/* Header actions row */
.header-actions { display: flex; gap: 0.5rem; align-items: center; }

/* ── Phase 3b: Media Picker & Content Workflow ───────────────────────────── */

/* Editor footer row: hint + picker button side by side */
.editor-footer-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
    margin-top: 0.375rem;
}
.editor-footer-row .form-hint { margin-top: 0; }

/* Media picker trigger button */
.media-picker-btn { white-space: nowrap; flex-shrink: 0; }

/* ── Media Manager (Phase 4a.1) ──────────────────────────────────────────── */

/* Two-column layout: sidebar + main */
.mm-layout {
    display: grid;
    grid-template-columns: 192px 1fr;
    gap: 1.25rem;
    align-items: start;
}

/* Main column: prevent grid overflow */
.mm-main { min-width: 0; }

/* ── Folder Sidebar ───────────────────────────────────────────────────────── */
.mm-sidebar {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    position: sticky;
    top: calc(var(--admin-topbar-height) + 1.25rem);
}

.mm-sidebar-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0.75rem 0.5rem 0.875rem;
    font-size: 0.6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--gray-400);
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
}

.mm-new-folder-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.5rem;
    height: 1.5rem;
    background: none;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    color: var(--gray-500);
    transition: background 0.12s, border-color 0.12s, color 0.12s;
}
.mm-new-folder-btn:hover {
    background: var(--gray-100);
    border-color: var(--gray-400);
    color: var(--gray-700);
}

.mm-folder-list { padding: 0.25rem 0; }

.mm-folder-row { display: flex; align-items: center; }
.mm-folder-row .mm-folder-item { flex: 1; min-width: 0; }

.mm-folder-item {
    display: flex;
    align-items: center;
    gap: 0.4375rem;
    padding: 0.4375rem 0.875rem;
    text-decoration: none;
    font-size: 0.8125rem;
    color: var(--gray-600);
    transition: background 0.12s, color 0.12s;
}
.mm-folder-item:hover { background: var(--gray-50); color: var(--gray-800); }
.mm-folder-item.active {
    background: var(--admin-accent-bg);
    color: var(--admin-accent);
    font-weight: 600;
}

.mm-folder-icon { font-size: 0.8125rem; flex-shrink: 0; opacity: 0.7; }
.mm-folder-item.active .mm-folder-icon { opacity: 1; }
.mm-folder-name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.mm-folder-count {
    font-size: 0.6875rem;
    background: var(--gray-100);
    color: var(--gray-500);
    border-radius: 9999px;
    padding: 0.0625rem 0.4rem;
    min-width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}
.mm-folder-item.active .mm-folder-count {
    background: var(--admin-accent-bg);
    color: var(--admin-accent);
}

.mm-folder-delete {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-300);
    font-size: 0.875rem;
    padding: 0.4375rem 0.625rem;
    line-height: 1;
    flex-shrink: 0;
    transition: color 0.12s;
}
.mm-folder-delete:hover { color: var(--admin-danger); }

/* ── Filter / Toolbar Bar ─────────────────────────────────────────────────── */
.mm-filterbar {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 0.875rem;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    margin-bottom: 1rem;
    flex-wrap: wrap;
}

.mm-search {
    flex: 1;
    min-width: 180px;
    padding: 0.4375rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.mm-search:focus {
    outline: none;
    border-color: var(--admin-primary-light);
    box-shadow: 0 0 0 3px rgba(51,65,85,0.08);
}

.mm-type-select {
    padding: 0.4375rem 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
    transition: border-color 0.15s;
}
.mm-type-select:focus { outline: none; border-color: var(--admin-primary-light); }

.mm-total {
    font-size: 0.8125rem;
    color: var(--gray-400);
    margin-left: auto;
    white-space: nowrap;
}

/* ── Media Grid ───────────────────────────────────────────────────────────── */
.mm-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(152px, 1fr));
    gap: 0.875rem;
}

.mm-card {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.15s, border-color 0.15s, transform 0.1s;
}
.mm-card:hover {
    border-color: var(--admin-accent);
    box-shadow: 0 2px 8px rgba(99,102,241,0.1);
    transform: translateY(-1px);
}

.mm-card-preview {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 120px;
    background: var(--gray-50);
    overflow: hidden;
    text-decoration: none;
    border-bottom: 1px solid var(--gray-100);
}
.mm-card-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.15s;
}
.mm-card:hover .mm-card-preview img { opacity: 0.92; }
.mm-card-icon { font-size: 2.5rem; opacity: 0.35; }

/* Video cards in Media Manager */
.mm-card--video .mm-card-preview { background: #0f172a; }
.mm-card-icon--video { font-size: 1rem; opacity: 1; display: flex; align-items: center; justify-content: center; height: 100%; }
.mm-video-badge {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0,0,0,0.65);
    color: #fff;
    border-radius: 50%;
    width: 2.25rem;
    height: 2.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    pointer-events: none;
    backdrop-filter: blur(2px);
}
.mm-card-preview { position: relative; }

/* iw-mpf: Media Picker Field (hero admin + media edit) */
.iw-media-picker-field { display: flex; flex-direction: column; gap: .5rem; }
.iw-mpf-input-row { display: flex; gap: .5rem; align-items: center; flex-wrap: wrap; }
.iw-mpf-text-input { flex: 1; min-width: 0; }
.iw-mpf-preview-wrap img,
.iw-mpf-preview-wrap video { max-height: 80px; border-radius: 4px; display: block; }
.iw-mpf-placeholder { font-size: 0.8125rem; color: var(--gray-400); }
.iw-mpf-actions { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; }
.iw-mpf-preview { margin-bottom: .25rem; }

.mm-card-info {
    padding: 0.5rem 0.75rem 0.375rem;
    flex: 1;
}
.mm-card-name {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--gray-800);
    text-decoration: none;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 0.25rem;
    line-height: 1.3;
}
.mm-card-name:hover { color: var(--admin-accent); }

.mm-card-meta {
    display: flex;
    align-items: center;
    gap: 0.375rem;
    font-size: 0.75rem;
    color: var(--gray-400);
    flex-wrap: wrap;
}
.mm-card-folder {
    font-size: 0.725rem;
    color: var(--gray-400);
    margin-top: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.mm-card-actions {
    display: flex;
    border-top: 1px solid var(--gray-100);
    background: var(--gray-50);
}
.mm-action-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.375rem 0;
    font-size: 0.8125rem;
    text-decoration: none;
    color: var(--gray-400);
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.12s, background 0.12s;
    font-family: var(--font-sans);
    border-right: 1px solid var(--gray-200);
}
.mm-action-btn:last-child { border-right: none; }
.mm-action-btn:hover { color: var(--admin-accent); background: var(--admin-accent-bg); }
.mm-action-btn--danger:hover { color: var(--admin-danger); background: #fef2f2; }

/* ── Empty State ──────────────────────────────────────────────────────────── */
.mm-empty {
    text-align: center;
    padding: 3.5rem 2rem;
    color: var(--gray-500);
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
}
.mm-empty-icon { font-size: 2.75rem; opacity: 0.25; margin-bottom: 0.875rem; }
.mm-empty p { margin-bottom: 1.25rem; font-size: 0.9375rem; color: var(--gray-500); }

/* ── Pagination ───────────────────────────────────────────────────────────── */
.mm-pagination {
    display: flex;
    gap: 0.375rem;
    margin-top: 1.25rem;
    flex-wrap: wrap;
}
.mm-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    height: 2rem;
    padding: 0 0.5rem;
    font-size: 0.875rem;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius-sm);
    text-decoration: none;
    color: var(--gray-700);
    background: #fff;
    transition: border-color 0.12s, background 0.12s, color 0.12s;
}
.mm-page-btn:hover { border-color: var(--admin-accent); color: var(--admin-accent); }
.mm-page-btn.active { background: var(--admin-primary); border-color: var(--admin-primary); color: #fff; }

/* ── Upload / Folder Modals ───────────────────────────────────────────────── */
.mm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.mm-modal {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    width: 100%;
    max-width: 680px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.mm-modal--sm { max-width: 440px; }

.mm-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    flex-shrink: 0;
    background: var(--gray-50);
}
.mm-modal-header h3 { font-size: 0.9375rem; font-weight: 600; color: var(--gray-800); }

.mm-close {
    background: none;
    border: none;
    font-size: 1.375rem;
    line-height: 1;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0.125rem;
    transition: color 0.12s;
}
.mm-close:hover { color: var(--gray-700); }

.mm-modal-body { padding: 1.25rem; overflow-y: auto; flex: 1; }
.mm-modal-footer { padding: 0.75rem 1.25rem; border-top: 1px solid var(--gray-200); flex-shrink: 0; }

/* ── Upload Zone ─────────────────────────────────────────────────────────── */
/* Visually hides the native file input while keeping it in the DOM for the
   form submission and browser-level required validation.                       */
.mm-file-input-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}
/* The <label> element that acts as the visual drop / click zone */
.mm-upload-zone {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 2.75rem 2rem 2.25rem;
    border: 2px dashed var(--gray-300);
    border-radius: var(--radius);
    background: var(--gray-50);
    cursor: pointer;
    text-align: center;
    transition: border-color 0.15s ease, background 0.15s ease, box-shadow 0.15s ease;
    user-select: none;
    -webkit-user-select: none;
    outline: none;
    min-height: 210px;
}
.mm-upload-zone:hover,
.mm-upload-zone:focus-within {
    border-color: var(--admin-primary-light);
    background: rgba(51,65,85,0.04);
    box-shadow: 0 0 0 4px rgba(51,65,85,0.06);
}
.mm-upload-zone.mm-zone-drag-over {
    border-color: var(--admin-primary-light);
    border-style: solid;
    background: rgba(51,65,85,0.04);
    box-shadow: 0 0 0 4px rgba(51,65,85,0.1);
}
/* Upload icon container */
.mm-upload-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.125rem;
    flex-shrink: 0;
}
/* Primary call-to-action line */
.mm-upload-primary {
    display: block;
    font-size: 1rem;
    font-weight: 600;
    color: var(--gray-800);
    line-height: 1.3;
}
/* Secondary "or drop here" line */
.mm-upload-secondary {
    display: block;
    font-size: 0.875rem;
    color: var(--gray-500);
    margin-top: 0.375rem;
}
/* Technical limits hint – visually subordinate, separated by hairline */
.mm-upload-hint {
    display: block;
    font-size: 0.75rem;
    color: var(--gray-400);
    margin-top: 1rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--gray-200);
    width: 100%;
}
/* Selection feedback shown below the zone after pick or drop */
.mm-upload-feedback {
    margin-top: 0.625rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--admin-success);
    min-height: 1.375rem;
    text-align: center;
}

/* ── Media Picker Modal ───────────────────────────────────────────────────── */
.media-picker-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}
.media-picker-modal {
    background: #fff;
    border-radius: var(--radius);
    box-shadow: 0 8px 32px rgba(0,0,0,0.14);
    width: 100%;
    max-width: 720px;
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.media-picker-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    border-bottom: 1px solid var(--gray-200);
    background: var(--gray-50);
    flex-shrink: 0;
}
.media-picker-header h3 { font-size: 0.9375rem; font-weight: 600; color: var(--gray-800); }
.media-picker-close {
    background: none;
    border: none;
    font-size: 1.375rem;
    line-height: 1;
    cursor: pointer;
    color: var(--gray-400);
    padding: 0.125rem;
    transition: color 0.12s;
}
.media-picker-close:hover { color: var(--gray-700); }

/* Picker toolbar: search + folder filter */
.media-picker-toolbar {
    padding: 0.75rem 1.25rem;
    background: var(--gray-50);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    gap: 0.625rem;
    align-items: center;
    flex-wrap: wrap;
    flex-shrink: 0;
}
.media-picker-toolbar-label {
    font-size: 0.8125rem;
    color: var(--gray-500);
    white-space: nowrap;
    font-weight: 500;
}
.media-picker-search {
    flex: 1;
    min-width: 140px;
    padding: 0.4375rem 0.75rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
}
.media-picker-search:focus {
    outline: none;
    border-color: var(--admin-primary-light);
    box-shadow: 0 0 0 3px rgba(51,65,85,0.08);
}
.media-picker-folder {
    padding: 0.4375rem 0.625rem;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-family: var(--font-sans);
    background: #fff;
    color: var(--gray-700);
    cursor: pointer;
    transition: border-color 0.15s;
}
.media-picker-folder:focus { outline: none; border-color: var(--admin-primary-light); }

/* Prevent body scroll when modals are open */
body.iw-modal-open { overflow: hidden; }

/* Wrapper between header and footer – must be a flex column so the grid can scroll */
#mediaPickerBody {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

/* Scrollable grid area */
.media-picker-body {
    padding: 1rem 1.25rem;
    overflow-y: auto;
    flex: 1;
    min-height: 220px;
}
.media-picker-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 0.75rem;
}
.media-picker-item {
    border: 2px solid transparent;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    background: var(--gray-50);
    transition: border-color 0.12s, box-shadow 0.12s, transform 0.1s;
}
.media-picker-item:hover {
    border-color: var(--admin-accent);
    box-shadow: 0 2px 6px rgba(99,102,241,0.1);
    transform: translateY(-1px);
}
.media-picker-item:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(99,102,241,0.2);
}
.media-picker-item img {
    width: 100%;
    height: 90px;
    object-fit: cover;
    display: block;
}
.media-picker-item-name {
    font-size: 0.75rem;
    padding: 0.3125rem 0.5rem;
    color: var(--gray-600);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1.3;
    border-top: 1px solid var(--gray-100);
    background: #fff;
}
.media-picker-footer {
    padding: 0.625rem 1.25rem;
    border-top: 1px solid var(--gray-200);
    font-size: 0.8125rem;
    color: var(--gray-500);
    background: var(--gray-50);
    flex-shrink: 0;
}
.media-picker-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--gray-400);
    font-size: 0.9rem;
}

/* ─── Login extras (forgot-password flow) ─── */
.login-subtitle { text-align: center; font-size: 1.1rem; font-weight: 600; margin-bottom: 0.5rem; color: var(--gray-800); }
.login-hint { text-align: center; font-size: 0.875rem; color: var(--gray-500); margin-bottom: 1.5rem; }
.login-forgot { text-align: center; margin-top: 1rem; font-size: 0.875rem; }
.login-forgot a { color: var(--admin-accent); text-decoration: none; }
.login-forgot a:hover { text-decoration: underline; }

/* ── Media Manager – Phase 15 additions ─────────────────────────────────── */

/* Rename-folder button in sidebar (next to delete) */
.mm-folder-rename {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 1.75rem;
    height: 1.75rem;
    padding: 0;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
    flex-shrink: 0;
}
.mm-folder-rename:hover { color: var(--admin-accent); }

/* Copy-URL button feedback: brief "Copied!" visual */
.mm-action-btn.mm-copied {
    color: var(--admin-success);
}

/* ── Drag & Drop (Phase 7c) ──────────────────────────────────────────────── */

/* The drop zone wraps mm-main; position:relative is needed for the overlay. */
#mmDropZone { position: relative; }

/* Visual state while files are dragged over the drop zone */
.mm-drag-over {
    outline: 2px dashed var(--admin-primary);
    outline-offset: -3px;
    border-radius: var(--radius);
}

/* Full-area overlay shown only during drag */
.mm-drop-hint {
    display: none;
    position: absolute;
    inset: 0;
    background: rgba(51,65,85,0.05);
    z-index: 20;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 0.625rem;
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--admin-primary);
    border-radius: var(--radius);
    pointer-events: none;
    border: 2px dashed var(--admin-primary);
}
.mm-drag-over .mm-drop-hint { display: flex; }
.mm-drop-icon { font-size: 2.25rem; line-height: 1; }

/* ── ITSWEBER Branding (Phase 6a) ────────────────────────────────────────── */
/* Admin login – brand logo */
.login-brand-link { display: block; text-decoration: none; }
.login-brand-logo {
    max-height: 88px;
    width: auto;
    margin: 0 auto;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 0.95;
}

/* ── end ITSWEBER Branding ───────────────────────────────────────────────── */

/* ── Login UX Enhancements (v3.0.4) ─────────────────────────────────────── */
/* Password toggle */
.login-password-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}
.login-password-wrapper input {
    padding-right: 2.75rem;
}
.login-password-toggle {
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    font-size: 1.125rem;
    line-height: 1;
    color: var(--gray-400);
    transition: color var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}
.login-password-toggle:hover { color: var(--gray-600); }
.login-password-toggle:focus-visible {
    outline: 2px solid var(--admin-accent);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Remember-Me checkbox */
.login-remember-group { margin-top: 0.25rem; margin-bottom: 0.75rem; }
.login-remember-label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    color: var(--gray-600);
    cursor: pointer;
    user-select: none;
}
.login-remember-label input[type="checkbox"] {
    width: 1rem;
    height: 1rem;
    accent-color: var(--admin-accent);
    cursor: pointer;
}

/* Back to website link */
.login-back-to-site {
    text-align: center;
    margin-top: 0.75rem;
    font-size: 0.875rem;
}
.login-back-to-site a {
    color: var(--gray-500);
    text-decoration: none;
    transition: color var(--transition);
}
.login-back-to-site a:hover { color: var(--admin-accent); }
/* ── end Login UX Enhancements ───────────────────────────────────────────── */

/* ── Phase 14: Accessibility Foundations ─────────────────────────────────── */

/* Skip link */
.skip-link {
    position: absolute;
    top: -100%;
    left: 0.5rem;
    padding: 0.5rem 1rem;
    background: var(--admin-primary);
    color: #fff;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 0 0 4px 4px;
    text-decoration: none;
    z-index: 9999;
    transition: top 0.15s;
}
.skip-link:focus {
    top: 0;
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Visible focus ring for keyboard navigation */
a:focus-visible,
button:focus-visible,
[tabindex="0"]:focus-visible {
    outline: 2px solid var(--admin-primary);
    outline-offset: 2px;
    border-radius: 2px;
}

/* Suppress outline for mouse/touch users */
a:focus:not(:focus-visible),
button:focus:not(:focus-visible),
[tabindex="0"]:focus:not(:focus-visible) {
    outline: none;
}

/* Admin form inputs: keep box-shadow focus but also show outline for keyboard */
.admin-form input:focus-visible,
.admin-form textarea:focus-visible,
.admin-form select:focus-visible {
    outline: 2px solid var(--admin-primary);
    outline-offset: 0;
}

/* ── end Accessibility Foundations ───────────────────────────────────────── */

/* ── Branding upload widget (Settings → Branding sidebar) ─────────────────── */
.branding-field { margin-bottom: 1.25rem; }
.branding-preview-wrap {
    position: relative; display: flex; align-items: center; gap: 0.75rem;
    margin-bottom: 0.5rem;
}
.branding-preview-img {
    max-height: 54px; max-width: 180px; border-radius: 6px;
    border: 1px solid var(--gray-200); background: var(--gray-50);
    object-fit: contain; padding: 2px;
}
.branding-no-preview {
    width: 180px; height: 54px; border-radius: 6px;
    border: 1px dashed var(--gray-200); background: var(--gray-50);
    display: flex; align-items: center; justify-content: center;
    color: var(--gray-400); font-size: 0.8rem;
}
.branding-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; align-items: center; }
.branding-actions .btn-xs { font-size: 0.8rem; padding: 0.3rem 0.7rem; border-radius: 5px; cursor: pointer; }
.branding-remove-btn {
    background: none; border: 1px solid #fca5a5; color: #dc2626;
    border-radius: 5px; font-size: 0.8rem; padding: 0.3rem 0.7rem; cursor: pointer;
}
.branding-remove-btn:hover { background: #fef2f2; }
.branding-path-display { font-size: 0.75rem; color: var(--gray-500); word-break: break-all; margin-top: 0.15rem; }

/* Branding picker modal */
.branding-picker-modal {
    background: #fff; border-radius: 10px; width: min(700px, 95vw);
    max-height: 80vh; display: flex; flex-direction: column; overflow: hidden;
}
.branding-picker-header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--gray-200);
    font-weight: 600; font-size: 1rem;
}
.branding-picker-header button { background: none; border: none; font-size: 1.25rem; cursor: pointer; color: var(--gray-500); }
#brandingPickerBody { overflow-y: auto; flex: 1; padding: 1rem; }
#brandingPickerOverlay {
    display: none; position: fixed; inset: 0; z-index: 9999;
    background: rgba(0,0,0,0.5); align-items: center; justify-content: center;
}
/* ── end Branding upload widget ───────────────────────────────────────────── */

/* ── Long-Running Action (LRA) – einheitliches Progress-/Status-Feedback ──── */
/* Einsatz: Backup-Erstellung, Restore-Ausführung, Update-Installation,         */
/* Galerie-Upload, Media-Manager-Upload.                                         */
/* Ehrliches Schritt-Feedback statt Fake-Fortschrittsbalken.                     */

/* Status-Block: wird per JS eingeblendet sobald die Aktion startet */
.lra-status {
    display: none;
    margin-top: 1rem;
    padding: 0.875rem 1.1rem;
    background: #eff6ff;
    border: 1px solid #93c5fd;
    border-radius: 8px;
    font-size: 0.875rem;
    color: #1e3a8a;
    line-height: 1.5;
}
.lra-status.lra-active {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

/* Drehender Kreis-Spinner (reines CSS, keine Bild-Abhängigkeit) */
.lra-spinner {
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border: 2.5px solid #bfdbfe;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: lra-spin 0.8s linear infinite;
    margin-top: 2px;
}
@keyframes lra-spin {
    to { transform: rotate(360deg); }
}

/* Textteil des Status-Blocks */
.lra-status-body  { flex: 1; }
.lra-status-heading {
    font-weight: 600;
    margin-bottom: 0.375rem;
    color: #1e40af;
}

/* Schritt-Liste */
.lra-steps {
    list-style: none;
    margin: 0;
    padding: 0;
}
.lra-steps li {
    padding: 0.125rem 0;
    color: #64748b;
    font-size: 0.8125rem;
}
.lra-steps li.lra-step-current {
    color: #1d4ed8;
    font-weight: 600;
}
.lra-steps li.lra-step-current::before { content: '→ '; }

/* Inline-Spinner im Submit-Button selbst */
.lra-btn-spinner {
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid rgba(255,255,255,0.45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: lra-spin 0.8s linear infinite;
    vertical-align: middle;
    margin-right: 0.375rem;
}
/* Auf dunklem Hintergrund (btn-warning / sekundäre Buttons) */
.btn-secondary .lra-btn-spinner,
.btn-warning .lra-btn-spinner {
    border-color: rgba(0,0,0,0.2);
    border-top-color: currentColor;
}
/* ── end Long-Running Action ─────────────────────────────────────────────── */

/* ── Section Items Sortable (Move buttons for features, topic_cards, highlight_grid) */
.btn-xs {
    padding: 0.25rem 0.5rem;
    font-size: 0.75rem;
    height: auto;
    line-height: 1;
    min-width: auto;
}
.btn-xs:hover {
    opacity: 0.8;
}
.item-move-buttons {
    flex-direction: column;
    gap: 0.2rem;
}
.item-move-buttons .btn-xs {
    background-color: #e9ecef;
    color: #495057;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
}
.item-move-buttons .btn-xs:hover {
    background-color: #dee2e6;
    color: #212529;
}
.item-move-buttons .btn-xs:active {
    background-color: #adb5bd;
    color: #fff;
}
/* ── end Section Items Sortable ─────────────────────────────────────────── */

/* ═══════════════════════════════════════════════════════════════════════════
   ITSWEBER CMS – Modern Admin Polish (v3.0.6)
   Global visual upgrades for a premium admin experience.
   ═══════════════════════════════════════════════════════════════════════════ */

/* ── Selection Color ──────────────────────────────────────────────────────── */
::selection { background: rgba(13,148,136,0.18); color: var(--gray-900); }

/* ── Smooth Scrolling ─────────────────────────────────────────────────────── */
html { scroll-behavior: smooth; }

/* ── Custom Scrollbar (admin content) ─────────────────────────────────────── */
.admin-main::-webkit-scrollbar { width: 6px; }
.admin-main::-webkit-scrollbar-track { background: transparent; }
.admin-main::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 3px; }
.admin-main::-webkit-scrollbar-thumb:hover { background: var(--gray-400); }

/* ── Links in admin content ───────────────────────────────────────────────── */
.admin-content a:not(.btn):not(.nav-item):not(.topbar-link) {
    color: var(--admin-primary);
    text-decoration: none;
    transition: color 0.15s ease;
}
.admin-content a:not(.btn):not(.nav-item):not(.topbar-link):hover {
    color: var(--admin-primary-dark);
    text-decoration: underline;
}

/* ── Topbar Links polish ──────────────────────────────────────────────────── */
.topbar-link {
    color: var(--admin-primary) !important;
    font-weight: 600;
    transition: all 0.2s ease !important;
    border-radius: var(--radius-sm);
}
.topbar-link:hover {
    color: var(--admin-primary-dark) !important;
    background: var(--admin-accent-bg) !important;
    box-shadow: 0 1px 4px rgba(13,148,136,0.1);
}

/* ── Form Hint polish ─────────────────────────────────────────────────────── */
.form-hint {
    font-size: 0.775rem;
    color: var(--gray-400);
    margin-top: 0.375rem;
    line-height: 1.4;
}

/* ── Admin Content padding ────────────────────────────────────────────────── */
.admin-content {
    padding: 1.75rem 2rem;
}

/* ── Backup / Tab system – modern overrides ───────────────────────────────── */
.backup-tabs {
    display: flex !important;
    gap: 0.25rem !important;
    border-bottom: 2px solid var(--gray-200) !important;
    margin-bottom: 1.75rem !important;
    padding: 0 !important;
}
.backup-tab {
    padding: 0.75rem 1.25rem !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    border-bottom: 3px solid transparent !important;
    margin-bottom: -2px !important;
    color: var(--gray-500) !important;
    font-size: 0.875rem !important;
    border-radius: var(--radius-sm) var(--radius-sm) 0 0 !important;
    transition: all 0.2s ease !important;
    background: transparent !important;
}
.backup-tab:hover {
    color: var(--admin-primary) !important;
    background: var(--admin-accent-bg) !important;
}
.backup-tab.active {
    color: var(--admin-primary) !important;
    border-bottom-color: var(--admin-primary) !important;
    background: rgba(14,116,144,0.04) !important;
}

/* ── Backup info boxes ────────────────────────────────────────────────────── */
.backup-info-box {
    background: linear-gradient(135deg, #f0fdfa 0%, #f8fafc 100%) !important;
    border: 1.5px solid rgba(13,148,136,0.15) !important;
    border-radius: var(--radius-lg) !important;
    padding: 1.25rem 1.5rem !important;
    margin-bottom: 1.5rem !important;
}
.backup-info-box h4 {
    font-weight: 800 !important;
    color: var(--gray-900) !important;
    font-size: 1.0625rem !important;
    margin: 0 0 0.5rem !important;
}
.backup-info-box p {
    color: var(--gray-600) !important;
    font-size: 0.875rem !important;
    line-height: 1.65 !important;
}

/* ── Backup version badge ─────────────────────────────────────────────────── */
.backup-version-badge {
    display: inline-block !important;
    background: linear-gradient(135deg, var(--admin-primary) 0%, var(--admin-accent) 100%) !important;
    color: #fff !important;
    border-radius: 20px !important;
    padding: 0.2rem 0.75rem !important;
    font-size: 0.775rem !important;
    font-weight: 700 !important;
    letter-spacing: 0.02em !important;
    box-shadow: 0 2px 6px rgba(14,116,144,0.25) !important;
}

/* ── Global fieldsets (non-form context too) ───────────────────────────────── */
fieldset {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-lg);
    padding: 1.5rem;
    margin-bottom: 1.25rem;
    background: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
fieldset:hover {
    border-color: rgba(13,148,136,0.2);
    box-shadow: 0 2px 12px rgba(13,148,136,0.06);
}
legend {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--gray-800);
    padding: 0 0.625rem;
    letter-spacing: -0.01em;
}

/* ── Global inputs (outside .admin-form too, e.g. backup page) ────────────── */
input[type="text"],
input[type="email"],
input[type="password"],
input[type="number"],
input[type="url"],
textarea,
select {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    padding: 0.625rem 0.875rem;
    font-size: 0.875rem;
    font-family: var(--font-sans);
    color: var(--gray-800);
    background: #fff;
    transition: all 0.2s ease;
    box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
input[type="text"]:hover,
input[type="email"]:hover,
input[type="password"]:hover,
input[type="number"]:hover,
input[type="url"]:hover,
textarea:hover,
select:hover {
    border-color: var(--admin-primary-light);
    box-shadow: 0 2px 6px rgba(14,116,144,0.08);
}
input[type="text"]:focus,
input[type="email"]:focus,
input[type="password"]:focus,
input[type="number"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
    outline: none;
    border-color: var(--admin-accent);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12), 0 2px 8px rgba(13,148,136,0.08);
}
input::placeholder, textarea::placeholder {
    color: var(--gray-400);
    font-weight: 400;
}
select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10l-5 5z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    padding-right: 2.25rem;
    cursor: pointer;
}
input[type="checkbox"],
input[type="radio"] {
    width: 1.125rem;
    height: 1.125rem;
    accent-color: var(--admin-primary);
    cursor: pointer;
}

/* ── Global button fallback (outside .btn class too) ──────────────────────── */
button:not(.btn):not(.glb-close):not(.glb-nav):not(.glb-share-btn):not(.nav-toggle):not(.sidebar-toggle):not(.nav-group-toggle):not(.backup-tab) {
    font-family: var(--font-sans);
    cursor: pointer;
    transition: all 0.2s ease;
}

/* ── Checkbox label polish ────────────────────────────────────────────────── */
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-weight: 500;
    cursor: pointer;
    padding: 0.375rem 0;
    border-radius: var(--radius-sm);
    transition: color 0.15s ease;
}
.checkbox-label:hover {
    color: var(--admin-primary);
}

/* ── Small text / hints ───────────────────────────────────────────────────── */
small, .form-hint, .text-muted {
    color: var(--gray-400);
}

/* ── Data table action buttons ────────────────────────────────────────────── */
.data-table .btn-sm,
.data-table .btn-xs {
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
    border-radius: var(--radius-sm);
}
.data-table .btn-sm:hover,
.data-table .btn-xs:hover {
    box-shadow: 0 3px 8px rgba(0,0,0,0.1);
    transform: translateY(-1px);
}

/* ── Move buttons modern ──────────────────────────────────────────────────── */
.item-move-buttons .btn-xs {
    background-color: var(--gray-100) !important;
    color: var(--gray-600) !important;
    border: 1px solid var(--gray-200) !important;
    border-radius: var(--radius-sm) !important;
}
.item-move-buttons .btn-xs:hover {
    background-color: var(--admin-accent-bg) !important;
    color: var(--admin-primary) !important;
    border-color: rgba(13,148,136,0.2) !important;
}

/* ── Dashboard stat accent polish ─────────────────────────────────────────── */
.dash-stat-accent { width: 5px; border-radius: 0 3px 3px 0; }

/* ── Content header modernized ────────────────────────────────────────────── */
.content-header {
    border-bottom: 2px solid var(--gray-200);
    padding-bottom: 1.125rem;
    margin-bottom: 1.75rem;
}

/* ── Toast / flash messages ───────────────────────────────────────────────── */
.alert {
    border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
    font-weight: 500;
    box-shadow: var(--shadow);
}

/* ── Empty state ──────────────────────────────────────────────────────────── */
.text-muted {
    color: var(--gray-400);
    font-style: italic;
}

/* ── Long-running action button polish ────────────────────────────────────── */
.lra-btn {
    border-radius: var(--radius-sm) !important;
    font-weight: 600 !important;
    letter-spacing: 0.01em !important;
}

/* ── Admin body background subtle pattern ─────────────────────────────────── */
.admin-main {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
    min-height: 100vh;
}

/* ── Print-safe: hide sidebar/topbar ──────────────────────────────────────── */
@media print {
    .admin-sidebar, .admin-topbar, .sidebar-backdrop { display: none !important; }
    .admin-main { margin-left: 0 !important; }
}

/* Screen-reader only utility */
.sr-only {
    position: absolute; width: 1px; height: 1px;
    padding: 0; margin: -1px; overflow: hidden;
    clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ═══════════════════════════════════════════════════════════════════════════
   Tabs Component (v3.3.0)
   ═══════════════════════════════════════════════════════════════════════════ */
.iw-tabs {
    display: flex; gap: 0;
    border-bottom: 2px solid var(--comp-card-border, #e2e8f0);
    margin-bottom: 1.5rem;
}
.iw-tab {
    display: inline-flex; align-items: center; gap: 0.375rem;
    padding: 0.75rem 1.25rem;
    font-size: 0.875rem; font-weight: 600; font-family: inherit;
    color: var(--sem-text-secondary, #64748b);
    cursor: pointer; border: none; background: none;
    position: relative;
    transition: color 0.18s ease;
    white-space: nowrap;
}
.iw-tab:hover { color: var(--sem-text-primary, #334155); }
.iw-tab.active { color: var(--sem-interactive-primary, #0e7490); }
.iw-tab.active::after {
    content: ''; position: absolute;
    bottom: -2px; left: 0; right: 0; height: 2px;
    background: linear-gradient(90deg, var(--sem-interactive-primary, #0e7490), var(--p-emerald-600, #0d9488));
    border-radius: 2px 2px 0 0;
}
.iw-tab-icon { opacity: 0.7; display: inline-flex; }
.iw-tab.active .iw-tab-icon { opacity: 1; }
.iw-tab-panel { display: none; animation: iwFadeIn 0.25s ease; }
.iw-tab-panel.active { display: block; }
@keyframes iwFadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

/* ═══════════════════════════════════════════════════════════════════════════
   Mail Settings (v3.3.0 Phase 4)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Transport selection cards */
.mail-transport-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin-bottom: 0.5rem; }
.mail-transport-card {
    position: relative; display: flex; flex-direction: column; gap: 0.25rem;
    border: 2px solid var(--comp-card-border, #e2e8f0);
    border-radius: var(--p-radius-lg, 12px);
    padding: 1.375rem; cursor: pointer;
    background: var(--comp-card-bg, #fff);
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.mail-transport-card:hover {
    border-color: var(--sem-border-default, #cbd5e1);
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.08));
    transform: translateY(-2px);
}
.mail-transport-card.selected {
    border-color: var(--sem-interactive-primary, #0d9488);
    box-shadow: 0 0 0 3px rgba(13,148,136,0.12), var(--shadow-md, 0 4px 12px rgba(0,0,0,0.08));
}
.mail-transport-check {
    position: absolute; top: 0.75rem; right: 0.75rem;
    width: 24px; height: 24px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    border: 2px solid var(--sem-border-default, #cbd5e1);
    background: var(--comp-card-bg, #fff); color: transparent;
    transition: all 0.25s;
}
.mail-transport-card.selected .mail-transport-check {
    background: linear-gradient(135deg, var(--p-emerald-600, #0d9488), var(--sem-interactive-primary, #0e7490));
    border-color: var(--p-emerald-600, #0d9488);
    color: #fff;
}
.mail-transport-icon {
    width: 48px; height: 48px; border-radius: var(--p-radius-md, 8px);
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 0.5rem; transition: all 0.25s;
    background: var(--sem-surface-secondary, #f1f5f9); color: var(--sem-text-secondary, #64748b);
}
.mail-transport-card.selected .mail-transport-icon {
    background: rgba(13,148,136,0.12); color: var(--sem-interactive-primary, #0d9488);
}
.mail-transport-title { font-weight: 700; font-size: 0.9375rem; color: var(--sem-text-primary, #1e293b); }
.mail-transport-card.selected .mail-transport-title { color: var(--sem-interactive-primary, #0e7490); }
.mail-transport-desc { font-size: 0.8125rem; color: var(--sem-text-secondary, #64748b); line-height: 1.45; }
.mail-transport-badge {
    display: inline-flex; align-items: center; gap: 0.25rem;
    margin-top: 0.5rem; padding: 0.1875rem 0.625rem;
    background: var(--sem-feedback-success-bg, #f0fdf4);
    color: var(--sem-feedback-success, #059669);
    font-size: 0.6875rem; font-weight: 600;
    border-radius: 9999px; border: 1px solid rgba(13,148,136,0.12);
    width: fit-content;
}

/* SMTP slide-in */
.mail-smtp-settings {
    overflow: hidden; max-height: 0; opacity: 0;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, margin 0.3s ease;
    margin-bottom: 0;
}
.mail-smtp-settings.visible { max-height: 600px; opacity: 1; margin-bottom: 1.25rem; }
.form-card--smtp {
    border-color: rgba(13,148,136,0.2) !important;
    background: linear-gradient(to bottom right, var(--comp-card-bg, #fff) 60%, rgba(240,253,250,0.5)) !important;
}
.form-card-header-row { display: flex; align-items: center; gap: 0.75rem; margin-bottom: 1rem; }
.form-card-header-row h4 { margin-bottom: 0; }
.mail-smtp-badge {
    font-size: 0.6875rem; font-weight: 600;
    color: var(--sem-interactive-primary, #0d9488);
    background: var(--sem-feedback-success-bg, #f0fdf4);
    padding: 0.1875rem 0.5rem; border-radius: 9999px;
    border: 1px solid rgba(13,148,136,0.12);
}

/* Password toggle */
.input-password-wrap { position: relative; }
.input-password-wrap input { padding-right: 3rem; }
.password-toggle {
    position: absolute; right: 0.625rem; top: 50%; transform: translateY(-50%);
    background: none; border: none; cursor: pointer;
    color: var(--sem-text-tertiary, #94a3b8); padding: 0.25rem;
    border-radius: var(--p-radius-sm, 4px); transition: color 0.15s;
    display: flex; align-items: center;
}
.password-toggle:hover { color: var(--sem-text-secondary, #64748b); }

/* Action bar */
.mail-action-bar {
    background: var(--comp-card-bg, #fff);
    border: 1px solid var(--comp-card-border, #e2e8f0);
    border-radius: var(--p-radius-lg, 12px);
    padding: 1rem 1.5rem;
    display: flex; align-items: center; gap: 0.75rem;
    box-shadow: var(--shadow-sm, 0 1px 3px rgba(0,0,0,0.08));
    margin-top: 1.5rem;
}
.mail-action-feedback {
    margin-left: auto; font-size: 0.875rem; font-weight: 600;
    opacity: 0; transition: opacity 0.3s ease;
}
.mail-action-feedback.show { opacity: 1; }
.mail-action-feedback.success { color: var(--sem-feedback-success, #059669); }
.mail-action-feedback.error { color: var(--sem-feedback-error, #dc2626); }

/* Form card desc */
.form-card-desc { font-size: 0.8125rem; color: var(--sem-text-secondary, #64748b); margin-bottom: 1rem; }

/* Template grid */
.mail-templates-desc { font-size: 0.875rem; color: var(--sem-text-secondary, #64748b); margin-bottom: 1.25rem; }
.mail-template-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.mail-template-card {
    background: var(--comp-card-bg, #fff);
    border: 1px solid var(--comp-card-border, #e2e8f0);
    border-radius: var(--p-radius-lg, 12px);
    padding: 1.25rem; display: flex; flex-direction: column;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}
.mail-template-card:hover {
    box-shadow: var(--shadow-md, 0 4px 12px rgba(0,0,0,0.08));
    border-color: var(--sem-border-default, #cbd5e1);
    transform: translateY(-2px);
}
.mail-template-card-header { display: flex; align-items: flex-start; gap: 0.75rem; margin-bottom: 0.75rem; }
.mail-template-card-icon {
    width: 40px; height: 40px; border-radius: var(--p-radius-md, 8px);
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
    background: rgba(13,148,136,0.1); color: var(--sem-interactive-primary, #0d9488);
}
.mail-template-card-title { font-size: 0.9375rem; font-weight: 700; color: var(--sem-text-primary, #1e293b); margin-bottom: 0.125rem; }
.mail-template-card-subject {
    font-size: 0.75rem; color: var(--sem-text-secondary, #64748b);
    font-family: var(--p-font-mono, monospace);
    background: var(--sem-surface-secondary, #f8fafc);
    padding: 0.25rem 0.5rem; border-radius: var(--p-radius-sm, 4px);
    display: inline-block; margin-top: 0.25rem;
    border: 1px solid var(--comp-card-border, #f1f5f9);
}

/* Mini preview skeleton */
.mail-template-card-preview {
    width: 100%; height: 80px; border-radius: var(--p-radius-sm, 4px);
    background: linear-gradient(180deg, rgba(240,253,250,0.5) 0%, var(--sem-surface-secondary, #f8fafc) 100%);
    border: 1px solid var(--comp-card-border, #f1f5f9);
    margin: 0.75rem 0; display: flex; align-items: center; justify-content: center;
}
.mail-preview-mini { width: 80%; padding: 0.5rem; }
.mail-preview-mini-bar { height: 6px; border-radius: 3px; background: linear-gradient(90deg, #0e7490, #0d9488); margin-bottom: 0.375rem; }
.mail-preview-mini-line { height: 4px; border-radius: 2px; background: var(--sem-border-default, #e2e8f0); margin-bottom: 0.25rem; }
.mail-preview-mini-line.medium { width: 70%; }
.mail-preview-mini-line.short { width: 45%; }
.mail-preview-mini-btn { width: 40%; height: 8px; border-radius: 4px; background: linear-gradient(90deg, #0e7490, #0d9488); margin: 0.375rem 0; }

.mail-template-card-meta {
    margin-top: auto; padding-top: 0.75rem;
    border-top: 1px solid var(--comp-card-border, #f1f5f9);
    display: flex; align-items: center; justify-content: space-between;
}
.mail-template-card-date { font-size: 0.75rem; color: var(--sem-text-tertiary, #94a3b8); }

/* Template editor layout */
.mail-editor-layout { display: grid; grid-template-columns: 1fr 280px; gap: 1.25rem; align-items: start; }
.mail-editor-sidebar .form-card { position: sticky; top: calc(var(--comp-topbar-height, 56px) + 1.5rem); }
.mail-var-list { display: flex; flex-direction: column; gap: 0.375rem; }
.mail-var-tag {
    display: flex; align-items: center; justify-content: space-between; gap: 0.375rem;
    padding: 0.5rem 0.625rem;
    background: var(--sem-surface-secondary, #f8fafc);
    border: 1px solid var(--comp-card-border, #e2e8f0);
    border-radius: var(--p-radius-sm, 6px);
    cursor: pointer; font-family: inherit; font-size: 0.8125rem;
    transition: all 0.15s ease; text-align: left; width: 100%;
    overflow: hidden;
}
.mail-var-tag:hover {
    background: rgba(13,148,136,0.06);
    border-color: var(--sem-interactive-primary, #0d9488);
}
.mail-var-tag code { font-family: var(--p-font-mono, monospace); font-size: 0.6875rem; color: var(--sem-interactive-primary, #0e7490); white-space: nowrap; flex-shrink: 0; }
.mail-var-label { font-size: 0.6875rem; color: var(--sem-text-tertiary, #94a3b8); text-align: right; line-height: 1.3; }

/* Responsive */
@media (max-width: 768px) {
    .mail-transport-cards { grid-template-columns: 1fr; }
    .mail-template-grid { grid-template-columns: 1fr; }
    .mail-editor-layout { grid-template-columns: 1fr; }
    .mail-editor-sidebar .form-card { position: static; }
}

/* ═══════════════════════════════════════════════════════════════════════════
   end Modern Admin Polish (v3.0.6)
   ═══════════════════════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════════════════════
   Bulk Actions (v3.3.0)
   ═══════════════════════════════════════════════════════════════════════════ */

/* Checkbox column */
.bulk-check-cell {
    width: 40px;
    text-align: center;
    padding-left: 0.5rem !important;
    padding-right: 0 !important;
}
.bulk-check-cell input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
    accent-color: var(--admin-primary, #2563eb);
}

/* Action Bar */
.bulk-action-bar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.625rem 1rem;
    background: var(--admin-primary, #2563eb);
    color: #fff;
    border-radius: var(--radius-md, 6px);
    margin-bottom: 0.75rem;
    font-size: 0.875rem;
    animation: bulkBarSlideIn 0.2s ease;
}
.bulk-action-bar[hidden] {
    display: none;
}
@keyframes bulkBarSlideIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.bulk-action-bar .bulk-count {
    font-weight: 600;
    white-space: nowrap;
}
.bulk-action-bar .bulk-actions-group {
    display: flex;
    gap: 0.5rem;
    margin-left: auto;
}
.bulk-action-bar .btn {
    padding: 0.3125rem 0.75rem;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm, 4px);
    border: 1px solid rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.15);
    color: #fff;
    cursor: pointer;
    transition: background 0.15s;
    white-space: nowrap;
}
.bulk-action-bar .btn:hover {
    background: rgba(255,255,255,0.25);
}
.bulk-action-bar .btn-bulk-danger {
    background: var(--admin-danger, #dc2626);
    border-color: var(--admin-danger, #dc2626);
}
.bulk-action-bar .btn-bulk-danger:hover {
    background: #b91c1c;
}
.bulk-action-bar .btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Row highlight when checked */
.data-table tbody tr:has(input[data-bulk-item]:checked) {
    background: color-mix(in srgb, var(--admin-primary, #2563eb) 6%, transparent);
}

@media (max-width: 768px) {
    .bulk-action-bar {
        flex-wrap: wrap;
        gap: 0.5rem;
    }
    .bulk-action-bar .bulk-actions-group {
        margin-left: 0;
        width: 100%;
    }
}

/* ── F4: Dashboard Redesign ─────────────────────────────────────────────── */

/* Secondary stats: 4-column grid */
.dash-stats-secondary { grid-template-columns: repeat(4, 1fr); }

/* Storage bar inside media mini card */
.dash-stat-mini--storage { align-items: flex-start; }
.dash-stat-mini--storage .dash-stat-mini-info { flex: 1; min-width: 0; }
.dash-storage-bar-wrap { margin-top: 0.25rem; }
.dash-storage-bar {
    height: 3px; background: var(--gray-100); border-radius: 99px; overflow: hidden;
}
.dash-storage-bar-fill {
    height: 100%; background: linear-gradient(90deg, var(--admin-primary), var(--admin-accent));
    border-radius: 99px; transition: width 0.6s ease;
}
.dash-storage-bar-label {
    display: flex; justify-content: space-between;
    font-size: 0.625rem; color: var(--gray-400); margin-top: 0.1875rem;
}

/* Panel header: right side (link + eye) */
.dash-panel-header-right { display: flex; align-items: center; gap: 0.375rem; }

/* Drag handle */
.dash-panel-drag-handle {
    display: flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; background: none; border: none;
    color: var(--gray-300); cursor: grab; padding: 0; border-radius: 3px;
    transition: color var(--transition);
}
.dash-panel-drag-handle:hover { color: var(--gray-500); }
.dash-panel-drag-handle:active { cursor: grabbing; }

/* Eye / collapse toggle */
.dash-panel-eye {
    display: flex; align-items: center; justify-content: center;
    width: 24px; height: 24px; background: none; border: none;
    color: var(--gray-300); cursor: pointer; padding: 0; border-radius: 4px;
    transition: all var(--transition);
}
.dash-panel-eye:hover { color: var(--gray-600); background: var(--gray-100); }

/* Collapsed panel: hide body, dim header */
.dash-panel--collapsed .dash-panel-body,
.dash-panel--collapsed .dash-health-items,
.dash-panel--collapsed .dash-panel-empty,
.dash-panel--collapsed .dash-panel-empty-state,
.dash-panel--collapsed .dash-quick-draft,
.dash-panel--collapsed .dash-system-grid,
.dash-panel--collapsed .dash-event-item { display: none; }
.dash-panel--collapsed { opacity: 0.6; }
.dash-panel--collapsed .dash-panel-eye { color: var(--gray-400); }

/* Sortable ghost / chosen */
.dash-panel.sortable-ghost { opacity: 0.3; background: var(--gray-50); }
.dash-panel.sortable-chosen { box-shadow: 0 8px 24px rgba(0,0,0,0.15); }
.dash-panel.sortable-drag { opacity: 1; }

/* Panel: health score */
.dash-health-score {
    width: 44px; height: 44px; border-radius: 50%; flex-shrink: 0;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.875rem; font-weight: 700;
}
.dash-health-score--good { background: #f0fdf4; color: #059669; box-shadow: inset 0 0 0 2px #bbf7d0; }
.dash-health-score--warn { background: #fffbeb; color: #d97706; box-shadow: inset 0 0 0 2px #fde68a; }
.dash-health-score--bad  { background: #fef2f2; color: #dc2626; box-shadow: inset 0 0 0 2px #fecaca; }

/* Health list */
.dash-health-items { list-style: none; padding: 0; margin: 0; }
.dash-health-item {
    display: flex; align-items: center; gap: 0.625rem;
    padding: 0.5rem 1.25rem; border-bottom: 1px solid var(--gray-50);
    transition: background var(--transition);
}
.dash-health-item:last-child { border-bottom: none; }
.dash-health-item:hover { background: var(--gray-50); }
.dash-health-dot {
    width: 7px; height: 7px; border-radius: 50%; flex-shrink: 0;
}
.dash-health-dot--green { background: #059669; }
.dash-health-dot--amber { background: #d97706; }
.dash-health-dot--red   { background: #dc2626; }
.dash-health-label { font-size: 0.8125rem; color: var(--gray-700); flex: 1; text-decoration: none; }
.dash-health-label:hover { color: var(--admin-accent); }
a.dash-health-label:hover { text-decoration: underline; }
.dash-health-action { font-size: 0.6875rem; color: var(--admin-accent); font-weight: 600; white-space: nowrap; flex-shrink: 0; text-decoration: none; }
.dash-health-action:hover { text-decoration: underline; }
.dash-health-ok { font-size: 0.6875rem; color: #059669; font-weight: 600; flex-shrink: 0; }

/* Panel: additional icon types */
.dash-panel-icon--draft  { background: #fef3c7; color: #d97706; }
.dash-panel-icon--plugins { background: #fdf4ff; color: #a855f7; }

/* Quick Draft */
.dash-quick-draft { padding: 1rem 1.25rem; }
.dash-qd-input,
.dash-qd-textarea {
    width: 100%; padding: 0.5rem 0.75rem;
    border: 1px solid var(--gray-200); border-radius: var(--radius-sm);
    font-size: 0.8125rem; font-family: inherit; background: #fff;
    transition: border-color var(--transition);
}
.dash-qd-input:focus,
.dash-qd-textarea:focus {
    outline: none; border-color: var(--admin-primary);
    box-shadow: 0 0 0 3px rgba(14,116,144,0.08);
}
.dash-qd-input { margin-bottom: 0.5rem; }
.dash-qd-textarea {
    height: 64px; resize: vertical; margin-bottom: 0.75rem;
}
.dash-qd-footer {
    display: flex; align-items: center; justify-content: space-between; gap: 0.75rem;
}
.dash-qd-type { display: flex; gap: 0.75rem; }
.dash-qd-type-label {
    display: flex; align-items: center; gap: 0.375rem;
    font-size: 0.8125rem; color: var(--gray-600); cursor: pointer;
}
.dash-qd-type-label input { cursor: pointer; }

/* Empty state inside panels */
.dash-panel-empty-state {
    padding: 1.5rem 1.25rem; text-align: center;
}
.dash-empty-icon {
    width: 40px; height: 40px; border-radius: 10px; background: var(--gray-50);
    display: inline-flex; align-items: center; justify-content: center;
    color: var(--gray-300); margin-bottom: 0.5rem;
}
.dash-panel-empty-state p {
    font-size: 0.8125rem; color: var(--gray-400); margin-bottom: 0.75rem;
}

/* What's New Banner */
.dash-news-banner {
    display: flex; align-items: flex-start; gap: 0.75rem; margin-top: 1.25rem;
    background: linear-gradient(135deg, #ecfdf5, #f0fdfa);
    border: 1px solid #a7f3d0; border-radius: var(--radius-lg);
    padding: 1rem 1.25rem;
}
.dash-news-banner.is-hidden { display: none; }
.dash-news-icon {
    width: 32px; height: 32px; border-radius: 8px;
    background: #d1fae5; color: #059669;
    display: flex; align-items: center; justify-content: center; flex-shrink: 0;
}
.dash-news-body { flex: 1; min-width: 0; }
.dash-news-body strong { font-size: 0.8125rem; font-weight: 700; color: #065f46; }
.dash-news-body ul {
    display: flex; flex-wrap: wrap; gap: 0.25rem 1rem;
    list-style: none; padding: 0; margin: 0.375rem 0 0;
    font-size: 0.75rem; color: #047857;
}
.dash-news-body li::before { content: '•'; margin-right: 0.375rem; color: #a7f3d0; }
.dash-news-close {
    background: none; border: none; color: #6ee7b7; cursor: pointer;
    font-size: 1.125rem; line-height: 1; padding: 0.125rem; margin-left: auto;
    flex-shrink: 0;
}
.dash-news-close:hover { color: #059669; }

/* Responsive adjustments */
@media (max-width: 1100px) {
    .dash-stats-secondary { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
    .dash-stats-secondary { grid-template-columns: repeat(2, 1fr); }
    .dash-qd-footer { flex-direction: column; align-items: stretch; }
    .dash-qd-footer .btn { width: 100%; justify-content: center; }
}

/* ── Contact Form Builder (F5 v3.3.0) ──────────────────────────────────── */
.cf-builder-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 1.25rem;
    align-items: start;
}
.cf-builder-main   { min-width: 0; }
.cf-builder-sidebar { position: sticky; top: 80px; }
.cf-add-field-card .form-group { margin-bottom: 0.75rem; }

/* Field row */
.cf-field-row {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.625rem 0.75rem;
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 6px;
    background: var(--surface, #fff);
    margin-bottom: 0.5rem;
    transition: box-shadow 0.15s;
}
.cf-field-row:hover { box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.cf-sortable-ghost { opacity: .4; background: var(--primary-alpha, #eff6ff); }

.cf-field-drag-handle {
    color: var(--text-muted, #9ca3af);
    cursor: grab;
    padding: 0.25rem;
    flex-shrink: 0;
    line-height: 0;
}
.cf-field-drag-handle:active { cursor: grabbing; }

.cf-field-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 0.125rem;
}
.cf-field-label {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary, #111827);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.cf-field-meta {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
}
.cf-field-actions {
    display: flex;
    gap: 0.25rem;
    flex-shrink: 0;
}
.cf-field-actions .btn { min-width: 32px; min-height: 32px; display: inline-flex; align-items: center; justify-content: center; }
.cf-field-actions .cf-delete-btn:hover { color: var(--danger, #dc2626); background: rgba(220,38,38,.08); }

/* Submission detail */
.cf-detail-list {
    display: flex;
    flex-direction: column;
    gap: 0;
}
.cf-detail-item {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 0.5rem;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-color, #e5e7eb);
}
.cf-detail-item:last-child { border-bottom: none; }
.cf-detail-item dt {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-secondary, #374151);
    padding-top: 0.125rem;
}
.cf-detail-item dd {
    font-size: 0.875rem;
    color: var(--text-primary, #111827);
    margin: 0;
    word-break: break-word;
}
.cf-detail-text {
    font-family: inherit;
    font-size: 0.875rem;
    white-space: pre-wrap;
    margin: 0;
    background: var(--surface-alt, #f9fafb);
    padding: 0.625rem 0.75rem;
    border-radius: 6px;
    border: 1px solid var(--border-color, #e5e7eb);
}

/* Row-unread highlight */
tr.row-unread td { background: var(--primary-alpha, #eff6ff); }

/* Badge variants */
.badge-required {
    display: inline-block;
    font-size: 0.6875rem;
    font-weight: 600;
    background: #fef3c7;
    color: #92400e;
    padding: 0.0625rem 0.375rem;
    border-radius: 4px;
}
.nav-badge--info {
    background: var(--primary, #3b82f6);
    color: #fff;
}

@media (max-width: 900px) {
    .cf-builder-layout { grid-template-columns: 1fr; }
    .cf-builder-sidebar { position: static; }
    .cf-detail-item { grid-template-columns: 120px 1fr; }
}

