/* ITSWEBER CMS – Admin Styles */

:root {
    --admin-primary: #334155;
    --admin-primary-dark: #1e293b;
    --admin-primary-light: #475569;
    --admin-accent: #6366f1;
    --admin-accent-light: #818cf8;
    --admin-accent-bg: #eef2ff;
    --admin-success: #059669;
    --admin-danger: #dc2626;
    --admin-warning: #d97706;
    --admin-sidebar-bg: #0f172a;
    --admin-sidebar-hover: #1e293b;
    --admin-sidebar-active-bg: rgba(99,102,241,0.15);
    --admin-sidebar-active-text: #c7d2fe;
    --admin-sidebar-text: #94a3b8;
    --admin-sidebar-active: #fff;
    --admin-sidebar-width: 260px;
    --admin-topbar-height: 56px;
    --gray-50: #f9fafb;
    --gray-100: #f3f4f6;
    --gray-200: #e5e7eb;
    --gray-300: #d1d5db;
    --gray-400: #9ca3af;
    --gray-500: #6b7280;
    --gray-600: #4b5563;
    --gray-700: #374151;
    --gray-800: #1f2937;
    --gray-900: #111827;
    --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    --font-mono: 'SF Mono', Monaco, Consolas, monospace;
    --radius: 6px;
    --radius-sm: 4px;
    --radius-lg: 8px;
    --shadow-xs: 0 1px 2px rgba(0,0,0,0.04);
    --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 1px 2px rgba(0,0,0,0.03);
    --shadow-md: 0 4px 6px rgba(0,0,0,0.05), 0 2px 4px rgba(0,0,0,0.03);
    --shadow-lg: 0 10px 15px rgba(0,0,0,0.07), 0 4px 6px rgba(0,0,0,0.03);
    --transition: 150ms ease;
}

*, *::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);
    color: var(--admin-sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.2s;
}

.sidebar-header {
    padding: 1.25rem 1.25rem 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}

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

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

.sidebar-brand-logo {
    max-height: 36px;
    width: auto;
    display: block;
    filter: brightness(0) invert(1);
    opacity: 0.9;
}

.sidebar-nav {
    flex: 1;
    padding: 0.75rem 0;
    overflow-y: auto;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5625rem 1.25rem;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
}

.nav-item:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-item.active {
    background: var(--admin-sidebar-active-bg);
    color: var(--admin-sidebar-active-text);
    font-weight: 500;
    border-left: 3px solid var(--admin-accent);
    padding-left: calc(1.25rem - 3px);
}

.nav-icon { font-size: 1rem; width: 1.25rem; text-align: center; }
.nav-divider { height: 1px; background: rgba(255,255,255,0.06); margin: 0.5rem 1.25rem; }

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

