html {
    font-size: 14px;
}

@media (min-width: 768px) {
    html {
        font-size: 16px;
    }
}

:root[data-bs-theme="light"] {
    --clr-bg: #f8fafc;
    --clr-surface: #ffffff;
    --clr-surface-2: #f1f5f9;
    --clr-border: #e2e8f0;
    --clr-accent: #6366f1;
    --clr-accent-2: #0ea5e9;
    --clr-text: #0f172a;
    --clr-muted: #64748b;
    --sidebar-width: 260px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

:root[data-bs-theme="dark"] {
    --clr-bg: #0f172a;
    --clr-surface: #1e293b;
    --clr-surface-2: #334155;
    --clr-border: rgba(255,255,255,0.08);
    --clr-accent: #818cf8;
    --clr-accent-2: #38bdf8;
    --clr-text: #f1f5f9;
    --clr-muted: #94a3b8;
    --sidebar-width: 260px;
    --transition: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

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

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--clr-bg);
    color: var(--clr-text);
    min-height: 100vh;
    display: flex;
}

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

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    padding: 1.5rem 1.4rem;
    border-bottom: 1px solid var(--clr-border);
    text-decoration: none;
}

.sidebar-brand-icon {
    width: 36px; height: 36px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent-2));
    display: flex; align-items: center; justify-content: center;
    font-size: 1rem; color: #fff;
    flex-shrink: 0;
}

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

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

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

.nav-label {
    font-size: 0.65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--clr-muted);
    padding: 0.5rem 0.75rem 0.3rem;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.7rem 1rem;
    border-radius: 12px;
    color: var(--clr-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all var(--transition);
    margin-bottom: 4px;
}

.sidebar-link:hover {
    background: rgba(108, 99, 255, 0.08);
    color: var(--clr-accent);
}

.sidebar-link.active {
    background: var(--clr-accent);
    color: #ffffff !important;
    box-shadow: 0 4px 12px rgba(108, 99, 255, 0.3);
}

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

.sidebar-footer {
    padding: 1rem 0.75rem;
    border-top: 1px solid var(--clr-border);
}

/* ── Main content ─────────────────────────────────────── */
.main-wrapper {
    margin-left: var(--sidebar-width);
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 2rem;
    background: var(--clr-surface);
    border-bottom: 1px solid var(--clr-border);
    position: sticky;
    top: 0; z-index: 50;
}

.topbar-title { font-size: 1.1rem; font-weight: 600; }

.page-content { padding: 2rem; flex: 1; }

/* ── Cards ────────────────────────────────────────────── */
.card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.03);
    overflow: hidden;
}

[data-bs-theme="dark"] .card {
    box-shadow: 0 4px 25px rgba(0,0,0,0.2);
}

.stat-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 16px;
    padding: 1.4rem;
    transition: transform var(--transition), box-shadow var(--transition);
}

.stat-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.1);
}

[data-bs-theme="dark"] .stat-card:hover {
    box-shadow: 0 12px 30px rgba(0,0,0,0.4);
}

.stat-icon {
    width: 44px; height: 44px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.2rem;
    margin-bottom: 0.75rem;
}

.stat-value { font-size: 1.6rem; font-weight: 700; line-height: 1; }
.stat-label { font-size: 0.78rem; color: var(--clr-muted); margin-top: 0.25rem; }

/* ── Responsive Tables ────────────────────────────────── */
@media (max-width: 768px) {
    .table-responsive-stack thead { display: none; }
    .table-responsive-stack tr { 
        display: block; 
        padding: 1.2rem; 
        border-bottom: 1px solid var(--clr-border) !important;
        position: relative;
    }
    .table-responsive-stack td { 
        display: flex; 
        justify-content: space-between; 
        align-items: center; 
        padding: 0.5rem 0 !important;
        border: none !important;
        text-align: right;
    }
    .table-responsive-stack td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--clr-muted);
        text-align: left;
        font-size: 0.75rem;
        text-transform: uppercase;
        letter-spacing: 0.05em;
    }
    .table-responsive-stack td.text-end { text-align: right; justify-content: flex-end; gap: 0.5rem; }
    .table-responsive-stack td.text-end::before { display: none; }
}

/* ── Table ────────────────────────────────────────────── */
.table { color: var(--clr-text); }
.table thead th {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--clr-muted);
    border-color: var(--clr-border);
    padding: 0.75rem 1rem;
    font-weight: 600;
}

