@import url('/css/fonts.css');
/* ---- Page loading bar ---- */
#pageLoader {
    position: fixed; top: 0; left: 0; width: 0; height: 2px; z-index: 99999;
    background: var(--accent, #fff);
    transition: none;
    pointer-events: none;
}
#pageLoader.loading {
    width: 85%;
    transition: width 8s cubic-bezier(0.1, 0.5, 0.3, 1);
}
#pageLoader.done {
    width: 100%;
    transition: width 0.15s ease;
    opacity: 0;
    transition: width 0.15s ease, opacity 0.3s ease 0.15s;
}

/* ---- Page transitions ---- */
.page-content {
    animation: pageIn 0.12s ease both;
}
@keyframes pageIn {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}
body.page-leaving .main-content {
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.12s ease, transform 0.12s ease;
}
body.page-leaving .sidebar {
    pointer-events: none;
}
body.page-leaving .sidebar .nav-link {
    pointer-events: none;
}
.nav-link.nav-loading {
    pointer-events: none;
    color: var(--accent);
    background: var(--accent-dim);
}
.nav-link.nav-loading i.fas,
.nav-link.nav-loading i.fab,
.nav-link.nav-loading i.far {
    animation: navSpin 0.6s linear infinite;
}
.nav-link.nav-loading i.fas::before,
.nav-link.nav-loading i.fab::before,
.nav-link.nav-loading i.far::before {
    content: "\f1ce" !important;
    font-family: "Font Awesome 5 Free" !important;
    font-weight: 900 !important;
}
@keyframes navSpin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}
/* Page transition overlay */
.page-loading-overlay {
    position: fixed;
    top: var(--header-height);
    left: var(--sidebar-width);
    right: 0;
    bottom: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
}
.page-loading-overlay.visible {
    opacity: 1;
    pointer-events: all;
}
.page-loading-spinner {
    width: 28px;
    height: 28px;
    border: 2px solid var(--border-color);
    border-top-color: var(--accent);
    animation: navSpin 0.6s linear infinite;
}



/* ---- CSS Variables ---- */
:root {
    --bg-primary: #090909;
    --bg-secondary: #0f0f0f;
    --bg-card: #141414;
    --bg-card-hover: #1a1a1a;
    --bg-input: #161616;
    --bg-sidebar: #0b0b0b;
    --bg-header: rgba(9, 9, 9, 0.88);

    --border-color: #262626;
    --border-light: #1c1c1c;

    --text-primary: #e5e5e5;
    --text-secondary: #a0a0a0;
    --text-muted: #666666;
    --text-heading: #ffffff;

    --accent: #ffffff;
    --accent-hover: #d4d4d4;
    --accent-dim: rgba(255, 255, 255, 0.07);
    --accent-contrast: #000000;

    --success: #46a758;
    --success-dim: rgba(70, 167, 88, 0.12);
    --warning: #e5a000;
    --warning-dim: rgba(229, 160, 0, 0.12);
    --danger: #e5484d;
    --danger-dim: rgba(229, 72, 77, 0.12);
    --info: #3b82f6;
    --info-dim: rgba(59, 130, 246, 0.12);

    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.6);
    --shadow-glow: none;

    --radius-sm: 7px;
    --radius-md: 11px;
    --radius-lg: 15px;
    --radius-xl: 20px;

    --sidebar-width: 260px;
    --header-height: 64px;

    --transition: 0.2s ease;
}

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    color: var(--accent);
    text-decoration: none;
    transition: color var(--transition);
}

a:hover {
    color: var(--accent-hover);
}

img {
    max-width: 100%;
    display: block;
}

/* ---- Scrollbar ---- */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 0;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--text-muted);
}

/* ---- Selection ---- */
::selection { background: rgba(255, 255, 255, 0.15); color: #fff; }
::-moz-selection { background: rgba(255, 255, 255, 0.15); color: #fff; }

.auth-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: var(--bg-primary);
    position: relative;
    overflow: hidden;
}

.auth-wrapper::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle at 30% 40%, rgba(255, 255, 255, 0.02) 0%, transparent 50%),
                radial-gradient(circle at 70% 60%, rgba(255, 255, 255, 0.015) 0%, transparent 50%);
    animation: authBgRotate 30s linear infinite;
}

@keyframes authBgRotate {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.auth-card {
    position: relative;
    width: 100%;
    max-width: 420px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    z-index: 1;
}

.auth-logo {
    text-align: center;
    margin-bottom: 32px;
}

.auth-logo img {
    width: 72px;
    height: 72px;
    margin: 0 auto 16px;
    filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.15));
}

.auth-logo h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.02em;
}

.auth-logo p {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

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

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
    text-transform: uppercase;
}

