:root {
    --sa-primary: #6366F1;
    --sa-secondary: #3F3D56;
    --sa-accent: #F59E0B;
    --sa-bg: #F4F5FA;
    --sa-card: #FFFFFF;
    --sa-text: #1E1F2E;
    --sa-muted: #6B7280;
    --sa-border: #E5E7EB;
    --sa-success: #10B981;
    --sa-warning: #F59E0B;
    --sa-danger: #EF4444;
    --sidebar-width: 288px;
    --sidebar-bg: #1A1B2E;
    --sidebar-text: #B8BCC8;
    --sidebar-hover: rgba(99, 102, 241, 0.15);
    --sidebar-active: var(--sa-primary);
    --topbar-height: 60px;
}

body {
    background-color: var(--sa-bg);
    color: var(--sa-text);
    font-family: 'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ── Sidebar ─────────────────────────────────────────────── */

.app-wrapper {
    display: flex;
    min-height: 100vh;
}

.sidebar {
    width: var(--sidebar-width);
    background: linear-gradient(180deg, #1E1F33 0%, #171828 100%);
    color: var(--sidebar-text);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease;
    overflow-y: auto;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.25rem 1.4rem;
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
    flex-shrink: 0;
    letter-spacing: -0.01em;
}

.sidebar-brand i {
    font-size: 1.4rem;
    background: linear-gradient(135deg, #818CF8, #6366F1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-brand-logo {
    width: 28px;
    height: 28px;
    border-radius: 7px;
    object-fit: contain;
    flex-shrink: 0;
}

.sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.sidebar-nav .nav-section-label {
    font-size: 0.6rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(180, 185, 210, 0.26);
    padding: 1.4rem 1.5rem 0.55rem;
    line-height: 1;
    list-style: none;
}

.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.9rem;
    padding: 0.72rem 1.35rem 0.72rem 1.3rem;
    margin: 1px 0;
    color: rgba(180, 185, 210, 0.55);
    font-size: 0.875rem;
    font-weight: 450;
    border-radius: 0;
    border-left: 3px solid transparent;
    transition: color 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    text-decoration: none;
}

.sidebar-nav .nav-link:hover {
    color: rgba(235, 237, 248, 0.88);
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.08) 0%, rgba(99, 102, 241, 0.015) 100%);
    border-left-color: rgba(129, 140, 248, 0.3);
}

.sidebar-nav .nav-link.active {
    color: #fff;
    background: linear-gradient(90deg, rgba(99, 102, 241, 0.15) 0%, rgba(99, 102, 241, 0.04) 100%);
    border-left-color: #818CF8;
    font-weight: 580;
}

.sidebar-nav .nav-link i:first-child {
    width: 20px;
    text-align: center;
    font-size: 1.05rem;
    flex-shrink: 0;
    opacity: 0.4;
    transition: opacity 0.2s ease, color 0.2s ease;
}

.sidebar-nav .nav-link:hover i:first-child {
    opacity: 0.8;
}

.sidebar-nav .nav-link.active i:first-child {
    opacity: 1;
    color: #A5B4FC;
}

.sidebar-nav .nav-group-toggle {
    position: relative;
}

.sidebar-nav .nav-arrow {
    margin-left: auto;
    font-size: 0.6rem;
    opacity: 0.2;
    transition: transform 0.25s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.2s ease;
}

.sidebar-nav .nav-group-toggle:hover .nav-arrow {
    opacity: 0.48;
}

.sidebar-nav .nav-group-toggle[aria-expanded="true"] .nav-arrow {
    transform: rotate(180deg);
    opacity: 0.55;
}

.sidebar-nav .collapsing {
    transition: height 0.25s cubic-bezier(0.22, 1, 0.36, 1);
}

.sidebar-nav .nav-sub {
    padding: 0.2rem 0 0.4rem;
    position: relative;
}

.sidebar-nav .nav-sub::before {
    content: '';
    position: absolute;
    left: 2.15rem;
    top: 0.2rem;
    bottom: 0.4rem;
    width: 1px;
    background: rgba(255, 255, 255, 0.055);
    border-radius: 1px;
}

.sidebar-nav .nav-sub .nav-link {
    padding: 0.44rem 1.35rem 0.44rem 3.15rem;
    font-size: 0.815rem;
    color: rgba(180, 185, 210, 0.44);
    margin: 0;
    border-left: none;
}

.sidebar-nav .nav-sub .nav-link:hover {
    color: rgba(235, 237, 248, 0.82);
    background: rgba(99, 102, 241, 0.05);
    border-left: none;
}

