:root {
    --font-display: "Sora", "Segoe UI", sans-serif;
    --font-body: "Manrope", "Segoe UI", sans-serif;
    --sidebar-bg: linear-gradient(180deg, #09111f 0%, #0f1729 46%, #121d34 100%);
    --sidebar-border: rgba(148, 163, 184, 0.18);
    --sidebar-text: #d7dfef;
    --sidebar-muted: #8ea1c3;
    --sidebar-strong-text: #ffffff;
    --sidebar-highlight-text: #ffffff;
    --sidebar-hover: rgba(255, 255, 255, 0.06);
    --sidebar-active: linear-gradient(135deg, rgba(214, 31, 38, 0.2), rgba(246, 90, 60, 0.22));
    --sidebar-active-border: rgba(248, 113, 113, 0.32);
    --danger: #d61f26;
    --danger-dark: #a91217;
    --primary: #2563eb;
    --success: #0f9d74;
    --warning: #f59e0b;
    --ink: #122033;
    --muted: #66758d;
    --panel-bg: rgba(255, 255, 255, 0.84);
    --panel-soft: #f7f9fc;
    --panel-border: rgba(148, 163, 184, 0.18);
    --page-bg:
        radial-gradient(circle at top left, rgba(214, 31, 38, 0.1), transparent 26%),
        radial-gradient(circle at bottom right, rgba(37, 99, 235, 0.09), transparent 20%),
        linear-gradient(180deg, #eef3f9 0%, #f7f9fc 100%);
    --login-bg:
        radial-gradient(circle at top left, rgba(214, 31, 38, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(59, 130, 246, 0.14), transparent 24%),
        linear-gradient(135deg, #07080b 0%, #0f1218 55%, #161a22 100%);
    --login-card-bg: linear-gradient(180deg, rgba(15, 19, 25, 0.96), rgba(24, 28, 36, 0.98));
    --login-card-border: rgba(255, 255, 255, 0.08);
    --login-card-shadow: 0 30px 70px rgba(0, 0, 0, 0.38);
    --login-text: #ffffff;
    --login-input-bg: rgba(15, 19, 25, 0.95);
    --login-input-border: rgba(71, 85, 105, 0.76);
    --shadow-soft: 0 16px 40px rgba(15, 23, 42, 0.08);
    --shadow-card: 0 24px 48px rgba(15, 23, 42, 0.1);
    --radius-xl: 28px;
    --radius-lg: 22px;
    --radius-md: 18px;
    --radius-sm: 14px;
}

body.theme-light {
    --sidebar-bg: linear-gradient(180deg, #f8fbff 0%, #edf4fb 56%, #e7eef7 100%);
    --sidebar-border: rgba(148, 163, 184, 0.25);
    --sidebar-text: #16324f;
    --sidebar-muted: #5f7591;
    --sidebar-strong-text: #16324f;
    --sidebar-highlight-text: #16324f;
    --sidebar-hover: rgba(37, 99, 235, 0.06);
    --sidebar-active: linear-gradient(135deg, rgba(37, 99, 235, 0.12), rgba(14, 165, 233, 0.14));
    --sidebar-active-border: rgba(37, 99, 235, 0.26);
    --danger: #2563eb;
    --danger-dark: #1d4ed8;
    --primary: #0f766e;
    --ink: #16324f;
    --muted: #60758e;
    --panel-bg: rgba(255, 255, 255, 0.92);
    --panel-soft: #f8fbff;
    --panel-border: rgba(148, 163, 184, 0.2);
    --page-bg:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.08), transparent 26%),
        radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.08), transparent 20%),
        linear-gradient(180deg, #f6f9fc 0%, #eef4fa 100%);
    --login-bg:
        radial-gradient(circle at top left, rgba(37, 99, 235, 0.12), transparent 28%),
        radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.1), transparent 24%),
        linear-gradient(135deg, #eff6ff 0%, #f8fafc 55%, #e2e8f0 100%);
    --login-card-bg: linear-gradient(180deg, rgba(255, 255, 255, 0.97), rgba(241, 245, 249, 0.98));
    --login-card-border: rgba(148, 163, 184, 0.22);
    --login-card-shadow: 0 30px 70px rgba(30, 41, 59, 0.12);
    --login-text: #0f172a;
    --login-input-bg: rgba(255, 255, 255, 0.96);
    --login-input-border: rgba(148, 163, 184, 0.5);
}

body.theme-ocean {
    --sidebar-bg: linear-gradient(180deg, #08131d 0%, #0f2432 50%, #143244 100%);
    --sidebar-text: #d7f3ff;
    --sidebar-muted: #88afc0;
    --sidebar-active: linear-gradient(135deg, rgba(14, 165, 233, 0.2), rgba(20, 184, 166, 0.2));
    --sidebar-active-border: rgba(103, 232, 249, 0.26);
    --danger: #0ea5e9;
    --danger-dark: #0284c7;
    --primary: #14b8a6;
    --page-bg:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.1), transparent 26%),
        radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.09), transparent 20%),
        linear-gradient(180deg, #edf8fb 0%, #f5fbff 100%);
    --login-bg:
        radial-gradient(circle at top left, rgba(14, 165, 233, 0.2), transparent 28%),
        radial-gradient(circle at bottom right, rgba(20, 184, 166, 0.16), transparent 24%),
        linear-gradient(135deg, #07141c 0%, #0d2430 55%, #123140 100%);
}

body.theme-slate {
    --sidebar-bg: linear-gradient(180deg, #1e293b 0%, #334155 46%, #475569 100%);
    --sidebar-text: #e2e8f0;
    --sidebar-muted: #b6c2cf;
    --sidebar-active: linear-gradient(135deg, rgba(148, 163, 184, 0.18), rgba(51, 65, 85, 0.24));
    --sidebar-active-border: rgba(226, 232, 240, 0.22);
    --danger: #475569;
    --danger-dark: #334155;
    --primary: #0284c7;
    --page-bg:
        radial-gradient(circle at top left, rgba(71, 85, 105, 0.08), transparent 26%),
        radial-gradient(circle at bottom right, rgba(2, 132, 199, 0.08), transparent 20%),
        linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
    --login-bg:
        radial-gradient(circle at top left, rgba(71, 85, 105, 0.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(2, 132, 199, 0.14), transparent 24%),
        linear-gradient(135deg, #0f172a 0%, #1e293b 55%, #334155 100%);
}

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

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    font-family: var(--font-body);
    color: var(--ink);
    overflow-x: hidden;
    overflow-y: hidden;
}

.app-shell {
    background: var(--page-bg);
}

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

.admin-overlay {
    display: none;
    border: 0;
    padding: 0;
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(6px);
}

.admin-sidebar {
    width: 292px;
    min-width: 292px;
    display: flex;
    flex-direction: column;
    padding: 20px 16px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--sidebar-border);
    box-shadow: 12px 0 40px rgba(2, 6, 23, 0.16);
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    overflow-y: auto;
    z-index: 2;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.admin-sidebar::-webkit-scrollbar {
    width: 0;
    height: 0;
    display: none;
}

.admin-sidebar::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at top, rgba(248, 113, 113, 0.16), transparent 24%),
        radial-gradient(circle at bottom, rgba(59, 130, 246, 0.12), transparent 22%);
    pointer-events: none;
}

.admin-sidebar > * {
    position: relative;
    z-index: 1;
}

.admin-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 8px 10px 22px;
}