.form-control {
    width: 100%;
    padding: 12px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    font-family: inherit;
    transition: border-color var(--transition), box-shadow var(--transition);
    outline: none;
}

.form-control::placeholder {
    color: var(--text-muted);
}

.form-control:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239898b0' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
    cursor: pointer;
}

textarea.form-control {
    resize: vertical;
    min-height: 80px;
}

/* ---- Buttons ---- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 22px;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.9375rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    line-height: 1.4;
    white-space: nowrap;
}

.btn-primary {
    background: var(--accent);
    color: #000;
}

.btn-primary:hover {
    background: var(--accent-hover);
    color: #000;
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-success:hover {
    background: #53b563;
    color: #fff;
}

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

.btn-danger:hover {
    background: #ec5d62;
    color: #fff;
}

.btn-warning {
    background: var(--warning);
    color: #000;
}

.btn-warning:hover {
    background: #f0b020;
    color: #000;
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
}

.btn-ghost:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.btn-sm {
    padding: 7px 14px;
    font-size: 0.875rem;
}

.btn-lg {
    padding: 14px 28px;
    font-size: 1.0625rem;
}

.btn-block {
    width: 100%;
}

.btn-icon {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: var(--radius-sm);
}

/* ---- Flash Messages ---- */
.flash-message {
    padding: 14px 18px;
    border-radius: var(--radius-sm);
    margin-bottom: 20px;
    font-size: 0.9375rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    animation: flashIn 0.3s ease;
}

@keyframes flashIn {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

.flash-success {
    background: var(--success-dim);
    color: var(--success);
    border: 1px solid rgba(0, 214, 143, 0.3);
}

.flash-error {
    background: var(--danger-dim);
    color: var(--danger);
    border: 1px solid rgba(255, 61, 113, 0.3);
}

/* ---- Auth Footer ---- */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.auth-footer a {
    font-weight: 600;
}

.app-layout {
    display: flex;
    min-height: 100vh;
    overflow-x: hidden;
    max-width: 100vw;
}

/* ---- Sidebar ---- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    transition: transform 0.3s ease;
}

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

.sidebar-logo {
    height: 40px;
    width: auto;
    flex-shrink: 0;
    filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
    object-fit: contain;
}

.sidebar-brand {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-heading);
    letter-spacing: -0.02em;
}

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

.sidebar-nav {
    flex: 1;
    padding: 16px 12px;
    overflow-y: auto;
}

.nav-section {
    margin-bottom: 24px;
}

.nav-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 12px;
    margin-bottom: 8px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 2px;
}

.nav-link:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.nav-link.active {
    background: var(--accent-dim);
    color: var(--accent);
}

.nav-link i {
    width: 22px;
    text-align: center;
    font-size: 1.0625rem;
}

.nav-badge {
    margin-left: auto;
    background: var(--danger);
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: var(--radius-sm);
    min-width: 22px;
    text-align: center;
}
.nav-link.active .nav-badge {
    display: none !important;
}

.sidebar-footer {
    padding: 16px;
    border-top: 1px solid var(--border-light);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border-radius: var(--radius-sm);
    transition: background var(--transition);
}

.sidebar-user:hover {
    background: var(--bg-card-hover);
}

.sidebar-user-link {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    min-width: 0;
    transition: opacity var(--transition);
}

.sidebar-user-link:hover {
    opacity: .8;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.875rem;
    flex-shrink: 0;
}

.user-avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.user-info {
    flex: 1;
    min-width: 0;
}

.user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-role {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99;
}
.sidebar-overlay.active {
    display: block;
}

/* ---- Main Content ---- */
.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    min-height: 100vh;
    min-width: 0;
    display: flex;
    flex-direction: column;
    overflow-x: hidden;
}

/* ---- Header ---- */
.header {
    height: var(--header-height);
    background: var(--bg-header);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 50;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.header-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-heading);
}

.header-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.header-breadcrumb a {
    color: var(--text-secondary);
}

.header-breadcrumb .separator {
    color: var(--text-muted);
}

.header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-center {
    flex: 1;
    text-align: center;
}

.header-greeting {
    font-size: 0.9375rem;
    color: var(--text-muted);
}

.header-greeting strong {
    color: var(--text-heading);
}

/* Notification bell */
.notif-bell {
    position: relative;
}

.notif-bell-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1.0625rem;
    transition: var(--transition);
    position: relative;
}

.notif-bell-btn:hover {
    color: var(--accent);
    border-color: var(--accent-dim);
}

.notif-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--danger);
    border-radius: 50%;
    display: none;
}

.notif-dot.active {
    display: block;
    animation: pulse-notif 2s infinite;
}

@keyframes pulse-notif {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.3); opacity: 0.7; }
}