.sidebar-nav .nav-sub .nav-link.active {
    color: #E0E2FF;
    font-weight: 550;
    background: rgba(99, 102, 241, 0.08);
    border-left: none;
}

.sidebar-nav .nav-sub .nav-link i:first-child {
    font-size: 0.88rem;
    width: 18px;
}

.sidebar-nav .nav-section {
    margin-top: 0.25rem;
    padding-top: 0.7rem;
    border-top: 1px solid rgba(255, 255, 255, 0.04);
}

.sidebar-footer {
    display: flex;
    align-items: center;
    padding: 1.05rem 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    flex-shrink: 0;
    margin-top: 0.5rem;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    color: rgba(180, 185, 210, 0.48);
    text-decoration: none;
    font-size: 0.82rem;
    flex: 1;
    overflow: hidden;
    transition: color 0.2s ease;
}

.sidebar-user:hover {
    color: rgba(255, 255, 255, 0.78);
}

.sidebar-user span {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.sidebar-logout {
    color: rgba(180, 185, 210, 0.32);
    padding: 0.3rem;
    font-size: 1.05rem;
    flex-shrink: 0;
    transition: color 0.2s ease;
}

.sidebar-logout:hover {
    color: #F87171;
}

/* ── Overlay (mobile) ──────────────────────────────────── */

.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1035;
    backdrop-filter: blur(3px);
}

.sidebar-overlay.show {
    display: block;
}

/* ── Main Content ────────────────────────────────────────── */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    min-width: 0;
}

.topbar {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0 1.75rem;
    height: var(--topbar-height);
    background: #fff;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
    position: sticky;
    top: 0;
    z-index: 1020;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.02);
}

.topbar-toggle {
    display: none;
    color: var(--sa-text);
    padding: 0;
}

.topbar-title {
    font-weight: 600;
    font-size: 0.95rem;
    color: #1E1F2E;
    letter-spacing: -0.01em;
}

.content-wrapper {
    padding: 1.75rem 2rem;
    flex: 1;
}

/* ── Mobile Responsive ───────────────────────────────────── */

@media (max-width: 991.98px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .topbar-toggle {
        display: block;
    }
}

/* ── Existing Styles ─────────────────────────────────────── */

.btn-primary {
    background-color: var(--sa-primary);
    border-color: var(--sa-primary);
}

.btn-primary:hover {
    background-color: #4F46E5;
    border-color: #4F46E5;
}

/* ── Cards ───────────────────────────────────────────────── */

.card {
    border: none;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 6px 24px rgba(0, 0, 0, 0.045);
}

.card-header {
    background: transparent;
    border-bottom: 1px solid rgba(0, 0, 0, 0.055);
    font-weight: 600;
    font-size: 0.84rem;
    color: #374151;
    letter-spacing: -0.005em;
    padding: 1.15rem 1.5rem;
}

.card-header i {
    opacity: 0.55;
    font-size: 0.9rem;
}

.card-body {
    padding: 1.35rem 1.5rem;
}

/* ── KPI Stat Cards ─────────────────────────────────────── */

.stat-card {
    padding: 1.6rem 1.5rem 1.5rem 1.65rem;
    border-radius: 16px;
    color: #fff;
    position: relative;
    overflow: hidden;
    transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.stat-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,0.1) 0%, transparent 50%);
    pointer-events: none;
}

.stat-card:hover {
    transform: translateY(-3px);
}

.stat-card .stat-icon {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    font-size: 5rem;
    opacity: 0.1;
    pointer-events: none;
}

.stat-card .stat-value {
    font-size: 2.5rem;
    font-weight: 800;
    line-height: 1;
    letter-spacing: -0.03em;
    color: #fff;
    position: relative;
}

.stat-card .stat-label {
    font-size: 0.7rem;
    margin-top: 0.5rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    opacity: 0.82;
    position: relative;
}

/* Indigo — core content metrics */
.stat-card.stat-indigo {
    background: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
    box-shadow: 0 4px 16px rgba(99, 102, 241, 0.25), 0 1px 3px rgba(99, 102, 241, 0.12);
}
.stat-card.stat-indigo:hover {
    box-shadow: 0 8px 28px rgba(99, 102, 241, 0.32), 0 2px 6px rgba(99, 102, 241, 0.15);
}