.table tbody td {
    border-color: var(--clr-border);
    padding: 0.9rem 1rem;
    vertical-align: middle;
}

.table tbody tr { transition: background var(--transition); }
.table tbody tr:hover { background: rgba(255,255,255,0.03); }

/* ── Badges ───────────────────────────────────────────── */
.badge-active {
    background: rgba(78, 205, 196, 0.15);
    color: var(--clr-accent-2);
    border: 1px solid rgba(78, 205, 196, 0.3);
}

.badge-inactive {
    background: rgba(255,255,255,0.06);
    color: var(--clr-muted);
    border: 1px solid var(--clr-border);
}

.badge-due {
    background: rgba(255, 170, 50, 0.15);
    color: #ffaa32;
    border: 1px solid rgba(255, 170, 50, 0.3);
}

/* ── Soft Status Badges ───────────────────────────────── */
.badge-soft-success {
    background: rgba(16, 185, 129, 0.15);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

.badge-soft-info {
    background: rgba(14, 165, 233, 0.15);
    color: #0ea5e9;
    border: 1px solid rgba(14, 165, 233, 0.3);
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

.badge-soft-warning {
    background: rgba(245, 158, 11, 0.15);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

.badge-soft-danger {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

/* ── Forms ────────────────────────────────────────────── */
.form-control, .form-select {
    background-color: var(--clr-surface-2);
    border: 1px solid var(--clr-border);
    color: var(--clr-text);
    border-radius: 10px;
    padding: 0.6rem 0.9rem;
}

.form-control:focus, .form-select:focus {
    background-color: var(--clr-surface-2);
    border-color: var(--clr-accent);
    color: var(--clr-text);
    box-shadow: 0 0 0 3px rgba(108, 99, 255, 0.2);
}

.form-label { font-size: 0.82rem; font-weight: 500; color: var(--clr-muted); margin-bottom: 0.4rem; }

.btn-primary {
    background: linear-gradient(135deg, var(--clr-accent), #8b83ff);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    padding: 0.55rem 1.4rem;
    transition: opacity var(--transition), transform var(--transition);
}

.btn-primary:hover { opacity: 0.9; transform: translateY(-1px); }

.btn-outline-secondary {
    border-color: var(--clr-border);
    color: var(--clr-muted);
    border-radius: 10px;
}

.btn-outline-secondary:hover { background: var(--clr-surface-2); color: var(--clr-text); border-color: var(--clr-muted); }

/* ── Alerts ───────────────────────────────────────────── */
.alert {
    border-radius: 12px;
    border: 1px solid transparent;
    font-size: 0.875rem;
    padding: 1rem 1.25rem;
}
.alert-success { background: rgba(16, 185, 129, 0.1); border-color: rgba(16, 185, 129, 0.2); color: #10b981; }
.alert-danger { background: rgba(239, 68, 68, 0.1); border-color: rgba(239, 68, 68, 0.2); color: #ef4444; }

/* ── Auth pages ───────────────────────────────────────── */
.auth-wrapper {
    min-height: 100vh;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--clr-bg);
    background-image: radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.05) 0%, transparent 60%),
                      radial-gradient(ellipse at 80% 20%, rgba(14,165,233,0.04) 0%, transparent 50%);
}


.auth-card {
    width: 100%;
    max-width: 420px;
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    border-radius: 20px;
    padding: 2.5rem;
}

.auth-logo {
    width: 52px; height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent-2));
    display: flex; align-items: center; justify-content: center;
    font-size: 1.4rem; color: #fff;
    margin: 0 auto 1.5rem;
}

/* ── Scrollbar ────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--clr-border); border-radius: 4px; }

@media (max-width: 992px) {
    .sidebar { 
        transform: translateX(-100%); 
        box-shadow: 10px 0 30px rgba(0,0,0,0.1);
    }
    .sidebar.show { transform: translateX(0); }
    .main-wrapper { margin-left: 0; }
    .topbar { padding: 0.75rem 1rem; }
    .page-content { padding: 1rem; }
    
    .stat-card { padding: 1rem; }
    .stat-value { font-size: 1.3rem; }
}

.sidebar-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    backdrop-filter: blur(2px);
    z-index: 90;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.sidebar-overlay.show { display: block; opacity: 1; }

/* Hide text on small buttons on mobile */
@media (max-width: 576px) {
    .topbar .btn span, .topbar .btn-primary i + span { display: none; }
    .topbar .btn i { margin-right: 0 !important; }
}

/* Helper classes for theme icons */
[data-bs-theme="dark"] .d-none-dark { display: none !important; }
[data-bs-theme="light"] .d-none-light { display: none !important; }

/* ── Custom Utility Classes ─────────────────────────── */
.fs-xs { font-size: 0.65rem; }
.fs-sm { font-size: 0.75rem; }
.fs-sm-1 { font-size: 0.72rem; }
.fs-sm-2 { font-size: 0.82rem; }
.fs-md { font-size: 0.9rem; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-700 { font-weight: 700; }
.fw-800 { font-weight: 800; }

.page-header-title { font-size: 1.3rem; font-weight: 700; margin: 0; }
.page-header-subtitle { color: var(--clr-muted); font-size: 0.82rem; margin: 0; }

.stat-card-mini {
    min-width: 90px;
    background: var(--clr-surface-2);
    border: none;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 0.5rem 1rem;
    text-align: center;
    border-radius: 12px;
}
.stat-card-mini.min-w-120 { min-width: 120px; }

.stat-card-mini-label {
    font-size: 0.65rem;
    color: var(--clr-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.stat-card-mini-value {
    font-weight: 700;
    font-size: 1rem;
}

.empty-state-icon { font-size: 3.5rem; color: var(--clr-muted); }
.empty-state-text { color: var(--clr-muted); }
.btn-max-w-200 { max-width: 200px; }

.category-badge {
    background: rgba(99, 102, 241, 0.1);
    color: var(--clr-accent);
    border: 1px solid rgba(99, 102, 241, 0.2);
    font-size: 0.72rem;
}

.text-success-soft {
    color: var(--clr-success);
    background: rgba(34, 197, 94, 0.1);
}

.due-date-period { font-size: 0.68rem; color: var(--clr-muted); margin-top: 2px; }

.alert-level-tag {
    padding: 1px 4px;
    border-radius: 3px;
    font-size: 0.65rem;
}

.badge-due-sm { font-size: 0.68rem; }

/* Subscriptions Views */
.payment-table { font-size: 0.85rem; }
.badge-void-sm { font-size: 0.55rem; text-transform: uppercase; }
.text-danger-custom { color: #ef4444; }

/* Edit/Create Views */
.validation-msg-sm { font-size: 0.78rem; }
.select-currency-sm { max-width: 90px; }
.config-card-soft {
    background-color: rgba(var(--clr-primary-rgb), 0.05) !important;
}
.config-header-sm {
    font-weight: 600;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--clr-primary);
}
.hr-muted { border-color: var(--clr-border); margin: 1.5rem 0; }

/* Profile View Styles */
:root {
    --profile-hero-bg: linear-gradient(135deg, #4f46e5 0%, #7c3aed 100%);
}

.profile-hero {
    background: var(--profile-hero-bg);
    border-bottom: 0;
    min-height: 200px;
    display: flex;
    align-items: center;
}

.rounded-top-5 { border-radius: 2rem 2rem 0 0 !important; }
.rounded-bottom-5 { border-radius: 0 0 2rem 2rem !important; }

.glass-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: radial-gradient(circle at top right, rgba(255,255,255,0.1) 0%, transparent 60%);
    pointer-events: none;
}

.profile-avatar {
    width: 100px;
    height: 100px;
    background: #fff;
    border-radius: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255,255,255,0.2);
}

.avatar-text {
    font-size: 2.5rem;
    font-weight: 800;
    color: white;
    text-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.avatar-badge {
    position: absolute;
    bottom: -5px;
    right: -5px;
    background: #10b981;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    border: 3px solid #6366f1;
}

.profile-settings-card {
    background: var(--clr-surface-2);
    margin-top: -1px;
}

#profile-nav .nav-link {
    transition: all 0.2s ease;
    color: var(--clr-text);
    font-weight: 500;
}

#profile-nav .nav-link.active {
    background: var(--clr-surface-3);
    color: var(--clr-accent);
    box-shadow: 0 4px 10px rgba(0,0,0,0.05);
}

#profile-nav .nav-link:hover:not(.active):not(.disabled) {
    background: var(--clr-surface-3);
    transform: translateX(5px);
}

.form-floating-sm > .form-control {
    background: var(--clr-surface-3);
    color: var(--clr-text);
    height: 64px;
}

.form-floating-sm > label {
    padding-left: 1.5rem;
    color: var(--clr-muted);
}

.btn-glide {
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.btn-glide:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(99, 102, 241, 0.4) !important;
}

.slide-in-top {
    animation: slideInTop 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
}

@keyframes slideInTop {
    0% { transform: translateY(-20px); opacity: 0; }
    100% { transform: translateY(0); opacity: 1; }
}

.bg-primary-subtle-soft { background: rgba(99, 102, 241, 0.1) !important; }
.text-primary-emphasis-soft { color: #818cf8 !important; }

/* Categories View Styles */
.category-card {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    background: var(--clr-surface-2);
    border: 1px solid var(--clr-border) !important;
}
.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1) !important;
}

/* Layout Styles */
.user-info-box { background: var(--clr-surface-2); }
.user-avatar-gradient {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--clr-accent), var(--clr-accent-2));
}
.user-name-wrapper { min-width: 0; }
.z-index-2 { z-index: 2; }
.z-index-10 { z-index: 10; }
.bg-transparent { background: transparent !important; }
.cursor-pointer { cursor: pointer; }
.text-truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.max-w-150 { max-width: 150px; }
.surface-2-bg { background: var(--clr-surface-2) !important; }
.border-clr-border { border-color: var(--clr-border) !important; }
.fs-main { font-size: 1rem; }
.fs-sm-high { font-size: 0.85rem; }
.fs-large { font-size: 3rem; }
.fs-3rem { font-size: 3rem; }
.fs-3-5rem { font-size: 3.5rem; }