/* 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.625rem;
    padding: 0.5625rem 1.25rem;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background 0.15s, color 0.15s;
    cursor: pointer;
    background: none;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
}
.nav-group-toggle:hover { background: rgba(255,255,255,0.05); color: #fff; }
.nav-group-toggle.active {
    background: var(--admin-sidebar-active-bg);
    color: var(--admin-sidebar-active-text);
    font-weight: 500;
    border-left: 3px solid var(--admin-accent);
    padding-left: calc(1.25rem - 3px);
}
.nav-group-chevron {
    margin-left: auto; flex-shrink: 0; transition: transform 0.2s;
    font-size: 0.625rem; opacity: 0.5; display: inline-block;
}
.nav-group-chevron::after { content: '▾'; }
.nav-group.open .nav-group-chevron { transform: rotate(180deg); opacity: 0.7; }

.nav-group-children {
    display: none;
    flex-direction: column;
    background: rgba(0,0,0,0.2);
}
.nav-group.open .nav-group-children { display: flex; }
.nav-group-item {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    padding: 0.5rem 1.25rem 0.5rem 2.75rem;
    color: var(--admin-sidebar-text);
    text-decoration: none;
    font-size: 0.8125rem;
    transition: background 0.15s, color 0.15s;
    opacity: 0.9;
}
.nav-group-item:hover { background: rgba(255,255,255,0.08); color: #fff; opacity: 1; }
.nav-group-item.active { opacity: 1; }

.sidebar-footer {
    padding: 0.75rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.08);
    font-size: 0.75rem;
}

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

.admin-topbar {
    height: var(--admin-topbar-height);
    background: #fff;
    border-bottom: 1px solid var(--gray-200);
    box-shadow: var(--shadow-xs);
    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.25rem; }
.topbar-title { font-weight: 600; font-size: 1.0625rem; color: var(--gray-800); letter-spacing: -0.01em; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 1rem; font-size: 0.8125rem; }
.topbar-link { color: var(--admin-accent); text-decoration: none; font-weight: 500; transition: color var(--transition); }
.topbar-link:hover { color: var(--admin-accent-light); text-decoration: underline; }
.topbar-user { color: var(--gray-600); font-weight: 500; }

.admin-content { padding: 1.5rem; }

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    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;
}
.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.25rem;
    font-weight: 700;
    color: var(--gray-800);
    letter-spacing: -0.015em;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    padding: 0.5625rem 1.125rem;
    font-size: 0.875rem;
    font-weight: 500;
    font-family: var(--font-sans);
    border-radius: var(--radius-sm);
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    gap: 0.375rem;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--admin-primary); color: #fff; }
.btn-primary:hover { background: var(--admin-primary-dark); }
.btn-secondary { background: transparent; color: var(--gray-700); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-100); }
.btn-danger { background: var(--admin-danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning { background: #f59e0b; color: #fff; }
.btn-warning:hover { background: #d97706; }
.btn-sm { padding: 0.25rem 0.625rem; font-size: 0.8125rem; }
.btn-xs { padding: 0.2rem 0.55rem; font-size: 0.775rem; }
.btn-full { width: 100%; justify-content: center; }
.btn-ghost { background: none; border: none; color: var(--admin-accent); padding: 0; }
.btn-ghost:hover { text-decoration: underline; }

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

.data-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
}
.data-table th, .data-table td { padding: 0.75rem 1rem; text-align: left; font-size: 0.875rem; }
.data-table th {
    background: #f8fafc;
    font-weight: 600;
    color: var(--gray-600);
    border-bottom: 2px solid var(--gray-200);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.625rem 1rem;
}
.data-table td { border-bottom: 1px solid var(--gray-100); }
.data-table tbody tr { transition: background var(--transition); }
.data-table tbody tr:hover td { background: #f8fafc; }
.data-table tr:last-child td { border-bottom: none; }
.data-table code { font-family: var(--font-mono); font-size: 0.8125rem; color: var(--gray-600); background: var(--gray-100); padding: 0.125rem 0.375rem; border-radius: 3px; }
.actions { display: flex; gap: 0.5rem; }
.inline-form { display: inline; }

/* Badges */
.badge {
    display: inline-block;
    padding: 0.1875rem 0.5rem;
    font-size: 0.6875rem;
    font-weight: 600;
    border-radius: 4px;
    letter-spacing: 0.02em;
    line-height: 1.4;
}
.badge-primary { background: var(--admin-accent-bg); color: var(--admin-accent); }
.badge-success { background: #ecfdf5; color: var(--admin-success); }
.badge-draft { background: var(--gray-100); color: var(--gray-500); }
.badge-danger { background: #fef2f2; color: var(--admin-danger); }
.badge-warning { background: #fffbeb; color: var(--admin-warning); }
.badge-secondary { background: var(--gray-200); color: var(--gray-600); }
.badge-info { background: #eff6ff; color: #2563eb; }

/* Forms */
.admin-form .form-group { margin-bottom: 1rem; }
.admin-form label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    margin-bottom: 0.25rem;
    color: var(--gray-700);
}
.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 textarea,
.admin-form select {
    width: 100%; padding: 0.5625rem 0.75rem; border: 1px solid var(--gray-300); border-radius: var(--radius-sm); font-size: 0.875rem; font-family: var(--font-sans); background: #fff;
}
.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 textarea:hover,
.admin-form select:hover { border-color: var(--gray-400); }
.admin-form input:focus, .admin-form textarea:focus, .admin-form select:focus {
    outline: none; border-color: var(--admin-primary-light); box-shadow: 0 0 0 3px rgba(51,65,85,0.08);
}
.admin-form textarea { resize: vertical; }

.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);
    padding: 1.125rem;
    margin-bottom: 1rem;
    box-shadow: var(--shadow-xs);
}
.form-card h4 {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: var(--gray-800);
    border-left: 3px solid var(--gray-300);
    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 – neutral, text-based, no colored background */
.dash-welcome {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    padding: 1rem 0 1.25rem 0;
    margin-bottom: 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}
.dash-welcome h2 {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--gray-900);
    letter-spacing: -0.02em;
    margin: 0;
    line-height: 1.3;
}
.dash-welcome-date { font-size: 0.8125rem; color: var(--gray-500); margin-top: 0.15rem; }
.dash-welcome-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }

/* Primary Stat Cards (4 large) */
.dash-stats-primary {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1rem;
}
.dash-stat-card {
    display: flex;
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    box-shadow: var(--shadow-xs);
    transition: all var(--transition);
}
.dash-stat-card:hover { border-color: var(--gray-300); box-shadow: var(--shadow-md); }
.dash-stat-accent { width: 4px; flex-shrink: 0; }
.dash-stat--pages  .dash-stat-accent { background: var(--admin-sidebar-bg); }
.dash-stat--blog   .dash-stat-accent { background: var(--admin-success); }
.dash-stat--gallery .dash-stat-accent { background: #8b5cf6; }
.dash-stat--events  .dash-stat-accent { background: var(--admin-warning); }
.dash-stat-body { padding: 1rem 1.125rem; flex: 1; min-width: 0; }
.dash-stat-number {
    font-size: 2rem;
    font-weight: 800;
    color: var(--gray-900);
    line-height: 1.15;
    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 (3 compact) */
.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.625rem;
    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-num { font-size: 1.25rem; font-weight: 800; color: var(--gray-900); line-height: 1; letter-spacing: -0.02em; }
.dash-stat-mini-label { font-size: 0.8125rem; color: var(--gray-500); font-weight: 500; }

/* Content Grid (two columns on desktop) */
.dash-content-grid {
    display: grid;
    grid-template-columns: 3fr 2fr;
    gap: 1.5rem;
}
.dash-content-col { display: flex; flex-direction: column; gap: 1rem; }

/* Generic Panel */
.dash-panel {
    background: #fff;
    border: 1px solid var(--gray-200);
    border-radius: var(--radius);
    padding: 1.25rem;
    box-shadow: var(--shadow-xs);
    flex: 1;
}
.dash-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    padding-bottom: 0.625rem;
    border-bottom: 1px solid var(--gray-100);
}
.dash-panel-header h3 {
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0;
    color: var(--gray-700);
    text-transform: none;
    letter-spacing: normal;
}
.dash-panel-link { font-size: 0.8125rem; color: var(--admin-accent); text-decoration: none; font-weight: 500; }
.dash-panel-link:hover { text-decoration: underline; }
.dash-panel-empty { font-size: 0.875rem; color: var(--gray-400); margin: 0; }

/* Generic Dash List (recent posts, recent pages) */
.dash-list { list-style: none; margin: 0; padding: 0; }
.dash-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--gray-100);
    gap: 0.75rem;
}
.dash-list-item:last-child { border-bottom: none; padding-bottom: 0; }
.dash-list-title {
    font-size: 0.875rem;
    color: var(--gray-800);
    text-decoration: none;
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-weight: 500;
}
.dash-list-title:hover { color: var(--admin-accent); }
.dash-list-meta { display: flex; align-items: center; gap: 0.5rem; flex-shrink: 0; }
.dash-list-date { font-size: 0.6875rem; color: var(--gray-400); font-variant-numeric: tabular-nums; }

/* Upcoming Events Widget */
.dash-events-list { list-style: none; margin: 0; padding: 0; }
.dash-event-item {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    padding: 0.625rem 0;
    border-bottom: 1px solid var(--gray-100);
}
.dash-event-item:last-child { border-bottom: none; padding-bottom: 0; }
.dash-event-date-block {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    flex-shrink: 0;
    background: var(--admin-sidebar-bg);
    border-radius: var(--radius-sm);
    line-height: 1;
    color: #fff;
}
.dash-event-day { font-size: 1rem; font-weight: 700; color: #fff; }
.dash-event-month { font-size: 0.5625rem; font-weight: 600; color: var(--admin-sidebar-text); text-transform: uppercase; letter-spacing: 0.04em; }
.dash-event-info { flex: 1; min-width: 0; }
.dash-event-title {
    display: block;
    font-size: 0.875rem;
    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-500); }

/* System Info Panel */
.dash-system-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin: 0; }
.dash-system-item { display: flex; flex-direction: column; gap: 0.15rem; }
.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.875rem; color: var(--gray-800); margin: 0; }
.dash-system-link { color: var(--admin-accent); text-decoration: none; font-weight: 500; }
.dash-system-link:hover { text-decoration: underline; }

/* Settings Form */
.settings-section { margin-bottom: 2rem; }
.settings-section h3 { font-size: 0.9375rem; font-weight: 700; margin-bottom: 1rem; padding-bottom: 0.5rem; border-bottom: 1px solid var(--gray-200); color: var(--gray-800); }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--gray-50); }
.login-container { width: 100%; max-width: 400px; padding: 2rem; }
.login-header { text-align: center; margin-bottom: 2rem; }
.login-logo { font-size: 1.5rem; font-weight: 700; letter-spacing: -0.025em; }
.login-logo span { color: var(--admin-accent); }
.login-form { background: #fff; padding: 2rem; border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.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-primary-light); box-shadow: 0 0 0 3px rgba(51,65,85,0.08); }

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--gray-500); }
.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-primary-light); }

/* ── 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);
    padding: 0.75rem 1rem;
}
.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-primary-light); box-shadow: 0 0 0 3px rgba(51,65,85,0.08); }
.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; }

.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); }

/* 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: 48px;
    width: auto;
    margin: 0 auto;
    display: block;
}

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

/* ── 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 ─────────────────────────────────────────────── */