/* Blue — user & structure metrics */
.stat-card.stat-blue {
    background: linear-gradient(135deg, #3B82F6 0%, #60A5FA 100%);
    box-shadow: 0 4px 16px rgba(59, 130, 246, 0.25), 0 1px 3px rgba(59, 130, 246, 0.12);
}
.stat-card.stat-blue:hover {
    box-shadow: 0 8px 28px rgba(59, 130, 246, 0.32), 0 2px 6px rgba(59, 130, 246, 0.15);
}

/* Green — performance metrics */
.stat-card.stat-green {
    background: linear-gradient(135deg, #10B981 0%, #34D399 100%);
    box-shadow: 0 4px 16px rgba(16, 185, 129, 0.25), 0 1px 3px rgba(16, 185, 129, 0.12);
}
.stat-card.stat-green:hover {
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.32), 0 2px 6px rgba(16, 185, 129, 0.15);
}

/* Orange — premium / revenue metrics */
.stat-card.stat-orange {
    background: linear-gradient(135deg, #F59E0B 0%, #FBBF24 100%);
    box-shadow: 0 4px 16px rgba(245, 158, 11, 0.25), 0 1px 3px rgba(245, 158, 11, 0.12);
}
.stat-card.stat-orange:hover {
    box-shadow: 0 8px 28px rgba(245, 158, 11, 0.32), 0 2px 6px rgba(245, 158, 11, 0.15);
}
.stat-card.stat-orange .stat-value,
.stat-card.stat-orange .stat-label { color: rgba(255, 255, 255, 0.95); }

/* Red — error / failure metrics */
.stat-card.stat-red {
    background: linear-gradient(135deg, #EF4444 0%, #F87171 100%);
    box-shadow: 0 4px 16px rgba(239, 68, 68, 0.25), 0 1px 3px rgba(239, 68, 68, 0.12);
}
.stat-card.stat-red:hover {
    box-shadow: 0 8px 28px rgba(239, 68, 68, 0.32), 0 2px 6px rgba(239, 68, 68, 0.15);
}

/* ── Tables ──────────────────────────────────────────────── */

.table {
    --bs-table-hover-bg: rgba(99, 102, 241, 0.03);
    margin-bottom: 0;
}

.table th {
    font-weight: 600;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9CA3AF;
    border-bottom: 1px solid rgba(0, 0, 0, 0.06);
    border-top: none;
    padding: 0.85rem 1.25rem;
    white-space: nowrap;
}

.table td {
    border-color: rgba(0, 0, 0, 0.035);
    padding: 0.75rem 1.25rem;
    vertical-align: middle;
    color: #374151;
    font-size: 0.855rem;
}

.table tbody tr {
    transition: background-color 0.15s ease;
}

.table tbody tr:last-child td {
    border-bottom: none;
}

/* ── Badges ──────────────────────────────────────────────── */

.badge-featured {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(251, 191, 36, 0.16));
    color: #B45309;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    padding: 0.35em 0.7em;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-premium {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1), rgba(129, 140, 248, 0.14));
    color: #4F46E5;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    padding: 0.35em 0.7em;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-active {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1), rgba(52, 211, 153, 0.14));
    color: #059669;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    padding: 0.35em 0.7em;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-inactive {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.08), rgba(156, 163, 175, 0.1));
    color: #6B7280;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    padding: 0.35em 0.7em;
    border-radius: 6px;
    text-transform: uppercase;
}

/* ── Dashboard Table Utilities ───────────────────────────── */

.rank-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 7px;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.06), rgba(129, 140, 248, 0.08));
    font-size: 0.7rem;
    font-weight: 700;
    color: #6366F1;
}

.sound-title {
    font-weight: 550;
    color: #1E1F2E;
    font-size: 0.855rem;
}

.sound-thumb {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    object-fit: cover;
    background: linear-gradient(135deg, #F0F1F8, #E8E9F2);
    flex-shrink: 0;
}

.sound-thumb i {
    font-size: 0.85rem;
    color: #A5B4FC;
}

.plays-count {
    font-weight: 700;
    color: #1E1F2E;
    font-size: 0.855rem;
    font-variant-numeric: tabular-nums;
}

.chart-period {
    font-weight: 400;
    color: #9CA3AF;
    margin-left: 0.35rem;
    font-size: 0.76rem;
}

/* ── Page-Level Components ──────────────────────────────── */

/* Forms — Global */
.form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #374151;
    letter-spacing: 0.01em;
    margin-bottom: 0.4rem;
}