.icon-box-accent { background: rgba(var(--clr-primary-rgb), 0.1); color: var(--clr-accent); }
/* Actually, let's use the CSS variables for the RGBA colors if available, or just hardcode common ones */
.icon-box-primary { background: rgba(99, 102, 241, 0.1); color: var(--clr-accent); }
.icon-box-sky { background: rgba(14, 165, 233, 0.1); color: var(--clr-accent-2); }
.icon-box-warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.icon-box-danger { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.icon-box-success { background: rgba(16, 185, 129, 0.1); color: #10b981; }

.card-header-sm { padding: 1rem 1.25rem; border-color: var(--clr-border); }
.card-title-sm { font-size: 0.95rem; font-weight: 600; }

.chart-container-350 { max-height: 350px; }
.canvas-350 { height: 350px; }

.w-160 { width: 160px; }
.w-100 { width: 100px; }
.w-80 { width: 80px; }

.detail-summary { cursor: pointer; font-size: 0.75rem; }
.code-block-sm { font-size: 0.7rem; background: rgba(0,0,0,0.05); overflow: auto; max-height: 200px; }

.auth-title { font-size: 1.4rem; font-weight: 700; }
.auth-subtitle { font-size: 0.85rem; color: var(--clr-muted); }

.link-accent { color: var(--clr-accent); text-decoration: none; font-weight: 500; }
.link-accent:hover { text-decoration: underline; }

/* Dashboard specifics */
.dashboard-stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}

/* Reports & Analytics specialized styles */
.metric-card-glass {
    background: linear-gradient(135deg, rgba(var(--clr-accent-rgb), 0.05) 0%, rgba(var(--clr-accent-2-rgb), 0.05) 100%);
    backdrop-filter: blur(10px);
    border: 1px solid var(--clr-border);
    border-radius: 20px;
    padding: 1.5rem;
    transition: transform 0.3s ease;
}

.metric-card-glass:hover {
    transform: translateY(-5px);
    background: linear-gradient(135deg, rgba(var(--clr-accent-rgb), 0.08) 0%, rgba(var(--clr-accent-2-rgb), 0.08) 100%);
}

.growth-badge {
    font-size: 0.75rem;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}

.growth-up { background: rgba(16, 185, 129, 0.1); color: #10b981; }
.growth-down { background: rgba(239, 68, 68, 0.1); color: #ef4444; }

.chart-card {
    background: var(--clr-surface);
    border: 1px solid var(--clr-border);
    box-shadow: 0 10px 30px rgba(0,0,0,0.05);
}

[data-bs-theme="dark"] .chart-card {
    box-shadow: 0 10px 40px rgba(0,0,0,0.3);
}

.card-header-reports {
    background: transparent !important;
    border-bottom: 1px solid var(--clr-border);
    padding: 1.5rem 1.5rem 1rem !important;
}

.report-toggle-group {
    background: var(--clr-surface-2);
    padding: 4px;
    border-radius: 12px;
    display: inline-flex;
}

.report-toggle-btn {
    padding: 6px 16px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    transition: all 0.2s ease;
    border: none;
    color: var(--clr-muted);
    background: transparent;
}

.report-toggle-btn.active {
    background: var(--clr-surface);
    color: var(--clr-accent);
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}

.border-dashed {
    border-style: dashed !important;
}

/* Color RGB variables for RGBA usage */
:root[data-bs-theme="light"] {
    --clr-accent-rgb: 99, 102, 241;
    --clr-accent-2-rgb: 14, 165, 233;
}

:root[data-bs-theme="dark"] {
    --clr-accent-rgb: 129, 140, 248;
    --clr-accent-2-rgb: 56, 189, 189;
}

/* Priority Billing Timeline & Pulse Styles */
.billing-timeline {
    position: relative;
    padding-left: 2rem;
}

.timeline-item {
    position: relative;
    padding-bottom: 2rem;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: -1.45rem;
    top: 5px;
    width: 2px;
    height: 100%;
    background: var(--clr-border);
}

.timeline-item:last-child::before { display: none; }

.timeline-dot {
    position: absolute;
    left: -1.75rem;
    top: 5px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--clr-muted);
    border: 3px solid var(--clr-surface);
    z-index: 2;
}

.timeline-dot.critical { background: #ef4444; box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.1); }
.timeline-dot.warning { background: #f59e0b; }
.timeline-dot.upcoming { background: #10b981; }

.priority-badge {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 2px 6px;
    border-radius: 4px;
    margin-bottom: 4px;
    display: inline-block;
}

.priority-critical { background: rgba(239, 68, 68, 0.1); color: #ef4444; }
.priority-warning { background: rgba(245, 158, 11, 0.1); color: #f59e0b; }
.priority-upcoming { background: rgba(16, 185, 129, 0.1); color: #10b981; }

.pulse-critical {
    animation: pulse-red 2s infinite;
}

@keyframes pulse-red {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

.share-progress {
    height: 4px !important;
    border-radius: 2px;
    background-color: rgba(var(--clr-accent-rgb), 0.1);
}

/* Dark Theme Form Controls */
[data-bs-theme="dark"] .form-control-dark {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.9);
}

[data-bs-theme="dark"] .form-control-dark:focus {
    background-color: rgba(255, 255, 255, 0.08);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.9);
    box-shadow: 0 0 0 0.25rem rgba(var(--clr-accent-rgb), 0.25);
}

[data-bs-theme="dark"] .form-control-dark::placeholder {
    color: rgba(255, 255, 255, 0.4);
}

[data-bs-theme="dark"] .input-group-text.form-control-dark {
    background-color: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.1);
    color: rgba(255, 255, 255, 0.7);
}

/* ── Subscription Form Styles ──────────────────────────── */
.subscription-form-wrapper {
    max-width: 900px;
    margin: 0 auto;
}

.form-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
}

/* Dark Theme Header */
[data-bs-theme="dark"] .form-header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
}

[data-bs-theme="dark"] .form-header-back:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.95);
}

[data-bs-theme="dark"] .form-header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0;
    background: linear-gradient(135deg, #ffffff 0%, rgba(255, 255, 255, 0.8) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

[data-bs-theme="dark"] .form-header-content p {
    font-size: 0.95rem;
    color: rgba(255, 255, 255, 0.6);
    margin: 0.5rem 0 0 0;
}

/* Light Theme Header */
[data-bs-theme="light"] .form-header-back {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    color: rgba(0, 0, 0, 0.6);
    text-decoration: none;
}

[data-bs-theme="light"] .form-header-back:hover {
    background: rgba(0, 0, 0, 0.08);
    border-color: rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.8);
}

[data-bs-theme="light"] .form-header-content h1 {
    font-size: 2rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0;
    color: rgba(0, 0, 0, 0.9);
}

[data-bs-theme="light"] .form-header-content p {
    font-size: 0.95rem;
    color: rgba(0, 0, 0, 0.6);
    margin: 0.5rem 0 0 0;
}

/* Dark Theme Tabs */
[data-bs-theme="dark"] .form-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    overflow-x: auto;
    padding-bottom: 0;
}

[data-bs-theme="dark"] .form-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: rgba(255, 255, 255, 0.6);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

[data-bs-theme="dark"] .form-tab:hover {
    color: rgba(255, 255, 255, 0.8);
}

[data-bs-theme="dark"] .form-tab.active {
    color: #00d9ff;
    border-bottom-color: #00d9ff;
}

[data-bs-theme="dark"] .form-tab i {
    margin-right: 0.5rem;
    opacity: 0.8;
}

/* Light Theme Tabs */
[data-bs-theme="light"] .form-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 2rem;
    border-bottom: 1px solid rgba(0, 0, 0, 0.1);
    overflow-x: auto;
    padding-bottom: 0;
}