.notif-panel {
    position: absolute;
    top: 100%;
    right: 0;
    width: 360px;
    max-height: 460px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    display: none;
    z-index: 200;
    margin-top: 6px;
    flex-direction: column;
}

.notif-panel.open {
    display: flex;
}

.notif-panel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 14px;
    border-bottom: 1px solid var(--border-color);
}

.notif-panel-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-heading);
}

.notif-mark-all {
    background: none;
    border: none;
    color: var(--accent);
    font-size: 0.8125rem;
    cursor: pointer;
    padding: 0;
}

.notif-mark-all:hover {
    text-decoration: underline;
}

.notif-panel-body {
    overflow-y: auto;
    flex: 1;
    max-height: 380px;
}

.notif-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--border-color);
    cursor: pointer;
    transition: background 0.15s;
    position: relative;
}

.notif-item:hover {
    background: var(--bg-secondary);
}

.notif-item:last-child {
    border-bottom: none;
}

.notif-item.read {
    opacity: 0.55;
}

.notif-item-icon {
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    flex-shrink: 0;
}

.notif-item-icon.red { background: var(--danger-dim); color: var(--danger); }
.notif-item-icon.blue { background: var(--info-dim); color: var(--info); }
.notif-item-icon.green { background: var(--success-dim); color: var(--success); }
.notif-item-icon.orange { background: rgba(217,160,32,0.12); color: #d9a020; }
.notif-item-icon.purple { background: rgba(144,102,204,0.12); color: #9066cc; }

.notif-item-content {
    flex: 1;
    min-width: 0;
}

.notif-item-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 2px;
}

.notif-item-msg {
    font-size: 0.8125rem;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.notif-item-time {
    font-size: 0.75rem;
    color: var(--text-muted);
    margin-top: 3px;
}

.notif-item-dot {
    width: 6px;
    height: 6px;
    background: var(--accent);
    border-radius: 50%;
    flex-shrink: 0;
    margin-top: 4px;
}

.notif-empty {
    text-align: center;
    padding: 32px 16px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.notif-empty i {
    font-size: 1.4rem;
    display: block;
    margin-bottom: 8px;
    opacity: 0.3;
}

@media (max-width: 480px) {
    .notif-panel {
        width: 300px;
        right: -40px;
    }
}

.header-profile {
    position: relative;
}

.header-profile-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.header-profile-btn:hover {
    background: var(--bg-secondary);
}

.header-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-heading);
}

.header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.header-username {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

.header-chevron {
    font-size: 0.6rem;
    color: var(--text-muted);
    transition: transform 0.2s;
}

.header-profile.open .header-chevron {
    transform: rotate(180deg);
}

.header-dropdown {
    display: none;
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 200px;
    box-shadow: var(--shadow-lg);
    z-index: 100;
    overflow: hidden;
    animation: modalIn 0.15s ease;
}

.header-profile.open .header-dropdown {
    display: block;
}

.header-dropdown-info {
    padding: 12px 16px;
}

.header-dropdown-name {
    font-weight: 600;
    font-size: 0.9375rem;
    color: var(--text-heading);
}

.header-dropdown-role {
    font-size: 0.8125rem;
    color: var(--text-muted);
    text-transform: capitalize;
}

.header-dropdown-divider {
    height: 1px;
    background: var(--border-color);
}

.header-dropdown-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 18px;
    color: var(--text-secondary);
    text-decoration: none;
    font-size: 0.9375rem;
    transition: background 0.15s;
}

.header-dropdown-item:hover {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

.header-dropdown-item i {
    width: 18px;
    text-align: center;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.header-dropdown-logout:hover {
    color: var(--danger);
}

.header-dropdown-logout:hover i {
    color: var(--danger);
}

.mobile-toggle {
    display: none;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 8px;
}

/* ---- Page Content ---- */
.page-content {
    flex: 1;
    padding: 32px;
    min-width: 0;
    overflow-x: hidden;
}

/* ---- Stats Grid ---- */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 22px;
    transition: all var(--transition);
}

.stat-card:hover {
    border-color: var(--accent);
}

.stat-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.stat-card-icon {
    width: 44px;
    height: 44px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

.stat-card-icon.purple { background: var(--accent-dim); color: var(--accent); }
.stat-card-icon.green { background: var(--success-dim); color: var(--success); }
.stat-card-icon.orange { background: var(--warning-dim); color: var(--warning); }
.stat-card-icon.red { background: var(--danger-dim); color: var(--danger); }
.stat-card-icon.blue { background: var(--info-dim); color: var(--info); }

.stat-value {
    font-size: 1.875rem;
    font-weight: 800;
    color: var(--text-heading);
    line-height: 1;
}

.stat-label {
    font-size: 0.875rem;
    color: var(--text-secondary);
    margin-top: 4px;
}

/* ---- Cards / Panels ---- */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    overflow: hidden;
}

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

.card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 22px;
}

.card-footer {
    padding: 14px 22px;
    border-top: 1px solid var(--border-light);
    background: var(--bg-secondary);
}

/* ---- Grid Layouts ---- */
.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ---- Tables ---- */
.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table th {
    padding: 14px 18px;
    text-align: left;
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    border-bottom: 1px solid var(--border-color);
    white-space: nowrap;
}

table td {
    padding: 14px 18px;
    font-size: 0.9375rem;
    color: var(--text-primary);
    border-bottom: 1px solid var(--border-light);
    vertical-align: middle;
}

table tbody tr {
    transition: background var(--transition);
}

table tbody tr:hover {
    background: var(--bg-card-hover);
}

table tbody tr:last-child td {
    border-bottom: none;
}

/* ---- Badges / Tags ---- */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px 12px;
    border-radius: var(--radius-sm);
    font-size: 0.8125rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.badge-open { background: var(--info-dim); color: var(--info); }
.badge-in_progress { background: var(--warning-dim); color: var(--warning); }
.badge-resolved { background: var(--success-dim); color: var(--success); }
.badge-closed { background: rgba(100, 100, 120, 0.2); color: var(--text-muted); }

.badge-low { background: rgba(100, 100, 120, 0.2); color: var(--text-secondary); }
.badge-medium { background: var(--warning-dim); color: var(--warning); }
.badge-high { background: rgba(217, 138, 43, 0.15); color: #d98a2b; }
.badge-critical { background: var(--danger-dim); color: var(--danger); }

.badge-info { background: var(--info-dim); color: var(--info); }
.badge-warn { background: var(--warning-dim); color: var(--warning); }
.badge-error { background: var(--danger-dim); color: var(--danger); }
.badge-action { background: var(--accent-dim); color: var(--accent); }

.badge-admin { background: var(--danger-dim); color: var(--danger); }
.badge-senior_mod { background: var(--warning-dim); color: var(--warning); }
.badge-moderator { background: var(--info-dim); color: var(--info); }
.badge-viewer { background: rgba(100, 100, 120, 0.2); color: var(--text-muted); }

/* ---- Discord User Display ---- */
.discord-user {
    display: flex;
    align-items: center;
    gap: 8px;
}

.discord-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--bg-input);
    flex-shrink: 0;
}