.form-control,
.form-select {
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    padding: 0.6rem 0.875rem;
    font-size: 0.875rem;
    color: var(--sa-text);
    background-color: #FAFBFC;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.form-control:hover,
.form-select:hover {
    border-color: rgba(0, 0, 0, 0.14);
}

.form-control:focus,
.form-select:focus {
    border-color: var(--sa-primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.08);
    background-color: #fff;
}

.form-control::placeholder {
    color: #B8BDC9;
}

/* Form Sections */
.form-section {
    margin-bottom: 1.75rem;
    padding-bottom: 1.75rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
}

.form-section:last-of-type {
    border-bottom: none;
    margin-bottom: 0.5rem;
    padding-bottom: 0;
}

.form-section-title {
    font-size: 0.65rem;
    font-weight: 650;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #9CA3AF;
    margin-bottom: 1.15rem;
}

.form-hint {
    font-size: 0.74rem;
    color: #9CA3AF;
    margin-top: 0.3rem;
}

.file-current {
    font-size: 0.78rem;
    color: var(--sa-primary);
    margin-top: 0.35rem;
    opacity: 0.75;
}

.current-image-preview {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 10px;
    border: 1.5px solid rgba(0, 0, 0, 0.06);
}

/* Toggle Switches */
.form-check-input:checked {
    background-color: var(--sa-primary);
    border-color: var(--sa-primary);
}

.form-check-input:focus {
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
    border-color: var(--sa-primary);
}

.form-check-label {
    font-size: 0.855rem;
    color: #4B5563;
    font-weight: 480;
}

/* Info Banner */
.info-banner {
    background: rgba(99, 102, 241, 0.03);
    border: 1px solid rgba(99, 102, 241, 0.07);
    border-radius: 10px;
    padding: 0.85rem 1.05rem;
    font-size: 0.8rem;
    color: #6B7280;
    line-height: 1.65;
}

.info-banner i {
    color: var(--sa-primary);
    opacity: 0.55;
}

/* Submit Button */
.btn-submit {
    padding: 0.6rem 2rem;
    font-weight: 600;
    border-radius: 10px;
    font-size: 0.875rem;
}

/* Action Icon Buttons */
.btn-action {
    width: 34px;
    height: 34px;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    font-size: 0.82rem;
    border: 1px solid transparent;
    transition: all 0.2s ease;
    text-decoration: none;
}

.btn-action-edit {
    color: #6366F1;
    background: rgba(99, 102, 241, 0.06);
    border-color: rgba(99, 102, 241, 0.1);
}

.btn-action-edit:hover {
    color: #4F46E5;
    background: rgba(99, 102, 241, 0.13);
    border-color: rgba(99, 102, 241, 0.22);
}

.btn-action-delete {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.05);
    border-color: rgba(239, 68, 68, 0.08);
}

.btn-action-delete:hover {
    color: #DC2626;
    background: rgba(239, 68, 68, 0.12);
    border-color: rgba(239, 68, 68, 0.2);
}

/* Additional Badges */
.badge-ad {
    background: linear-gradient(135deg, rgba(14, 165, 233, 0.1), rgba(56, 189, 248, 0.14));
    color: #0369A1;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    padding: 0.35em 0.7em;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-login {
    background: linear-gradient(135deg, rgba(107, 114, 128, 0.08), rgba(156, 163, 175, 0.12));
    color: #4B5563;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    padding: 0.35em 0.7em;
    border-radius: 6px;
    text-transform: uppercase;
}

.badge-pending {
    background: linear-gradient(135deg, rgba(234, 179, 8, 0.1), rgba(250, 204, 21, 0.14));
    color: #A16207;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    padding: 0.35em 0.7em;
    border-radius: 6px;
    text-transform: uppercase;
}

/* Pagination */
.pagination .page-link {
    border: none;
    border-radius: 8px;
    font-size: 0.8rem;
    font-weight: 550;
    color: #6B7280;
    padding: 0.4rem 0.75rem;
    margin: 0 2px;
    transition: all 0.15s ease;
}

.pagination .page-link:hover {
    background: rgba(99, 102, 241, 0.06);
    color: var(--sa-primary);
}

.pagination .page-item.active .page-link {
    background: var(--sa-primary);
    color: #fff;
    box-shadow: 0 2px 6px rgba(99, 102, 241, 0.25);
}

/* Card Footer */
.card-footer {
    background: transparent;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
    padding: 0.85rem 1.25rem;
}

/* Empty State */
.empty-state {
    padding: 2.5rem 1rem;
    text-align: center;
}

.empty-state i {
    font-size: 2.5rem;
    opacity: 0.22;
    display: block;
    margin-bottom: 0.5rem;
    color: #9CA3AF;
}

.empty-state-text {
    font-size: 0.875rem;
    color: #9CA3AF;
}