[data-bs-theme="light"] .form-tab {
    padding: 1rem 1.5rem;
    background: none;
    border: none;
    color: rgba(0, 0, 0, 0.6);
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
    position: relative;
}

[data-bs-theme="light"] .form-tab:hover {
    color: rgba(0, 0, 0, 0.8);
}

[data-bs-theme="light"] .form-tab.active {
    color: #0099ff;
    border-bottom-color: #0099ff;
}

[data-bs-theme="light"] .form-tab i {
    margin-right: 0.5rem;
    opacity: 0.8;
}

.form-tab-content {
    display: none;
    animation: fadeIn 0.3s ease;
}

.form-tab-content.active {
    display: block;
}

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

/* Dark Theme Card */
[data-bs-theme="dark"] .form-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    backdrop-filter: blur(10px);
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .form-card:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
}

/* Light Theme Card */
[data-bs-theme="light"] .form-card {
    background: rgba(0, 0, 0, 0.02);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 12px;
    padding: 1.5rem;
    transition: all 0.3s ease;
}

[data-bs-theme="light"] .form-card:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.15);
}

.form-section {
    margin-bottom: 2rem;
}

.form-section:last-child {
    margin-bottom: 0;
}

/* Dark Theme Section Title */
[data-bs-theme="dark"] .form-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(255, 255, 255, 0.5);
}