.discord-name {
    font-weight: 500;
    font-size: 0.9375rem;
}

/* ---- Filters Bar ---- */
.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    align-items: center;
    margin-bottom: 24px;
    padding: 18px 22px;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
}

.filter-group {
    display: flex;
    align-items: center;
    gap: 8px;
}

.filter-group label {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    white-space: nowrap;
}

.filter-group .form-control {
    padding: 9px 14px;
    font-size: 0.9rem;
    min-width: 150px;
}

.filter-group input[type="text"] {
    min-width: 200px;
}

.filter-group input[type="date"] {
    min-width: 150px;
}

.filter-tabs {
    display: flex;
    gap: 4px;
    margin-bottom: 20px;
}

.filter-tab {
    padding: 9px 18px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-secondary);
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    cursor: pointer;
    transition: all var(--transition);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.filter-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.filter-tab.active {
    background: var(--accent-dim);
    color: var(--accent);
    border-color: var(--accent);
}

.filter-tab .count {
    font-size: 0.8rem;
    opacity: 0.8;
}

/* ---- Pagination ---- */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 24px;
}

.pagination a,
.pagination span {
    padding: 9px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    border: 1px solid var(--border-color);
}

.pagination a {
    color: var(--text-secondary);
    background: var(--bg-card);
}

.pagination a:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.pagination .active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.pagination .disabled {
    color: var(--text-muted);
    background: var(--bg-secondary);
    pointer-events: none;
    opacity: 0.5;
}

/* ---- Report Detail ---- */
.report-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
}

.report-title {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 8px;
}

.report-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.report-meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
}

.report-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.report-body {
    margin-bottom: 32px;
}

.report-description {
    padding: 20px;
    background: var(--bg-input);
    border-radius: var(--radius-md);
    border: 1px solid var(--border-light);
    line-height: 1.7;
    white-space: pre-wrap;
}

.report-sidebar-info {
    display: grid;
    gap: 16px;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid var(--border-light);
}

.info-row:last-child {
    border-bottom: none;
}

.info-label {
    font-size: 0.875rem;
    color: var(--text-muted);
    font-weight: 500;
}

.info-value {
    font-size: 0.9375rem;
    color: var(--text-primary);
    font-weight: 500;
}

/* ---- Comments ---- */
.comments-section {
    margin-top: 32px;
}