/* Toggle Groups — Access Control Cards */
.toggle-group {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 1rem;
}

.toggle-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1.15rem;
    background: #FAFBFC;
    transition: background 0.15s ease;
}

.toggle-item + .toggle-item {
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.toggle-item:hover {
    background: #F4F5FA;
}

.toggle-item-info {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.toggle-item-icon {
    font-size: 1.1rem;
    width: 22px;
    text-align: center;
    flex-shrink: 0;
    opacity: 0.7;
}

.toggle-item-label {
    font-size: 0.855rem;
    font-weight: 570;
    color: #1E1F2E;
    line-height: 1.2;
}

.toggle-item-desc {
    font-size: 0.735rem;
    color: #9CA3AF;
    margin-top: 0.15rem;
}

/* User Avatars */
.user-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-avatar-lg {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
}

.user-avatar-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E0E2FF, #C7D2FE);
    color: #6366F1;
}

.user-avatar-placeholder i {
    font-size: 1rem;
}

.user-avatar-lg.user-avatar-placeholder i {
    font-size: 1.8rem;
}

/* User Detail Grid */
.user-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.user-detail-item {
    padding: 0.75rem 1rem;
    background: #FAFBFC;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.user-detail-item:nth-child(odd) {
    border-right: 1px solid rgba(0, 0, 0, 0.04);
}

.user-detail-item:nth-last-child(-n+2) {
    border-bottom: none;
}

.user-detail-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9CA3AF;
    margin-bottom: 0.2rem;
}

.user-detail-value {
    font-size: 0.855rem;
    font-weight: 500;
    color: #1E1F2E;
}

/* Category Thumbnails */
.cat-thumb {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    object-fit: cover;
    flex-shrink: 0;
}

.cat-thumb-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #F0F1F8, #E8E9F2);
}

.cat-thumb-placeholder i {
    font-size: 0.85rem;
    color: #A5B4FC;
}

/* ── Settings Page ──────────────────────────────────────── */

/* Settings Tab Navigation */
.settings-tabs {
    display: flex;
    gap: 0.5rem;
    padding: 0.35rem;
    background: #fff;
    border-radius: 14px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.035);
}

.settings-tab {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.7rem 1.25rem;
    border-radius: 10px;
    font-size: 0.84rem;
    font-weight: 550;
    color: #6B7280;
    text-decoration: none;
    transition: all 0.2s ease;
    flex: 1;
    justify-content: center;
}

.settings-tab i {
    font-size: 1rem;
    opacity: 0.5;
    transition: opacity 0.2s ease;
}

.settings-tab:hover {
    color: #374151;
    background: rgba(99, 102, 241, 0.04);
}

.settings-tab:hover i {
    opacity: 0.7;
}

.settings-tab.active {
    color: #fff;
    background: linear-gradient(135deg, #6366F1 0%, #818CF8 100%);
    box-shadow: 0 2px 8px rgba(99, 102, 241, 0.25);
}

.settings-tab.active i {
    opacity: 1;
}

/* Color Picker Group */
.color-picker-group {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    padding: 0.45rem 0.7rem;
    border: 1.5px solid rgba(0, 0, 0, 0.08);
    border-radius: 10px;
    background: #FAFBFC;
    transition: border-color 0.2s ease;
}

.color-picker-group:hover {
    border-color: rgba(0, 0, 0, 0.14);
}

.color-picker-swatch {
    width: 32px;
    height: 32px;
    padding: 0;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
}

.color-picker-swatch::-webkit-color-swatch-wrapper {
    padding: 0;
}

.color-picker-swatch::-webkit-color-swatch {
    border: none;
    border-radius: 6px;
}

.color-picker-swatch::-moz-color-swatch {
    border: none;
    border-radius: 6px;
}

.color-picker-hex {
    font-size: 0.78rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 550;
    color: #374151;
    letter-spacing: 0.02em;
}

/* Card Colors Grid */
.card-colors-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.card-color-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.3rem 0.5rem 0.3rem 0.3rem;
    background: #FAFBFC;
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 10px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.card-color-chip:hover {
    border-color: rgba(0, 0, 0, 0.12);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

.card-color-input {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 2px solid rgba(0, 0, 0, 0.08);
    border-radius: 7px;
    cursor: pointer;
    flex-shrink: 0;
    appearance: none;
    -webkit-appearance: none;
}

.card-color-input::-webkit-color-swatch-wrapper {
    padding: 0;
}

.card-color-input::-webkit-color-swatch {
    border: none;
    border-radius: 5px;
}

.card-color-input::-moz-color-swatch {
    border: none;
    border-radius: 5px;
}

.card-color-hex {
    font-size: 0.72rem;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-weight: 550;
    color: #6B7280;
    letter-spacing: 0.02em;
    min-width: 52px;
}

.card-color-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    border: none;
    background: none;
    color: #D1D5DB;
    font-size: 0.8rem;
    border-radius: 5px;
    cursor: pointer;
    padding: 0;
    transition: color 0.15s ease, background 0.15s ease;
}

.card-color-remove:hover {
    color: #EF4444;
    background: rgba(239, 68, 68, 0.06);
}

/* Logo Preview */
.settings-logo-preview {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.75rem 1rem;
    background: #FAFBFC;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 12px;
}

.settings-logo-preview img {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    object-fit: contain;
    border: 1.5px solid rgba(0, 0, 0, 0.06);
    flex-shrink: 0;
}

/* Banner Preview */
.settings-banner-preview {
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.05);
}