[data-bs-theme="dark"] .form-section-title i {
    font-size: 1rem;
    color: #00d9ff;
}

/* Light Theme Section Title */
[data-bs-theme="light"] .form-section-title {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
    font-size: 0.85rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: rgba(0, 0, 0, 0.5);
}

[data-bs-theme="light"] .form-section-title i {
    font-size: 1rem;
    color: #0099ff;
}

.form-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
    margin-bottom: 1.5rem;
}

.form-row.two-col {
    grid-template-columns: repeat(2, 1fr);
}

.form-row.three-col {
    grid-template-columns: repeat(3, 1fr);
}

@media (max-width: 768px) {
    .form-row.two-col,
    .form-row.three-col {
        grid-template-columns: 1fr;
    }
}

.form-group {
    display: flex;
    flex-direction: column;
}

/* Dark Theme Label */
[data-bs-theme="dark"] .form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Light Theme Label */
[data-bs-theme="light"] .form-label {
    font-size: 0.85rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.8);
    margin-bottom: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.form-label .info-icon {
    width: 16px;
    height: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0.7;
}

/* Dark Theme Form Controls */
[data-bs-theme="dark"] .form-control,
[data-bs-theme="dark"] .form-select {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.95) !important;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .form-control:focus,
[data-bs-theme="dark"] .form-select:focus {
    background: rgba(255, 255, 255, 0.08) !important;
    border-color: #00d9ff !important;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1) !important;
    outline: none;
}