.comments-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.comment {
    display: flex;
    gap: 14px;
    padding: 18px;
    border-bottom: 1px solid var(--border-light);
}

.comment:last-of-type {
    border-bottom: none;
}

.comment-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--accent-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
    font-weight: 700;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.comment-body {
    flex: 1;
}

.comment-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.comment-author {
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--text-primary);
}

.comment-date {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.comment-text {
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.comment-form {
    margin-top: 20px;
    display: flex;
    gap: 12px;
}

.comment-form textarea {
    flex: 1;
}

.comment-form .btn {
    align-self: flex-end;
}

/* ---- Logs Table Specific ---- */
.log-type-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 6px;
}

.log-type-indicator.info { background: var(--info); }
.log-type-indicator.warn { background: var(--warning); }
.log-type-indicator.error { background: var(--danger); }
.log-type-indicator.action { background: var(--accent); }

.log-description {
    max-width: 400px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.log-timestamp {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.875rem;
    color: var(--text-muted);
    white-space: nowrap;
}

/* ---- User Management ---- */
.user-row-status {
    display: flex;
    align-items: center;
    gap: 6px;
}

.status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 6px rgba(0, 214, 143, 0.4);
}

.status-dot.inactive {
    background: var(--danger);
    box-shadow: 0 0 6px rgba(255, 61, 113, 0.4);
}

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

.empty-state i {
    font-size: 3.5rem;
    margin-bottom: 18px;
    opacity: 0.5;
}

.empty-state h3 {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.empty-state p {
    font-size: 0.9375rem;
}

/* ---- Activity Timeline ---- */
.activity-list {
    list-style: none;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 10px 0;
    border-bottom: 1px solid var(--border-light);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
    flex-shrink: 0;
}

.activity-icon.login { background: var(--success-dim); color: var(--success); }
.activity-icon.logout { background: var(--danger-dim); color: var(--danger); }
.activity-icon.register { background: var(--info-dim); color: var(--info); }

.activity-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
    line-height: 1.4;
}

.activity-text strong {
    color: var(--text-primary);
}

.activity-time {
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-top: 2px;
}

/* ---- Inline Forms ---- */
.inline-form {
    display: flex;
    gap: 8px;
    align-items: center;
}

.inline-form .form-control {
    padding: 8px 12px;
    font-size: 0.875rem;
}

/* ---- Modal ---- */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 36px;
    width: 100%;
    max-width: 520px;
    box-shadow: var(--shadow-lg);
    animation: modalIn 0.2s ease;
}

@keyframes modalIn {
    from { opacity: 0; transform: scale(0.95) translateY(10px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}

.modal-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 24px;
}

/* ---- Confirm Dialog ---- */
.confirm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.confirm-overlay.active {
    display: flex;
}
.confirm-dialog {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 0;
    width: 100%;
    max-width: 460px;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
    animation: confirmIn 0.18s ease;
    overflow: hidden;
}
@keyframes confirmIn {
    from { opacity: 0; transform: scale(0.96) translateY(8px); }
    to { opacity: 1; transform: scale(1) translateY(0); }
}
@keyframes confirmOut {
    from { opacity: 1; transform: scale(1) translateY(0); }
    to { opacity: 0; transform: scale(0.96) translateY(8px); }
}
.confirm-dialog.closing {
    animation: confirmOut 0.14s ease forwards;
}
.confirm-type-bar {
    height: 3px;
    width: 100%;
}
.confirm-type-bar.danger { background: var(--danger); }
.confirm-type-bar.warning { background: var(--warning); }
.confirm-type-bar.info { background: var(--info); }
.confirm-type-bar.success { background: var(--success); }
.confirm-body {
    padding: 30px 30px 0;
}
.confirm-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.375rem;
    margin-bottom: 18px;
}
.confirm-icon.danger { color: var(--danger); background: var(--danger-dim); }
.confirm-icon.warning { color: var(--warning); background: var(--warning-dim); }
.confirm-icon.info { color: var(--info); background: var(--info-dim); }
.confirm-icon.success { color: var(--success); background: var(--success-dim); }
.confirm-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-heading);
    margin-bottom: 8px;
}
.confirm-message {
    font-size: 0.9375rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.confirm-message code {
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    padding: 1px 6px;
    font-size: 0.875rem;
    color: var(--text-primary);
    font-family: 'JetBrains Mono', monospace;
}
.confirm-actions {
    display: flex;
    gap: 10px;
    padding: 22px 30px 26px;
    justify-content: flex-end;
}
.confirm-btn {
    padding: 10px 22px;
    font-size: 0.9rem;
    font-weight: 500;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
    outline: none;
}
.confirm-btn:hover {
    background: var(--bg-card-hover);
    border-color: var(--text-muted);
}
.confirm-btn:focus-visible {
    box-shadow: 0 0 0 2px var(--accent-dim);
}
.confirm-btn.primary {
    background: var(--accent);
    color: #000;
    border-color: var(--accent);
}
.confirm-btn.primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
.confirm-btn.danger {
    background: var(--danger);
    color: #fff;
    border-color: var(--danger);
}
.confirm-btn.danger:hover {
    background: #d03e43;
    border-color: #d03e43;
}
.confirm-btn.warning {
    background: var(--warning);
    color: #000;
    border-color: var(--warning);
}
.confirm-btn.warning:hover {
    background: #cc8e00;
    border-color: #cc8e00;
}

/* ---- 404 / 500 ---- */
.error-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}