.sidebar-close,
.sidebar-toggle {
    display: none;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 16px;
    transition: transform 0.2s ease, background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.sidebar-close {
    margin-left: auto;
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
}

.sidebar-toggle {
    background: rgba(255, 255, 255, 0.76);
    color: var(--ink);
    box-shadow: var(--shadow-soft);
}

.sidebar-close:hover,
.sidebar-toggle:hover,
.sidebar-close:focus-visible,
.sidebar-toggle:focus-visible {
    transform: translateY(-1px);
}

.admin-brand img {
    width: 56px;
    height: 56px;
    object-fit: contain;
    background: rgba(255, 255, 255, 0.96);
    border-radius: 18px;
    padding: 8px;
    box-shadow: 0 16px 30px rgba(0, 0, 0, 0.2);
}

.admin-brand-text strong,
.panel-title,
.panel-subtitle,
.page-title,
.section-title,
.metric-value {
    font-family: var(--font-display);
}

.admin-brand-text strong {
    display: block;
    color: var(--sidebar-strong-text);
    font-size: 1.5rem;
    letter-spacing: -0.03em;
}

.admin-brand-text span {
    display: block;
    margin-top: 4px;
    color: var(--sidebar-muted);
    font-size: 0.92rem;
}

.sidebar-section-title {
    margin: 8px 10px 14px;
    color: var(--sidebar-muted);
    text-transform: uppercase;
    letter-spacing: 0.14em;
    font-size: 0.73rem;
    font-weight: 800;
}

.sidebar-nav {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sidebar-nav li + li {
    margin-top: 8px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    color: var(--sidebar-text);
    text-decoration: none;
    border-radius: 18px;
    border: 1px solid transparent;
    font-weight: 700;
    transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.sidebar-nav a:hover {
    color: var(--sidebar-highlight-text);
    background: var(--sidebar-hover);
    transform: translateX(2px);
}

.sidebar-nav a.active {
    color: var(--sidebar-highlight-text);
    background: var(--sidebar-active);
    border-color: var(--sidebar-active-border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.sidebar-nav a i {
    width: 22px;
    text-align: center;
    font-size: 1.1rem;
}

.sidebar-user {
    margin-top: auto;
    padding: 18px 12px 8px;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.sidebar-user .btn {
    min-height: 44px;
}

.sidebar-user-name {
    color: var(--sidebar-strong-text);
    font-weight: 800;
}

.sidebar-user-role {
    color: var(--sidebar-muted);
    margin: 4px 0 16px;
}

.admin-main {
    min-width: 0;
    flex: 1;
    display: flex;
    flex-direction: column;
    margin-left: 292px;
    height: 100vh;
}

.admin-topbar {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    padding: 26px 30px 18px;
}

.admin-topbar-primary {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    min-width: 0;
}

.page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.7);
    border: 1px solid rgba(148, 163, 184, 0.18);
    color: var(--muted);
    font-size: 0.83rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.page-title {
    margin: 10px 0 4px;
    font-size: clamp(1.8rem, 3vw, 2.35rem);
    line-height: 1.05;
    letter-spacing: -0.04em;
}

.page-subtitle {
    margin: 0;
    max-width: 720px;
    color: var(--muted);
    font-size: 0.98rem;
    line-height: 1.45;
}

.page-user-chip {
    align-self: flex-start;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow: var(--shadow-soft);
}

.page-user-chip strong {
    display: block;
    font-size: 0.95rem;
}

.page-user-chip span {
    display: block;
    color: var(--muted);
    font-size: 0.86rem;
}

.page-user-avatar {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--danger), #fb923c);
    font-weight: 800;
    overflow: hidden;
}

.page-user-avatar img,
.user-photo-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.admin-content {
    flex: 1;
    padding: 0 30px 30px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.panel-card {
    background: var(--panel-bg);
    backdrop-filter: blur(18px);
    border: 1px solid var(--panel-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-card);
}

.panel-card .card-body {
    padding: 28px;
}

.panel-soft {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(247, 249, 252, 0.92));
}

.panel-muted {
    background: var(--panel-soft);
    border: 1px solid rgba(203, 213, 225, 0.7);
    border-radius: var(--radius-lg);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    flex-wrap: wrap;
}

.panel-title {
    margin: 0;
    font-size: 1.35rem;
    letter-spacing: -0.03em;
}

.panel-subtitle {
    margin: 6px 0 0;
    color: var(--muted);
    font-size: 0.98rem;
}

.panel-section {
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(203, 213, 225, 0.8);
    background: rgba(255, 255, 255, 0.9);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.panel-section.panel-section-soft {
    background: linear-gradient(180deg, #f8fafc 0%, #f1f5f9 100%);
}

.section-title {
    margin: 0;
    font-size: 1.12rem;
}

.section-description {
    margin: 8px 0 0;
    color: var(--muted);
    font-size: 0.94rem;
}

.toolbar-actions,
.page-actions,
.table-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.table-actions .btn,
.table-actions form {
    flex: 0 0 auto;
}

.table-actions .btn {
    min-width: 116px;
    min-height: 40px;
    padding: 0.55rem 0.9rem;
    white-space: nowrap;
}

.table-actions form .btn {
    width: 116px;
}

.table-actions.table-actions-uniform .btn,
.table-actions.table-actions-uniform form .btn {
    width: 116px;
    height: 40px;
    min-width: 116px;
    min-height: 40px;
    padding: 0.5rem 0.8rem;
}

.table-actions.table-actions-uniform form {
    display: inline-flex;
    margin: 0;
}

.filter-shell {
    padding: 20px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(248, 250, 252, 0.94), rgba(241, 245, 249, 0.94));
    border: 1px solid rgba(203, 213, 225, 0.76);
}

.btn {
    --btn-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
    border-radius: 16px;
    font-weight: 800;
    letter-spacing: -0.01em;
    min-height: 46px;
    padding: 0.72rem 1.15rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    line-height: 1.1;
    transition: transform 0.22s ease, box-shadow 0.22s ease, background-color 0.22s ease, border-color 0.22s ease, color 0.22s ease;
}

.btn:hover,
.btn:focus-visible {
    transform: translateY(-2px);
    box-shadow: var(--btn-shadow);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    line-height: 1;
}

.btn-sm {
    min-height: 38px;
    border-radius: 12px;
    padding: 0.5rem 0.8rem;
    font-size: 0.84rem;
}

.btn-danger {
    background: linear-gradient(135deg, var(--danger), #ef4444);
    border-color: transparent;
    --btn-shadow: 0 16px 30px rgba(214, 31, 38, 0.22);
}

.btn-danger:hover,
.btn-danger:focus {
    background: linear-gradient(135deg, var(--danger-dark), #dc2626);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), #1d4ed8);
    border-color: transparent;
    --btn-shadow: 0 16px 30px rgba(37, 99, 235, 0.24);
}

.btn-dark {
    --btn-shadow: 0 16px 30px rgba(15, 23, 42, 0.2);
}

.btn-outline-secondary,
.btn-outline-warning,
.btn-outline-danger,
.btn-outline-info,
.btn-outline-primary,
.btn-outline-dark,
.btn-outline-light {
    background: rgba(255, 255, 255, 0.88);
}

.btn-outline-light {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.2);
    --btn-shadow: 0 16px 28px rgba(2, 6, 23, 0.24);
}

.btn-outline-light:hover,
.btn-outline-light:focus-visible {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.32);
}

.btn.w-100 {
    width: 100%;
}

.form-control,
.form-select,
.input-group-text {
    border-radius: 16px;
    border-color: rgba(203, 213, 225, 0.88);
    min-height: 48px;
}

.input-group > .form-control,
.input-group > .form-select {
    min-height: 48px;
}

.input-group-text {
    background: #fff;
    color: var(--muted);
}

.form-control:focus,
.form-select:focus {
    border-color: rgba(59, 130, 246, 0.38);
    box-shadow: 0 0 0 0.24rem rgba(37, 99, 235, 0.12);
}

.table-shell {
    overflow: hidden;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(203, 213, 225, 0.76);
    background: rgba(255, 255, 255, 0.8);
}

.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: thin;
    scrollbar-color: rgba(148, 163, 184, 0.7) transparent;
}

.table-responsive::-webkit-scrollbar {
    height: 10px;
}

.table-responsive::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(148, 163, 184, 0.65);
}

.table {
    margin-bottom: 0;
}

.table > :not(caption) > * > * {
    padding: 1rem 0.9rem;
    vertical-align: middle;
    border-bottom-color: rgba(226, 232, 240, 0.92);
}

.table thead th {
    background: #eff4fb;
    color: #41536d;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom-width: 1px;
}

.table tbody tr:hover {
    background: rgba(248, 250, 252, 0.92);
}

.badge-soft {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.56rem 0.85rem;
    border-radius: 999px;
    font-weight: 800;
    font-size: 0.78rem;
    border: 1px solid transparent;
}

.badge-soft.badge-success {
    color: #0f766e;
    background: rgba(20, 184, 166, 0.14);
    border-color: rgba(20, 184, 166, 0.2);
}

.badge-soft.badge-danger {
    color: #b91c1c;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.2);
}

.badge-soft.badge-warning {
    color: #b45309;
    background: rgba(245, 158, 11, 0.12);
    border-color: rgba(245, 158, 11, 0.2);
}

.badge-soft.badge-info {
    color: #1d4ed8;
    background: rgba(59, 130, 246, 0.12);
    border-color: rgba(59, 130, 246, 0.2);
}

.badge-soft.badge-secondary {
    color: #475569;
    background: rgba(148, 163, 184, 0.12);
    border-color: rgba(148, 163, 184, 0.2);
}

.badge-soft.badge-purple {
    color: #7c3aed;
    background: rgba(139, 92, 246, 0.12);
    border-color: rgba(139, 92, 246, 0.2);
}

.badge-soft.badge-gold {
    color: #7a5800;
    background: linear-gradient(135deg, rgba(255, 215, 64, 0.26), rgba(245, 158, 11, 0.2));
    border-color: rgba(245, 158, 11, 0.34);
    box-shadow: inset 0 1px 0 rgba(255, 248, 196, 0.75);
}

.empty-state {
    padding: 32px 24px;
    text-align: center;
    color: var(--muted);
}

.empty-state-icon {
    width: 74px;
    height: 74px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(214, 31, 38, 0.08), rgba(37, 99, 235, 0.12));
    color: var(--danger);
    font-size: 1.8rem;
}

.metric-card {
    height: 100%;
    padding: 22px;
    border-radius: var(--radius-lg);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(248, 250, 252, 0.96));
    border: 1px solid rgba(203, 213, 225, 0.72);
    box-shadow: var(--shadow-soft);
}

.metric-card-fill {
    border-color: transparent;
    color: #fff;
}

.metric-card-fill .metric-label,
.metric-card-fill .metric-value,
.metric-card-fill .metric-helper {
    color: #fff;
}

.metric-card-fill .metric-helper {
    opacity: 0.86;
}

.metric-card-fill .metric-icon {
    background: transparent !important;
    box-shadow: none;
}

.metric-card-fill-primary {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
}

.metric-card-fill-success {
    background: linear-gradient(135deg, #059669, #14b8a6);
}

.metric-card-fill-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.metric-card-fill-danger {
    background: linear-gradient(135deg, var(--danger), #fb7185);
}

.metric-card-fill-info {
    background: linear-gradient(135deg, #0891b2, #22d3ee);
}

.metric-card-fill-secondary {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.metric-label {
    color: var(--muted);
    font-weight: 700;
}

.metric-value {
    margin: 4px 0 0;
    font-size: 2rem;
    letter-spacing: -0.05em;
}

.metric-helper {
    color: var(--muted);
}

.metric-icon {
    width: 56px;
    height: 56px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 18px;
    color: #fff;
    font-size: 1.4rem;
}

.metric-icon.bg-primary {
    background: linear-gradient(135deg, var(--primary), #3b82f6);
}

.metric-icon.bg-success {
    background: linear-gradient(135deg, #059669, #14b8a6);
}

.metric-icon.bg-warning {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.metric-icon.bg-danger {
    background: linear-gradient(135deg, var(--danger), #fb7185);
}

.metric-icon.bg-info {
    background: linear-gradient(135deg, #0891b2, #22d3ee);
}

.metric-icon.bg-secondary {
    background: linear-gradient(135deg, #6b7280, #9ca3af);
}

.dashboard-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.dashboard-nav-link {
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 0.72rem 1rem;
    border-radius: 16px;
    border: 1px solid rgba(203, 213, 225, 0.76);
    background: rgba(255, 255, 255, 0.84);
    color: #42526a;
    text-decoration: none;
    font-weight: 800;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.06);
    transition: transform 0.2s ease, border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.dashboard-nav-link:hover,
.dashboard-nav-link.active {
    transform: translateY(-2px);
    color: #fff;
    border-color: transparent;
    background: linear-gradient(135deg, var(--danger), #ef4444);
}

.insight-card {
    height: 100%;
    display: flex;
    gap: 14px;
    padding: 18px;
    border-radius: 18px;
    border: 1px solid rgba(203, 213, 225, 0.76);
    background: rgba(248, 250, 252, 0.84);
}

.insight-card strong {
    display: block;
    margin-bottom: 6px;
    font-family: var(--font-display);
}

.insight-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.insight-icon {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 16px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #38bdf8);
}

.insight-success .insight-icon {
    background: linear-gradient(135deg, #059669, #14b8a6);
}

.insight-warning .insight-icon {
    background: linear-gradient(135deg, #d97706, #f59e0b);
}

.insight-danger .insight-icon {
    background: linear-gradient(135deg, var(--danger), #fb7185);
}

.insight-secondary .insight-icon {
    background: linear-gradient(135deg, #475569, #64748b);
}

.attention-list,
.compact-list,
.quick-action-grid {
    display: grid;
    gap: 12px;
}

.attention-item,
.compact-list-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.attention-item:last-child,
.compact-list-item:last-child {
    border-bottom: 0;
}

.attention-item span,
.compact-list-item span {
    color: var(--muted);
    font-size: 0.9rem;
}

.attention-item strong {
    font-family: var(--font-display);
    font-size: 1.45rem;
}

.compact-list-item strong {
    display: block;
    margin-bottom: 3px;
}

.dashboard-bar-row + .dashboard-bar-row {
    margin-top: 16px;
}

.dashboard-bar-row span {
    color: #42526a;
    font-weight: 700;
}

.dashboard-bar {
    height: 10px;
    margin-top: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(226, 232, 240, 0.9);
}

.dashboard-bar span {
    display: block;
    height: 100%;
    border-radius: inherit;
    background: linear-gradient(135deg, var(--danger), var(--primary));
}

.dashboard-section-card {
    height: 100%;
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(203, 213, 225, 0.72);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 249, 252, 0.96));
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.dashboard-section-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 48px rgba(15, 23, 42, 0.14);
}

.dashboard-section-card h3 {
    margin: 0 0 8px;
    font-family: var(--font-display);
    font-size: 1.08rem;
}

.dashboard-section-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
}

.quick-action {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    border-radius: 18px;
    border: 1px solid rgba(203, 213, 225, 0.76);
    color: #24364d;
    background: rgba(248, 250, 252, 0.88);
    text-decoration: none;
    font-weight: 800;
}

.quick-action i {
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    color: #fff;
    background: linear-gradient(135deg, var(--primary), #38bdf8);
}

.config-link {
    text-decoration: none;
    color: inherit;
}

.config-card {
    height: 100%;
    padding: 24px;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(203, 213, 225, 0.72);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 249, 252, 0.96));
    box-shadow: var(--shadow-soft);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.config-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 28px 48px rgba(15, 23, 42, 0.14);
    border-color: rgba(248, 113, 113, 0.24);
}

.config-icon {
    width: 64px;
    height: 64px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    border-radius: 20px;
    color: #fff;
    font-size: 1.6rem;
}

.nav-pills .nav-link {
    border-radius: 999px;
    padding: 0.85rem 1.2rem;
    border: 1px solid rgba(203, 213, 225, 0.72);
    color: #42526a;
    font-weight: 800;
    background: rgba(255, 255, 255, 0.8);
}

.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background: linear-gradient(135deg, var(--danger), #ef4444);
    border-color: transparent;
    color: #fff;
    box-shadow: 0 12px 24px rgba(214, 31, 38, 0.14);
}

.log-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    align-items: end;
    padding: 1rem 1.1rem;
    border: 1px solid rgba(203, 213, 225, 0.72);
    border-radius: 20px;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.92), rgba(247, 249, 252, 0.96));
}

.log-toolbar > div {
    min-width: 220px;
    flex: 1 1 220px;
}

.log-toolbar-actions {
    display: flex;
    gap: 0.75rem;
    justify-content: flex-end;
    flex: 0 0 auto !important;
    min-width: auto !important;
}

.log-field-list {
    max-width: 280px;
    color: #475569;
    font-size: 0.92rem;
    white-space: normal;
}

.log-details {
    min-width: 260px;
}

.log-details summary {
    cursor: pointer;
    color: #1d4ed8;
    font-weight: 700;
    list-style: none;
}

.log-details summary::-webkit-details-marker {
    display: none;
}

.log-detail-block {
    margin-top: 0.8rem;
}

.log-detail-block strong {
    display: block;
    margin-bottom: 0.45rem;
    color: #0f172a;
}

.log-detail-block pre {
    margin: 0;
    padding: 0.9rem;
    border-radius: 16px;
    background: #0f172a;
    color: #e2e8f0;
    font-size: 0.78rem;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.alert {
    border: 0;
    border-radius: 18px;
    box-shadow: var(--shadow-soft);
}

.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--login-bg);
}

.login-card {
    width: 100%;
    max-width: 540px;
    padding: 34px;
    border-radius: 28px;
    background: var(--login-card-bg);
    border: 1px solid var(--login-card-border);
    box-shadow: var(--login-card-shadow);
}

.access-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 22px;
    color: var(--login-text);
    font-weight: 700;
}

.logo-wrap {
    text-align: center;
    margin-bottom: 28px;
}

.login-logo {
    width: 184px;
    max-width: 100%;
    border-radius: 12px;
}

.login-card .form-label,
.login-card .form-check-label {
    color: var(--login-text);
}

.field-wrap {
    position: relative;
}

.field-input {
    width: 100%;
    min-height: 56px;
    padding: 0 54px 0 46px;
    border-radius: 16px;
    border: 1px solid var(--login-input-border);
    background: var(--login-input-bg);
    color: var(--login-text);
}

.field-input:-webkit-autofill,
.field-input:-webkit-autofill:hover,
.field-input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--login-text);
    box-shadow: 0 0 0 1000px var(--login-input-bg) inset;
    transition: background-color 9999s ease-in-out 0s;
}

.field-input:focus {
    outline: none;
    border-color: rgba(248, 113, 113, 0.46);
    box-shadow: 0 0 0 0.24rem rgba(214, 31, 38, 0.12);
}

.field-input::placeholder {
    color: color-mix(in srgb, var(--login-text) 52%, transparent);
}

.theme-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem;
}

.theme-card {
    display: block;
    padding: 1rem;
    border: 1px solid rgba(148, 163, 184, 0.22);
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.82);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.theme-card:hover,
.theme-card.selected {
    transform: translateY(-2px);
    box-shadow: var(--shadow-soft);
    border-color: rgba(37, 99, 235, 0.28);
}

.theme-radio {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.theme-preview {
    display: grid;
    grid-template-columns: 1.35fr 1fr 0.8fr;
    gap: 0.6rem;
    padding: 0.75rem;
    min-height: 84px;
    border-radius: 16px;
    margin-bottom: 0.85rem;
}

.theme-preview span {
    min-height: 100%;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.34);
}

.theme-card strong {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--ink);
}

.theme-card p {
    margin: 0;
    color: var(--muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.brand-preview-shell,
.company-summary {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    padding: 1.15rem;
    border-radius: 18px;
    background: var(--panel-soft);
    border: 1px solid var(--panel-border);
}

.brand-preview-logo {
    max-width: 180px;
    max-height: 90px;
    object-fit: contain;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.94);
    padding: 0.65rem;
}

.company-summary strong {
    color: var(--ink);
    font-size: 1.08rem;
}

.company-summary span,
.brand-preview-shell span {
    color: var(--muted);
}

.field-icon,
.field-toggle {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #cbd5e1;
}

.field-icon {
    left: 16px;
}

.field-toggle {
    right: 16px;
    background: transparent;
    border: 0;
}

.btn-login {
    width: 100%;
    min-height: 54px;
    border: 0;
    border-radius: 999px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--danger), #ef4444);
    box-shadow: 0 16px 28px rgba(214, 31, 38, 0.2);
}

.btn-login-wrap {
    margin-top: 28px;
}

.login-footer {
    margin-top: 24px;
    text-align: center;
    color: #94a3b8;
    font-size: 0.88rem;
}

@media (max-width: 1199.98px) {
    body {
        overflow-y: auto;
    }

    .admin-sidebar {
        width: min(340px, calc(100vw - 24px));
        min-width: 0;
        left: 12px;
        top: 12px;
        height: calc(100vh - 24px);
        border-radius: 26px;
        transform: translateX(calc(-100% - 18px));
        transition: transform 0.26s ease;
        z-index: 1045;
    }

    body.sidebar-open {
        overflow: hidden;
    }

    body.sidebar-open .admin-sidebar {
        transform: translateX(0);
    }

    .admin-overlay {
        position: fixed;
        inset: 0;
        z-index: 1040;
    }

    body.sidebar-open .admin-overlay {
        display: block;
    }

    .admin-topbar,
    .admin-content {
        padding-inline: 24px;
    }

    .admin-main {
        margin-left: 0;
        min-height: 100vh;
        height: auto;
    }

    .admin-topbar {
        position: sticky;
        top: 0;
        z-index: 1030;
        gap: 16px;
        padding-top: 16px;
        padding-bottom: 12px;
        backdrop-filter: blur(18px);
        background: linear-gradient(180deg, rgba(238, 243, 249, 0.94), rgba(238, 243, 249, 0.78) 72%, rgba(238, 243, 249, 0));
    }

    body.theme-light .admin-topbar {
        background: linear-gradient(180deg, rgba(246, 249, 252, 0.96), rgba(246, 249, 252, 0.8) 72%, rgba(246, 249, 252, 0));
    }

    .sidebar-toggle,
    .sidebar-close {
        display: inline-flex;
    }

    .sidebar-close {
        align-self: flex-start;
    }

    .page-title {
        font-size: clamp(1.55rem, 3.5vw, 2rem);
    }

    .page-subtitle {
        max-width: 100%;
        font-size: 0.94rem;
    }

    .table-actions {
        width: 100%;
    }

    .table-actions .btn,
    .table-actions form,
    .table-actions form .btn {
        width: 100%;
    }

    .table-actions.table-actions-uniform .btn,
    .table-actions.table-actions-uniform form .btn {
        width: 100%;
        min-width: 0;
    }

    .pagination {
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .admin-topbar,
    .admin-content {
        padding-inline: 16px;
    }

    .panel-card .card-body,
    .panel-section,
    .filter-shell {
        padding: 20px;
    }

    .admin-topbar {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }

    .admin-topbar-primary {
        width: 100%;
        align-items: flex-start;
        gap: 12px;
    }

    .admin-brand {
        align-items: flex-start;
        padding-right: 0;
    }

    .sidebar-toggle {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
        border-radius: 14px;
    }

    .page-eyebrow {
        gap: 6px;
        padding: 7px 10px;
        font-size: 0.72rem;
        letter-spacing: 0.06em;
    }

    .page-title {
        margin-top: 8px;
        font-size: clamp(1.25rem, 7vw, 1.9rem);
        line-height: 1.08;
    }

    .page-subtitle {
        font-size: 0.88rem;
        line-height: 1.4;
    }

    .page-user-chip {
        width: 100%;
        justify-content: flex-start;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 16px;
    }

    .page-user-chip strong {
        font-size: 0.9rem;
        line-height: 1.1;
    }

    .page-user-chip span {
        font-size: 0.8rem;
        line-height: 1.2;
    }

    .page-user-avatar {
        width: 38px;
        height: 38px;
        border-radius: 12px;
    }

    .page-actions,
    .toolbar-actions {
        width: 100%;
    }

    .page-actions > *,
    .toolbar-actions > * {
        width: 100%;
    }

    .page-actions .btn,
    .toolbar-actions .btn,
    .filter-shell .btn {
        width: 100%;
    }

    .filter-shell .row > [class*="col-"] {
        width: 100%;
    }

    .table-shell {
        border-radius: 20px;
    }

    .table > :not(caption) > * > * {
        padding: 0.85rem 0.75rem;
    }

    .table-actions {
        flex-direction: column;
        align-items: stretch;
    }

    .table-actions .btn {
        min-width: 0;
    }

    .dashboard-nav-link,
    .quick-action {
        width: 100%;
        justify-content: flex-start;
    }

    .attention-item,
    .compact-list-item {
        align-items: flex-start;
        flex-direction: column;
    }

    .log-toolbar-actions {
        width: 100%;
        justify-content: stretch;
    }

    .log-toolbar-actions > * {
        flex: 1 1 100%;
    }

    .admin-content .mt-4.d-flex.gap-2,
    .admin-content .d-flex.gap-2.mt-4,
    .admin-content .d-flex.justify-content-end.gap-2.mt-4 {
        flex-direction: column;
    }

    .admin-content .mt-4.d-flex.gap-2 > *,
    .admin-content .d-flex.gap-2.mt-4 > *,
    .admin-content .d-flex.justify-content-end.gap-2.mt-4 > * {
        width: 100%;
    }

    .login-card {
        padding: 24px 18px;
        border-radius: 22px;
    }
}