.settings-banner-preview img {
    width: 100%;
    height: auto;
    max-height: 160px;
    object-fit: cover;
    display: block;
}

/* Status Row (Force Update) */
.settings-status-row {
    display: flex;
    gap: 0.75rem;
}

.settings-status-item {
    flex: 1;
    padding: 0.65rem 0.85rem;
    background: #FAFBFC;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 9px;
    text-align: center;
}

.settings-status-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9CA3AF;
    margin-bottom: 0.25rem;
}

.settings-status-value {
    font-size: 0.855rem;
    font-weight: 600;
    color: #1E1F2E;
}

@media (max-width: 575.98px) {
    .settings-tabs {
        flex-direction: column;
        gap: 0.25rem;
    }

    .settings-tab {
        justify-content: flex-start;
    }

    .card-colors-grid {
        flex-direction: column;
    }

    .card-color-chip {
        width: 100%;
    }

    .settings-status-row {
        flex-direction: column;
    }
}

/* ── Ad Network Cards (Ads Manager) ─────────────────────── */

.ad-network-card {
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    border: 1.5px solid transparent;
}

.ad-network-active {
    border-color: rgba(99, 102, 241, 0.2);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.03), 0 6px 24px rgba(0, 0, 0, 0.045), 0 0 0 3px rgba(99, 102, 241, 0.04);
}

/* ── Notification Icon ──────────────────────────────────── */

.notif-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.08), rgba(251, 191, 36, 0.12));
    flex-shrink: 0;
}

.notif-icon i {
    font-size: 0.95rem;
    color: #F59E0B;
}

/* ── Product Icon (Subscription) ────────────────────────── */

.product-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(129, 140, 248, 0.12));
    flex-shrink: 0;
}

.product-icon i {
    font-size: 0.95rem;
    color: #6366F1;
}

/* ── Service Account Status (Google Settings) ────────────── */

.sa-status-card {
    display: flex;
    align-items: center;
    gap: 0.85rem;
    padding: 0.85rem 1rem;
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.04), rgba(52, 211, 153, 0.06));
    border: 1px solid rgba(16, 185, 129, 0.12);
    border-radius: 12px;
    overflow: hidden;
}

.sa-status-icon {
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(16, 185, 129, 0.1);
    flex-shrink: 0;
}

.sa-status-icon i {
    font-size: 1rem;
    color: #059669;
}

/* ── Audit Log Badges + JSON Block ──────────────────────── */

.badge-danger-soft {
    background: linear-gradient(135deg, rgba(239, 68, 68, 0.08), rgba(248, 113, 113, 0.12));
    color: #DC2626;
    font-weight: 600;
    font-size: 0.68rem;
    letter-spacing: 0.03em;
    padding: 0.35em 0.7em;
    border-radius: 6px;
    text-transform: uppercase;
}

.audit-json-block {
    background: #FAFBFC;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    padding: 0.85rem 1rem;
    font-size: 0.76rem;
    line-height: 1.6;
    margin: 0;
    color: #374151;
    overflow-x: auto;
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
}

/* ── Health Check Items (Monitoring) ─────────────────────── */

.health-check-item {
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    padding: 0.7rem 0.85rem;
    background: #FAFBFC;
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-radius: 10px;
}

.health-check-item i {
    font-size: 1rem;
    margin-top: 0.1rem;
    flex-shrink: 0;
}

.health-check-name {
    font-size: 0.82rem;
    font-weight: 600;
    color: #1E1F2E;
    line-height: 1.2;
}

.health-check-detail {
    font-size: 0.74rem;
    color: #9CA3AF;
    margin-top: 0.1rem;
}