[data-bs-theme="dark"] .form-control::placeholder {
    color: rgba(255, 255, 255, 0.4) !important;
}

/* Dark Theme Select Options */
[data-bs-theme="dark"] .form-select option {
    background: #1a1a2e;
    color: rgba(255, 255, 255, 0.95);
}

/* Light Theme Form Controls */
[data-bs-theme="light"] .form-control,
[data-bs-theme="light"] .form-select {
    background: rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    color: rgba(0, 0, 0, 0.95) !important;
    border-radius: 8px;
    padding: 0.75rem 1rem;
    font-size: 0.95rem;
    transition: all 0.3s ease;
}

[data-bs-theme="light"] .form-control:focus,
[data-bs-theme="light"] .form-select:focus {
    background: rgba(0, 0, 0, 0.08) !important;
    border-color: #0099ff !important;
    box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.1) !important;
    outline: none;
}

[data-bs-theme="light"] .form-control::placeholder {
    color: rgba(0, 0, 0, 0.4) !important;
}

/* Light Theme Select Options */
[data-bs-theme="light"] .form-select option {
    background: #ffffff;
    color: rgba(0, 0, 0, 0.95);
}

.input-group .form-select,
.input-group .form-control {
    border-radius: 8px 0 0 8px;
}

.input-group .form-select:last-child {
    border-radius: 0 8px 8px 0;
}