.error-code {
    font-size: 6rem;
    font-weight: 800;
    color: var(--accent);
    line-height: 1;
    margin-bottom: 16px;
    text-shadow: 0 0 40px rgba(108, 92, 231, 0.3);
}

.error-text {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

/* ---- Responsive ---- */

/* Tablet landscape */
@media (max-width: 1024px) {
    .page-content {
        padding: 24px 20px;
    }

    .grid-3 {
        grid-template-columns: 1fr 1fr;
    }
}

/* Tablet portrait + large phones */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

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

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,0.5);
        z-index: 99;
    }
    .sidebar.open ~ .sidebar-overlay,
    .sidebar-overlay.active {
        display: block;
    }

    .main-content {
        margin-left: 0;
    }

    .mobile-toggle {
        display: block;
    }

    .page-content {
        padding: 16px 12px;
    }

    .page-loading-overlay {
        left: 0;
    }

    .header {
        padding: 0 12px;
        height: 56px;
    }

    .header-title {
        font-size: 0.9375rem;
    }

    .header-center {
        display: none;
    }

    .header-username {
        display: none;
    }

    .header-dropdown {
        right: -8px;
        min-width: 180px;
    }

    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .stat-card {
        padding: 14px;
    }

    .stat-value {
        font-size: 1.25rem;
    }

    .stat-label {
        font-size: 0.6875rem;
    }

    .filters-bar {
        flex-direction: column;
        align-items: stretch;
        padding: 12px;
        gap: 8px;
    }

    .filter-group {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-group .form-control {
        min-width: unset;
    }

    .report-header {
        flex-direction: column;
    }

    .report-title {
        font-size: 1.125rem;
    }

    .auth-card {
        padding: 28px 20px;
    }

    .comment-form {
        flex-direction: column;
    }

    .comment {
        padding: 12px 0;
    }

    .grid-2, .grid-3 {
        grid-template-columns: 1fr;
    }

    .db-layout {
        flex-direction: column;
    }

    .db-sidebar {
        width: 100%;
    }

    .ticket-row {
        flex-wrap: wrap;
        gap: 8px;
        padding: 12px;
    }

    .ticket-from, .ticket-time {
        min-width: auto;
        font-size: 0.75rem;
    }

    .ticket-id {
        min-width: auto;
    }

    .card-header {
        padding: 14px 16px;
    }

    .card-body {
        padding: 16px;
    }

    table th, table td {
        padding: 10px 12px;
        font-size: 0.75rem;
    }

    .pagination a,
    .pagination span {
        padding: 6px 10px;
        font-size: 0.75rem;
    }

    .modal {
        padding: 20px;
        margin: 12px;
        max-width: calc(100vw - 24px);
    }

    .report-description {
        padding: 14px;
    }

    .empty-state {
        padding: 40px 16px;
    }
}