/* Counter Dot */
.counter-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, #6366F1, #818CF8);
    flex-shrink: 0;
}

/* ── Trash Tab Count Badge ──────────────────────────────── */

.trash-tab-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0 5px;
    background: rgba(239, 68, 68, 0.12);
    color: #EF4444;
    margin-left: 0.25rem;
}

.settings-tab.active .trash-tab-count {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

/* Restore Button */
.btn-action-restore {
    color: #10B981;
    background: rgba(16, 185, 129, 0.06);
    border-color: rgba(16, 185, 129, 0.1);
}

.btn-action-restore:hover {
    color: #059669;
    background: rgba(16, 185, 129, 0.13);
    border-color: rgba(16, 185, 129, 0.22);
}

/* Page Icon (Pages Manager) */
.page-icon {
    width: 38px;
    height: 38px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.08), rgba(129, 140, 248, 0.12));
    flex-shrink: 0;
}

.page-icon i {
    font-size: 0.95rem;
    color: #6366F1;
}

/* Page Detail Grid */
.page-detail-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0;
    border: 1px solid rgba(0, 0, 0, 0.05);
    border-radius: 10px;
    overflow: hidden;
}

.page-detail-item {
    padding: 0.75rem 1rem;
    background: #FAFBFC;
    border-bottom: 1px solid rgba(0, 0, 0, 0.04);
}

.page-detail-item:nth-child(odd) {
    border-right: 1px solid rgba(0, 0, 0, 0.04);
}

.page-detail-item:nth-last-child(-n+2) {
    border-bottom: none;
}

.page-detail-label {
    font-size: 0.68rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #9CA3AF;
    margin-bottom: 0.2rem;
}

.page-detail-value {
    font-size: 0.855rem;
    font-weight: 500;
    color: #1E1F2E;
}

/* Page Preview */
.page-preview {
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 12px;
    padding: 1.5rem;
    background: #FAFBFC;
    margin-top: 1rem;
    font-size: 0.875rem;
    line-height: 1.7;
    color: #374151;
}

/* ── Login Page — Split-Screen Enterprise Layout ─────────── */

.login-wrapper {
    min-height: 100vh;
    display: flex;
    background: #F3F4F8;
}

/* ── Left Branding Panel ── */

.login-brand-panel {
    width: 42%;
    min-height: 100vh;
    background:
        url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E"),
        linear-gradient(160deg, #6862F0 0%, #524DC8 42%, #3B3A52 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
    padding: 4rem 3.5rem;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.login-brand-panel::before {
    content: '';
    position: absolute;
    top: -12%;
    right: -8%;
    width: 340px;
    height: 340px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.03);
    pointer-events: none;
}

.login-brand-panel::after {
    content: '';
    position: absolute;
    bottom: -8%;
    left: -6%;
    width: 240px;
    height: 240px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.02);
    pointer-events: none;
}

.login-brand-logo {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.11);
    backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    margin-bottom: 2.25rem;
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.login-brand-logo-img {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    object-fit: contain;
    margin-bottom: 2.25rem;
}

.login-card-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: contain;
    margin-bottom: 1.25rem;
}

.login-brand-headline {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.035em;
    line-height: 1.14;
    margin: 0 0 1rem;
}

.login-brand-sub {
    color: rgba(255, 255, 255, 0.42);
    font-size: 0.95rem;
    font-weight: 400;
    line-height: 1.5;
    margin: 0;
    max-width: 310px;
}

.login-brand-footer {
    position: absolute;
    bottom: 2rem;
    left: 3.5rem;
}

.login-brand-footer span {
    font-size: 0.675rem;
    color: rgba(255, 255, 255, 0.18);
    letter-spacing: 0.01em;
}

.login-brand-footer span + span {
    margin-left: 1.25rem;
}

/* ── Right Form Panel ── */

.login-form-panel {
    flex: 1;
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3rem;
    background: #F3F4F8;
}