/* Dark Theme Input Group */
[data-bs-theme="dark"] .input-group-text {
    background: rgba(255, 255, 255, 0.05) !important;
    border: 1px solid rgba(255, 255, 255, 0.15) !important;
    color: rgba(255, 255, 255, 0.7) !important;
}

/* Light Theme Input Group */
[data-bs-theme="light"] .input-group-text {
    background: rgba(0, 0, 0, 0.05) !important;
    border: 1px solid rgba(0, 0, 0, 0.15) !important;
    color: rgba(0, 0, 0, 0.7) !important;
}

/* Dark Theme Checkbox */
[data-bs-theme="dark"] .form-check-input {
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

[data-bs-theme="dark"] .form-check-input:checked {
    background: #00d9ff;
    border-color: #00d9ff;
    box-shadow: none;
}

[data-bs-theme="dark"] .form-check-input:focus {
    border-color: #00d9ff;
    box-shadow: 0 0 0 3px rgba(0, 217, 255, 0.1);
}

/* Light Theme Checkbox */
[data-bs-theme="light"] .form-check-input {
    width: 1.5rem;
    height: 1.5rem;
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: all 0.3s ease;
}

[data-bs-theme="light"] .form-check-input:checked {
    background: #0099ff;
    border-color: #0099ff;
    box-shadow: none;
}

[data-bs-theme="light"] .form-check-input:focus {
    border-color: #0099ff;
    box-shadow: 0 0 0 3px rgba(0, 153, 255, 0.1);
}

.form-check {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

/* Dark Theme Checkbox Label */
[data-bs-theme="dark"] .form-check-label {
    color: rgba(255, 255, 255, 0.9);
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}

/* Light Theme Checkbox Label */
[data-bs-theme="light"] .form-check-label {
    color: rgba(0, 0, 0, 0.9);
    font-weight: 500;
    cursor: pointer;
    margin: 0;
}

.text-validation {
    font-size: 0.8rem;
    color: #ff6b6b;
    margin-top: 0.4rem;
}

/* Dark Theme Footer */
[data-bs-theme="dark"] .form-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

/* Light Theme Footer */
[data-bs-theme="light"] .form-footer {
    display: flex;
    gap: 1rem;
    justify-content: flex-end;
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid rgba(0, 0, 0, 0.1);
}

/* Dark Theme Cancel Button */
[data-bs-theme="dark"] .btn-cancel {
    padding: 0.8rem 1.75rem;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: rgba(255, 255, 255, 0.8);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

[data-bs-theme="dark"] .btn-cancel:hover {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.3);
    color: rgba(255, 255, 255, 0.95);
}

/* Light Theme Cancel Button */
[data-bs-theme="light"] .btn-cancel {
    padding: 0.8rem 1.75rem;
    background: rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.15);
    color: rgba(0, 0, 0, 0.8);
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

[data-bs-theme="light"] .btn-cancel:hover {
    background: rgba(0, 0, 0, 0.12);
    border-color: rgba(0, 0, 0, 0.2);
    color: rgba(0, 0, 0, 0.95);
}

.btn-submit {
    padding: 0.8rem 1.75rem;
    background: linear-gradient(135deg, #00d9ff 0%, #0099ff 100%);
    border: none;
    color: #000;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    box-shadow: 0 4px 15px rgba(0, 217, 255, 0.3);
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 217, 255, 0.4);
}

.btn-submit:active {
    transform: translateY(0);
}

/* Dark Theme Validation Alert */
[data-bs-theme="dark"] .validation-alert {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #ff8a8a;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

/* Light Theme Validation Alert */
[data-bs-theme="light"] .validation-alert {
    background: rgba(255, 107, 107, 0.15);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: #e63946;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.mt-3 {
    margin-top: 1rem !important;
}