/* Phones */
@media (max-width: 480px) {
    .page-content {
        padding: 12px 8px;
    }

    .header {
        padding: 0 10px;
        height: 50px;
    }

    .header-title {
        font-size: 0.8125rem;
    }

    .header-left {
        gap: 8px;
    }

    .stats-grid {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .stat-card {
        padding: 12px;
        display: flex;
        align-items: center;
        gap: 12px;
    }

    .stat-card-header {
        margin-bottom: 0;
    }

    .stat-value {
        font-size: 1.125rem;
    }

    .filter-tabs {
        flex-wrap: wrap;
    }

    .filter-tab {
        padding: 6px 12px;
        font-size: 0.75rem;
    }

    .btn {
        padding: 8px 14px;
        font-size: 0.75rem;
    }

    .btn-sm {
        padding: 5px 10px;
        font-size: 0.6875rem;
    }

    .form-control {
        padding: 10px 12px;
        font-size: 0.8125rem;
    }

    .modal {
        padding: 16px;
        margin: 8px;
        max-width: calc(100vw - 16px);
    }

    .modal-title {
        font-size: 1rem;
    }

    .flash-message {
        font-size: 0.8125rem;
        padding: 10px 14px;
    }

    .card-title {
        font-size: 0.875rem;
    }

    .badge {
        padding: 2px 8px;
        font-size: 0.6875rem;
    }

    .nav-section-title {
        font-size: 0.625rem;
    }

    .nav-link {
        padding: 8px 10px;
        font-size: 0.8125rem;
        gap: 10px;
    }

    .sidebar-header {
        padding: 14px 16px 12px;
    }

    .sidebar-brand {
        font-size: 1rem;
    }

    table th, table td {
        padding: 8px;
        font-size: 0.6875rem;
    }

    .report-actions {
        flex-wrap: wrap;
    }

    .inline-form {
        flex-wrap: wrap;
    }

    .log-description {
        max-width: 180px;
    }
}

/* ---- Utilities ---- */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-info { color: var(--info); }
.text-accent { color: var(--accent); }

.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mt-4 { margin-top: 32px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.mb-4 { margin-bottom: 32px; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }

.hidden { display: none !important; }
.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Hotkeys Overlay ---- */
.hotkeys-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    z-index: 10000;
    align-items: center;
    justify-content: center;
}

.hotkeys-overlay.active {
    display: flex;
}

.hotkeys-panel {
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    width: 100%;
    max-width: 460px;
    max-height: 80vh;
    overflow-y: auto;
}

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

.hotkeys-title {
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--text-heading);
    display: flex;
    align-items: center;
    gap: 8px;
}

.hotkeys-close {
    background: none;
    border: none;
    color: var(--text-muted);
    font-size: 1.25rem;
    cursor: pointer;
    padding: 4px 8px;
    line-height: 1;
    transition: color 0.15s;
}

.hotkeys-close:hover {
    color: var(--text-primary);
}

.hotkeys-body {
    padding: 16px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.hk-col {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.hk-group-label {
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 6px;
}

.hk-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 3px 0;
}

.hk-keys {
    display: flex;
    align-items: center;
    gap: 3px;
}

.hk-keys kbd {
    display: inline-block;
    padding: 3px 8px;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-primary);
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    line-height: 1.4;
}