.login-form-inner {
    width: 100%;
    max-width: 396px;
    animation: loginFadeIn 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes loginFadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-card {
    width: 100%;
    border-radius: 14px;
    padding: 2.85rem 2.5rem 2.35rem;
    background: #FEFEFE;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.02), 0 4px 20px rgba(0, 0, 0, 0.035), 0 16px 48px rgba(0, 0, 0, 0.04);
}

.login-brand-icon {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    background: linear-gradient(155deg, var(--sa-primary), #918CFF);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.3rem;
    margin-bottom: 1.25rem;
}

.login-card h2 {
    color: #16162A;
    font-weight: 750;
    font-size: 1.6rem;
    letter-spacing: -0.025em;
    margin-bottom: 0.3rem;
}

.login-subtitle {
    color: #898DA2;
    font-size: 0.9rem;
    margin-bottom: 2.15rem;
}

/* Login form inputs */
.login-card .form-label {
    font-size: 0.8rem;
    font-weight: 600;
    color: #3A3A4E;
    letter-spacing: 0.01em;
    margin-bottom: 0.4rem;
}

.login-card .form-control {
    background: #F9F9FB;
    border: 1.5px solid rgba(0, 0, 0, 0.07);
    border-radius: 9px;
    padding: 0.725rem 0.875rem;
    font-size: 0.925rem;
    color: var(--sa-text);
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    height: 47px;
}

.login-card .form-control:hover {
    border-color: rgba(0, 0, 0, 0.12);
}

.login-card .form-control:focus {
    border-color: var(--sa-primary);
    box-shadow: 0 0 0 2px rgba(108, 99, 255, 0.07);
    outline: none;
    background: #fff;
}

.login-card .form-control::placeholder {
    color: #B2B7C6;
}

/* Login button */
.login-card .btn-login {
    background: linear-gradient(155deg, #6C63FF 0%, #5346DE 100%);
    border: none;
    border-radius: 9px;
    color: #fff;
    font-weight: 600;
    font-size: 0.925rem;
    letter-spacing: 0.005em;
    padding: 0;
    height: 47px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.45rem;
    width: 100%;
    box-shadow: 0 1px 2px rgba(108, 99, 255, 0.1), 0 3px 10px rgba(108, 99, 255, 0.16);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    cursor: pointer;
    position: relative;
}

.login-card .btn-login::after {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, transparent 60%);
    pointer-events: none;
}

.login-card .btn-login:hover {
    transform: translateY(-0.5px);
    box-shadow: 0 2px 6px rgba(108, 99, 255, 0.14), 0 4px 16px rgba(108, 99, 255, 0.2);
    background: linear-gradient(155deg, #7570FF 0%, #6159F0 100%);
}

.login-card .btn-login:active {
    transform: translateY(0px);
    box-shadow: 0 1px 3px rgba(108, 99, 255, 0.14);
}

.login-card .btn-login:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

.login-card .btn-login .spinner-border {
    width: 0.95rem;
    height: 0.95rem;
    border-width: 2px;
    display: none;
    margin: 0;
    position: relative;
    z-index: 1;
}

.login-card .btn-login .btn-text {
    position: relative;
    z-index: 1;
}

.login-card .btn-login.is-loading .spinner-border {
    display: inline-block;
}

.login-card .btn-login.is-loading .btn-text {
    display: none;
}

/* Trust indicator */
.login-trust {
    text-align: center;
    margin-top: 1.5rem;
    padding-top: 1.25rem;
    border-top: 1px solid rgba(0, 0, 0, 0.04);
}

.login-trust span {
    font-size: 0.7rem;
    color: #A8ADBC;
    letter-spacing: 0.04em;
}

.login-trust i {
    font-size: 0.575rem;
    margin-right: 0.3rem;
    color: #62B89E;
}

/* Alert refinement inside login */
.login-card .alert {
    border-radius: 9px;
    font-size: 0.85rem;
    border: none;
    padding: 0.7rem 0.9rem;
}

/* Field groups spacing */
.login-card .login-field {
    margin-bottom: 1.2rem;
}

.login-card .login-field-last {
    margin-bottom: 1.6rem;
}

/* ── Mobile: Collapse to centered card ── */

@media (max-width: 991.98px) {
    .login-wrapper {
        background:
            url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.025'/%3E%3C/svg%3E"),
            linear-gradient(160deg, #6862F0 0%, #524DC8 42%, #3B3A52 100%);
    }

    .login-brand-panel {
        display: none;
    }

    .login-form-panel {
        background: transparent;
        min-height: 100vh;
        padding: 1.5rem;
    }

    .login-card {
        background: #fff;
        box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05), 0 16px 48px rgba(0, 0, 0, 0.09);
    }
}

@media (max-width: 575.98px) {
    .login-form-panel {
        padding: 1rem;
    }

    .login-card {
        padding: 2.35rem 1.75rem 2rem;
        border-radius: 12px;
    }
}

.drag-handle {
    cursor: grab;
    color: var(--sa-muted);
}

.drag-handle:active {
    cursor: grabbing;
}

.alert-floating {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    min-width: 300px;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from { transform: translateX(100%); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}