.hk-desc {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

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

/* ---- Cookie Consent Banner ---- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 99990;
    background: var(--bg-card);
    border-top: 1px solid var(--border-color);
    transform: translateY(100%);
    transition: transform 0.3s ease;
}
.cookie-banner.visible {
    transform: translateY(0);
}
.cookie-banner-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 20px;
}
.cookie-banner-text {
    flex: 1;
    font-size: 0.82rem;
    color: var(--text-secondary);
    line-height: 1.5;
}
.cookie-banner-text i {
    color: var(--warning);
    margin-right: 4px;
}
.cookie-banner-text a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}
.cookie-banner-text a:hover {
    color: var(--accent-hover);
}
.cookie-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}
.cookie-btn {
    padding: 8px 18px;
    border: 1px solid var(--border-color);
    background: transparent;
    color: var(--text-primary);
    font-size: 0.8rem;
    font-family: inherit;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
}
.cookie-btn:hover {
    background: var(--accent-dim);
}
.cookie-btn-accept {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
    font-weight: 600;
}
.cookie-btn-accept:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
}
@media (max-width: 640px) {
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
        padding: 14px 16px;
    }
    .cookie-banner-actions {
        justify-content: stretch;
    }
    .cookie-banner-actions .cookie-btn {
        flex: 1;
    }
}


/* ==== Themes ==== */
html[data-theme="light"] {
    --bg-primary: #f4f4f6;
    --bg-secondary: #ececef;
    --bg-card: #ffffff;
    --bg-card-hover: #f5f5f8;
    --bg-input: #ffffff;
    --bg-sidebar: #fafafb;
    --bg-header: rgba(250, 250, 251, 0.9);
    --border-color: #dcdce2;
    --border-light: #e8e8ec;
    --text-primary: #26262b;
    --text-secondary: #55555e;
    --text-muted: #8b8b95;
    --text-heading: #101014;
    --accent: #18181d;
    --accent-hover: #3a3a42;
    --accent-dim: rgba(0, 0, 0, 0.06);
    --accent-contrast: #ffffff;
    --shadow-sm: 0 1px 3px rgba(20, 20, 30, 0.08);
    --shadow-md: 0 4px 12px rgba(20, 20, 30, 0.1);
    --shadow-lg: 0 8px 32px rgba(20, 20, 30, 0.14);
}

html[data-theme="midnight"] {
    --bg-primary: #0a0e1a;
    --bg-secondary: #0d1322;
    --bg-card: #101729;
    --bg-card-hover: #162038;
    --bg-input: #0e1526;
    --bg-sidebar: #0a0f1d;
    --bg-header: rgba(10, 14, 26, 0.88);
    --border-color: #1e2942;
    --border-light: #161f33;
    --text-primary: #dde3f0;
    --text-secondary: #93a0bd;
    --text-muted: #5a6580;
    --text-heading: #ffffff;
    --accent: #8ab4ff;
    --accent-hover: #a8c7ff;
    --accent-dim: rgba(138, 180, 255, 0.1);
    --accent-contrast: #0a0e1a;
}

html[data-theme="amoled"] {
    --bg-primary: #000000;
    --bg-secondary: #050505;
    --bg-card: #0a0a0a;
    --bg-card-hover: #121212;
    --bg-input: #0d0d0d;
    --bg-sidebar: #030303;
    --bg-header: rgba(0, 0, 0, 0.9);
    --border-color: #1f1f1f;
    --border-light: #141414;
}

/* ==== Rounded mode ==== */
html[data-rounded="1"] {
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
}
html[data-rounded="1"] :where(
    button, input, select, textarea,
    .flash-message, .nav-link, .nav-badge,
    .header-dropdown, .notif-panel, .notif-item, .theme-menu,
    [class*="-card"], [class*="-stat"], [class*="-entry"], [class*="-panel"],
    [class*="-box"], [class*="-item"], [class*="-btn"], [class*="-input"],
    [class*="-select"], [class*="-section"], [class*="-modal"], [class*="-toolbar"],
    [class*="-act"], [class*="-chip"], [class*="-tag"], [class*="-pill"],
    [class*="-tab"], [class*="-zone"], [class*="-bar"], [class*="-row"],
    [class*="-note"], [class*="-empty"], [class*="-form"], [class*="-detail"],
    [class*="-table"], [class*="-feed"], [class*="-list-delete"],
    .an-chart-wrap, .fin-chart-wrap, .pagination a, .pagination span,
    .settings-avatar
) {
    border-radius: var(--radius-md, 10px);
}
html[data-rounded="1"] :where(canvas, .an-chart-wrap canvas, .fin-chart-wrap canvas) {
    border-radius: 0;
}
html[data-rounded="1"] :where([class*="-badge"], [class*="badge"], [class*="-pill"], [class*="-label"], kbd) {
    border-radius: var(--radius-sm, 6px);
}
html[data-rounded="1"] :where(
    [class*="avatar"]:not([class*="settings-avatar"]), .settings-avatar-img,
    [class*="avatar"] img, [class*="-dot"], .theme-dot, .rm-ava
) {
    border-radius: 50%;
}
html[data-rounded="1"] :where([class*="strip"]) { border-radius: 3px; }
html[data-rounded="1"] :where([class*="__fill"], [class*="prog"], [class*="-track"]) { border-radius: 4px; }
html[data-rounded="1"] .sidebar, html[data-rounded="1"] .header { border-radius: 0; }
/* Инжектируемые тосты/диалоги (runtime-стили без скругления) */
html[data-rounded="1"] :where(.ui-toast, .ui-dlg) { border-radius: var(--radius-md, 11px); }
html[data-rounded="1"] :where(.ui-dlg__icon, .ui-dlg__input, .ui-dlg__btn) { border-radius: var(--radius-sm, 7px); }

/* ==== Theme switcher ==== */
.theme-switch { position: relative; }
.theme-switch-btn {
    width: 34px; height: 34px; background: transparent; border: 1px solid transparent;
    color: var(--text-muted); cursor: pointer; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center; transition: all 0.15s;
}
.theme-switch-btn:hover { color: var(--text-heading); border-color: var(--border-color); background: var(--bg-card); }
.theme-menu {
    display: none; position: absolute; right: 0; top: calc(100% + 8px); z-index: 300;
    width: 210px; background: var(--bg-card); border: 1px solid var(--border-color);
    box-shadow: var(--shadow-lg); padding: 6px;
}
.theme-menu.open { display: block; }
.theme-menu__title {
    font-size: 0.62rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.1em;
    color: var(--text-muted); padding: 8px 10px 6px;
}
.theme-option {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px 10px;
    background: transparent; border: none; color: var(--text-secondary); cursor: pointer;
    font-size: 0.82rem; font-family: inherit; text-align: left; transition: background 0.12s;
}
.theme-option:hover { background: var(--bg-card-hover); color: var(--text-heading); }
.theme-option.active { color: var(--text-heading); font-weight: 600; }
.theme-option.active::after { content: "\2713"; margin-left: auto; color: var(--success); }
.theme-dot { width: 14px; height: 14px; border-radius: 50%; border: 1px solid rgba(128,128,128,0.45); flex-shrink: 0; }
.theme-menu__divider { height: 1px; background: var(--border-color); margin: 6px 0; }
