:root {
    --primary: #475569;
    --primary-hover: #334155;
    --secondary: #10B981;
    --background: #F8FAFC;
    --surface: rgba(255, 255, 255, 0.85);
    --text: #1E293B;
    --text-muted: #64748B;
    --border: rgba(0, 0, 0, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.05);
    --glass-blur: blur(12px);
}

[data-theme="dark"] {
    --primary: #4F46E5;
    --primary-hover: #4338CA;
    --secondary: #10B981;
    --background: #0F172A;
    --surface: rgba(30, 41, 59, 0.7);
    --text: #F8FAFC;
    --text-muted: #94A3B8;
    --border: rgba(255, 255, 255, 0.1);
    --glass-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    --glass-blur: blur(12px);
}

[data-theme="dark"] body {
    background: linear-gradient(135deg, #0F172A 0%, #1E1B4B 100%);
}

/* Payment Under Verification card (subscription tab) - theme aware */
.pv-card { max-width: 560px; margin: 20px auto; text-align: center; }
.pv-inner { background: rgba(245, 158, 11, 0.10); border: 1.5px solid #f59e0b; border-radius: 16px; padding: 32px 28px; }
.pv-icon { width: 64px; height: 64px; border-radius: 50%; background: #f59e0b; color: #fff; display: flex; align-items: center; justify-content: center; margin: 0 auto 16px; }
.pv-hourglass { width: 34px; height: 34px; overflow: visible; transform-origin: 50% 50%; animation: pvFlip 4s ease-in-out infinite; }
.pv-sand-top { transform-origin: 12px 9.4px; animation: pvSandTop 4s ease-in-out infinite; }
.pv-sand-bottom { transform-origin: 12px 18.8px; animation: pvSandBottom 4s ease-in-out infinite; }
.pv-stream { animation: pvStream 4s linear infinite; }
@keyframes pvSandTop { 0%,6% { transform: scaleY(1); } 55%,100% { transform: scaleY(0.06); } }
@keyframes pvSandBottom { 0%,6% { transform: scaleY(0.06); } 55%,100% { transform: scaleY(1); } }
@keyframes pvStream { 0%,8% { opacity: 0; } 14%,50% { opacity: 1; } 58%,100% { opacity: 0; } }
@keyframes pvFlip { 0%,60% { transform: rotate(0deg); } 80%,100% { transform: rotate(180deg); } }
.pv-title { margin: 0 0 8px; font-size: 1.4rem; color: #b45309; }
.pv-desc { margin: 0 0 22px; font-size: 0.95rem; line-height: 1.6; color: var(--text-muted); }
.pv-desc strong { color: #b45309; }
.pv-details { text-align: left; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 18px 20px; margin: 0 0 20px; font-size: 0.9rem; color: var(--text-muted); }
.pv-row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--border); }
.pv-row:last-child { border-bottom: none; }
.pv-row strong { color: var(--text); word-break: break-word; }
.pv-row .pv-green { color: #059669; }
.pv-row .pv-amber { color: #d97706; }
.pv-actions { display: flex; gap: 10px; justify-content: center; margin: 0 0 16px; flex-wrap: wrap; }
.pv-cancel { color: #ef4444 !important; }
.pv-contact { text-align: left; background: rgba(16, 185, 129, 0.08); border: 1px solid rgba(16, 185, 129, 0.25); border-radius: 12px; padding: 16px 20px; margin: 0 0 6px; font-size: 0.88rem; color: var(--text-muted); }
.pv-contact-head { font-weight: 700; color: #059669; margin-bottom: 8px; }
.pv-contact a { color: #059669; }
.pv-contact .pv-upi { color: var(--text); }

[data-theme="dark"] .pv-title,
[data-theme="dark"] .pv-desc strong { color: #fbbf24; }
[data-theme="dark"] .pv-row .pv-green { color: #34d399; }
[data-theme="dark"] .pv-row .pv-amber { color: #fbbf24; }
[data-theme="dark"] .pv-contact-head,
[data-theme="dark"] .pv-contact a { color: #10b981; }

/* background-color, never the `background` shorthand: these dark rules outrank the
   custom-arrow rules on .input-group/.filters select, and a shorthand resets
   background-repeat/position/size, which tiles the chevron across the whole field. */
[data-theme="dark"] .input-group select,
[data-theme="dark"] .input-group input {
    background-color: rgba(255, 255, 255, 0.05);
    color: white;
}

[data-theme="dark"] .input-group select:focus,
[data-theme="dark"] .input-group input:focus {
    background-color: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .input-group select option,
[data-theme="dark"] .filters select option {
    background: #1E293B;
    color: white;
}

[data-theme="dark"] .btn-secondary {
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

[data-theme="dark"] .btn-secondary:hover {
    background: rgba(255, 255, 255, 0.2);
}

[data-theme="dark"] .nav-links li:hover,
[data-theme="dark"] .nav-links li.active {
    background: rgba(255, 255, 255, 0.1);
}

[data-theme="dark"] .table th {
    background: rgba(0, 0, 0, 0.2);
}

[data-theme="dark"] .table tr:hover {
    background: rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, #818CF8 100%);
}

[data-theme="dark"] .close:hover {
    color: white;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
}

body {
    background: linear-gradient(135deg, #F8FAFC 0%, #E2E8F0 100%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
}

.login-body {
    align-items: center;
    justify-content: center;
}

.glassmorphism {
    background: var(--surface);
    backdrop-filter: var(--glass-blur);
    -webkit-backdrop-filter: var(--glass-blur);
    border: 1px solid var(--border);
    box-shadow: var(--glass-shadow);
    border-radius: 16px;
}

/* Login Page */
.login-container {
    padding: 40px;
    width: 100%;
    max-width: 400px;
    text-align: center;
}

.login-header {
    margin-bottom: 30px;
}

.login-logo {
    width: 80px;
    height: auto;
    margin-bottom: 15px;
    border-radius: 12px;
}

.input-group {
    margin-bottom: 20px;
    text-align: left;
}

.input-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.input-group input,
.input-group select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
    font-size: 1rem;
    transition: all 0.3s ease;
}

.input-group input:focus,
.input-group select:focus {
    outline: none;
    border-color: var(--primary);
    background: rgba(0, 0, 0, 0.08);
}

.input-group select option {
    background: white;
    color: var(--text);
}

.btn-primary {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    background: var(--primary);
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.1s ease;
}

.btn-primary:hover {
    background: var(--primary-hover);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-secondary {
    padding: 10px 16px;
    border: none;
    border-radius: 8px;
    background: rgba(0, 0, 0, 0.1);
    color: var(--text);
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-secondary:hover {
    background: rgba(0, 0, 0, 0.15);
}

.error-msg {
    color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* Dashboard Layout */
.sidebar {
    width: 260px;
    height: 100vh;
    max-height: 100vh;
    position: fixed;
    left: 0;
    top: 0;
    padding: 20px 14px;
    display: flex;
    flex-direction: column;
    border-radius: 0;
    border-right: 1px solid var(--border);
    border-top: none;
    border-bottom: none;
    border-left: none;
    z-index: 100;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar::-webkit-scrollbar {
    width: 4px;
}

.sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
    background: rgba(0, 0, 0, 0.12);
    border-radius: 4px;
}

[data-theme="dark"] .sidebar::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.15);
}

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

.sidebar-logo {
    width: 38px;
    height: 38px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.nav-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    min-height: 0;
}

.nav-links li {
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-muted);
    transition: all 0.2s ease;
    font-size: 0.9rem;
    font-weight: 500;
    white-space: nowrap;
}

.nav-links li svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-links li:hover,
.nav-links li.active {
    background: rgba(0, 0, 0, 0.05);
    color: var(--text);
}

.nav-links li.active {
    background: var(--primary);
    color: white;
}

.nav-divider {
    height: 1px;
    background: var(--border);
    margin: 6px 0;
    list-style: none;
    pointer-events: none;
    flex-shrink: 0;
}

/* Subscription Duration Progress Bar */
.nav-sub-progress-container {
    padding: 6px 4px !important;
    margin: 4px 0 !important;
    background: transparent !important;
    list-style: none !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: center !important;
    cursor: pointer;
    flex-shrink: 0;
    transition: opacity 0.2s ease;
    border-radius: 8px;
}

.nav-sub-progress-container:hover {
    background: rgba(0, 0, 0, 0.03) !important;
}

[data-theme="dark"] .nav-sub-progress-container:hover {
    background: rgba(255, 255, 255, 0.03) !important;
}

.nav-sub-progress-track {
    width: 100%;
    height: 12px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 9999px;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
}

[data-theme="dark"] .nav-sub-progress-track {
    background: rgba(255, 255, 255, 0.12);
    box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.35);
}

.nav-sub-progress-bar {
    height: 100%;
    border-radius: 9999px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-sub-progress-bar.sub-progress-normal {
    background: linear-gradient(90deg, #10b981 0%, #059669 100%);
    box-shadow: 0 0 6px rgba(16, 185, 129, 0.3);
}

.nav-sub-progress-bar.sub-progress-warning {
    background: linear-gradient(90deg, #f59e0b 0%, #d97706 100%);
    box-shadow: 0 0 6px rgba(245, 158, 11, 0.3);
}

.nav-sub-progress-bar.sub-progress-danger {
    background: linear-gradient(90deg, #ef4444 0%, #dc2626 100%);
    box-shadow: 0 0 6px rgba(239, 68, 68, 0.4);
}

.mobile-drawer-sub-progress-container {
    padding: 8px 16px;
    cursor: pointer;
}

/* Login Tabs & Alternate Options */
.login-tabs {
    display: flex;
    background: rgba(0, 0, 0, 0.05);
    padding: 4px;
    border-radius: 10px;
    margin-bottom: 20px;
    gap: 4px;
}

[data-theme="dark"] .login-tabs {
    background: rgba(255, 255, 255, 0.06);
}

.login-tab-btn {
    flex: 1;
    padding: 8px 12px;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--text-muted);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.login-tab-btn:hover {
    color: var(--text);
}

.login-tab-btn.active {
    background: var(--surface);
    color: var(--text);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .login-tab-btn.active {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.login-note-box {
    background: rgba(79, 70, 229, 0.08);
    border-left: 3px solid var(--primary);
    padding: 10px 14px;
    border-radius: 0 8px 8px 0;
    font-size: 0.83rem;
    color: var(--text-muted);
    margin-bottom: 18px;
    line-height: 1.45;
}

[data-theme="dark"] .login-note-box {
    background: rgba(79, 70, 229, 0.15);
    color: #cbd5e1;
}

.logout-link {
    margin-top: auto;
    padding-top: 6px;
    text-decoration: none;
    color: inherit;
    display: block;
    flex-shrink: 0;
}

.logout-link li {
    color: #ef4444 !important;
}

.logout-link li:hover {
    background: rgba(239, 68, 68, 0.12) !important;
    color: #dc2626 !important;
}

.main-content {
    margin-left: 260px;
    padding: 35px;
    width: calc(100% - 260px);
}

.tab-content {
    display: none;
    animation: fadeIn 0.4s ease forwards;
}

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

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

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

.header h2 {
    font-size: 1.8rem;
    font-weight: 600;
}

.header .btn-primary {
    width: auto;
}

/* Cards Grid */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 24px;
    margin-bottom: 30px;
}

.card {
    padding: 24px;
    transition: transform 0.3s ease;
}

.card:hover {
    transform: translateY(-5px);
}

.card h4 {
    color: var(--text-muted);
    font-size: 1rem;
    margin-bottom: 12px;
    font-weight: 400;
}

.card .amount {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.card .subtitle {
    font-size: 0.9rem;
    color: var(--secondary);
}

.card.highlight {
    background: linear-gradient(135deg, var(--primary) 0%, #64748B 100%);
    border: none;
}

.card.highlight h4,
.card.highlight .amount {
    color: white;
}

/* Charts */
.charts-container {
    width: 100%;
    margin-top: 24px;
}

.chart-card {
    padding: 24px;
    height: 400px;
}

/* Filters */
.filters {
    display: flex;
    gap: 12px;
    padding: 18px 22px;
    margin-bottom: 24px;
    align-items: center;
    flex-wrap: wrap;
    border-radius: 14px;
}

.filter-row {
    display: contents;
}

.filters select,
.filters input {
    background-color: rgba(255, 255, 255, 0.7);
    border: 1.5px solid var(--border);
    color: var(--text);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.25s ease;
    min-width: 0;
}

[data-theme="dark"] .filters select,
[data-theme="dark"] .filters input {
    background-color: rgba(255, 255, 255, 0.06);
}

.filters select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 36px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2364748b' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px;
    cursor: pointer;
}

[data-theme="dark"] .filters select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='none' stroke='%2394a3b8' stroke-width='2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.filters select:hover,
.filters input:hover {
    border-color: var(--primary);
    background-color: rgba(79, 70, 229, 0.04);
}

.filters select:focus,
.filters input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
    background-color: white;
}

[data-theme="dark"] .filters select:focus,
[data-theme="dark"] .filters input:focus {
    background-color: rgba(30, 41, 59, 0.9);
}

.filters select option {
    background: var(--surface);
    color: var(--text);
}

.filters .btn-secondary {
    padding: 10px 20px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.88rem;
    background: var(--primary);
    color: white;
    border: none;
    cursor: pointer;
    transition: all 0.25s ease;
}

.filters .btn-secondary:hover {
    background: var(--primary-hover);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(79, 70, 229, 0.25);
}

.filters .btn-secondary[style*="#ef4444"],
.filters .btn-clear-filter {
    background: #ef4444;
    color: white;
    border: none;
}

.filters .btn-secondary[style*="#ef4444"]:hover,
.filters .btn-clear-filter:hover {
    background: #dc2626;
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

/* Tables */
.table-responsive {
    overflow-x: auto;
    border-radius: 12px;
}

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

.table th,
.table td {
    padding: 16px;
    text-align: left;
    border-bottom: 1px solid var(--border);
}

.table th {
    color: var(--text-muted);
    font-weight: 600;
    background: rgba(0, 0, 0, 0.05);
}

.table tr:hover {
    background: rgba(0, 0, 0, 0.05);
}

/* Modals */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    backdrop-filter: blur(4px);
    align-items: center;
    justify-content: center;
}

.modal.active {
    display: flex;
}

.confirm-modal,
#confirmModal {
    z-index: 100000 !important;
}

.modal-content {
    width: 100%;
    max-width: 500px;
    padding: 30px;
    position: relative;
    max-height: 90vh;
    overflow-y: auto;
}

.modal-content h3 {
    margin-bottom: 20px;
}

.close {
    position: absolute;
    top: 20px;
    right: 20px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-muted);
}

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

/* Step-wise Form Design */
.step-form {
    max-width: 520px;
}

.step-form h3 {
    font-size: 1.3rem;
    margin-bottom: 8px;
}

/* Step Progress Bar */
.step-progress {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
    padding: 0 10px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    position: relative;
}

.progress-step span {
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    transition: color 0.3s ease;
}

.progress-step.active span,
.progress-step.done span {
    color: var(--primary);
}

.progress-dot {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: 700;
    border: 2px solid var(--border);
    background: rgba(255, 255, 255, 0.7);
    color: var(--text-muted);
    transition: all 0.3s ease;
}

[data-theme="dark"] .progress-dot {
    background: rgba(255, 255, 255, 0.06);
}

.progress-step.active .progress-dot {
    border-color: var(--primary);
    background: var(--primary);
    color: white;
    box-shadow: 0 3px 12px rgba(79, 70, 229, 0.3);
}

.progress-step.done .progress-dot {
    border-color: var(--secondary);
    background: var(--secondary);
    color: white;
}

.progress-line {
    flex: 1;
    height: 2px;
    background: var(--border);
    margin: 0 8px;
    margin-bottom: 20px;
    border-radius: 2px;
    transition: background 0.3s ease;
}

.progress-line.done {
    background: var(--secondary);
}

/* Form Steps */
.form-step {
    display: none;
    border: 1.5px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 16px;
    transition: border-color 0.3s ease;
    animation: stepFadeIn 0.3s ease;
}

.form-step.active {
    display: block;
}

@keyframes stepFadeIn {
    from { opacity: 0; transform: translateX(12px); }
    to { opacity: 1; transform: translateX(0); }
}

.step-badge {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 16px;
    background: rgba(79, 70, 229, 0.04);
    font-weight: 700;
    font-size: 0.88rem;
    color: var(--text);
    border-bottom: 1px solid var(--border);
}

[data-theme="dark"] .step-badge {
    background: rgba(79, 70, 229, 0.08);
}

.step-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    font-size: 0.75rem;
    font-weight: 700;
    flex-shrink: 0;
}

.form-step:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.06);
}

.step-body {
    padding: 14px 16px;
}

.step-body .input-group {
    margin-bottom: 16px;
}

.step-body .input-group:last-child {
    margin-bottom: 0;
}

.step-row {
    display: flex;
    gap: 14px;
}

.step-row .input-group {
    flex: 1;
}

/* Step Form - Enhanced Inputs */
.step-form .input-group label {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.step-form .input-group input,
.step-form .input-group select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: rgba(255, 255, 255, 0.75);
    color: var(--text);
    font-size: 0.95rem;
    font-weight: 500;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

[data-theme="dark"] .step-form .input-group input,
[data-theme="dark"] .step-form .input-group select {
    background-color: rgba(255, 255, 255, 0.06);
}

.step-form .input-group select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 40px;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%23475569' stroke-width='2.2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    background-size: 16px;
    cursor: pointer;
}

[data-theme="dark"] .step-form .input-group select {
    background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' fill='none' stroke='%2394a3b8' stroke-width='2.2' viewBox='0 0 24 24'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
}

.step-form .input-group input:hover,
.step-form .input-group select:hover {
    border-color: rgba(79, 70, 229, 0.4);
    background-color: rgba(255, 255, 255, 0.9);
}

[data-theme="dark"] .step-form .input-group input:hover,
[data-theme="dark"] .step-form .input-group select:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

.step-form .input-group input:focus,
.step-form .input-group select:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1), 0 1px 3px rgba(0, 0, 0, 0.04);
    background-color: white;
}

[data-theme="dark"] .step-form .input-group input:focus,
[data-theme="dark"] .step-form .input-group select:focus {
    background-color: rgba(30, 41, 59, 0.9);
}

.step-form .input-group input::placeholder {
    color: var(--text-muted);
    opacity: 0.6;
    font-weight: 400;
}

.step-form .input-group select option {
    background: white;
    color: var(--text);
    padding: 8px;
}

[data-theme="dark"] .step-form .input-group select option {
    background: #1E293B;
    color: #F8FAFC;
}

/* Step Navigation */
.step-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 24px;
    padding-top: 16px;
}

.btn-step {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 12px 28px;
    border-radius: 10px;
    font-size: 0.92rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all 0.25s ease;
    letter-spacing: 0.01em;
}

.btn-step-back {
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
    padding: 12px 20px;
}

[data-theme="dark"] .btn-step-back {
    background: rgba(255, 255, 255, 0.08);
}

.btn-step-back:hover {
    background: rgba(0, 0, 0, 0.1);
    color: var(--text);
}

.btn-step-next {
    background: var(--primary);
    color: white;
    margin-left: auto;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.2);
}

.btn-step-next:hover {
    background: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(79, 70, 229, 0.3);
}

.btn-step-next:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.2);
}

.btn-step-submit {
    background: var(--secondary);
    color: white;
    margin-left: auto;
    padding: 12px 30px;
    box-shadow: 0 3px 10px rgba(16, 185, 129, 0.2);
}

.btn-step-submit:hover {
    background: #059669;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3);
}

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

/* Check Grid (Statement modals multi-select) */
.check-grid {
    display: flex;
    flex-direction: column;
    gap: 6px;
    max-height: 200px;
    overflow-y: auto;
    padding: 4px;
}

.check-grid-months {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
    max-height: none;
    overflow-y: visible;
}

.check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    font-size: 0.84rem;
    font-weight: 500;
    color: var(--text);
    transition: all 0.2s ease;
    user-select: none;
}

[data-theme="dark"] .check-item {
    background: rgba(255, 255, 255, 0.04);
}

.check-item:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.05);
}

.check-item:has(input:checked) {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.1);
    color: var(--primary);
    font-weight: 600;
}

.check-item input[type="checkbox"] {
    width: auto;
    margin: 0;
    padding: 0;
    accent-color: var(--primary);
    flex-shrink: 0;
}

.check-item.check-all {
    font-weight: 700;
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.06);
}

.check-grid-months .check-item.check-all {
    grid-column: 1 / -1;
}

/* ── Multi-Month Picker (maintenance period) ─────────────────── */
.month-quick {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 10px;
}

/* ── Month Carousel & Multi-Year Picker ────────────────── */
.month-carousel-container {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
}

.month-carousel-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.mc-header-year {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.mc-year-title {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.mc-year-badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(79, 70, 229, 0.15), rgba(99, 102, 241, 0.22));
    color: var(--primary);
    font-weight: 800;
    font-size: 0.88rem;
    letter-spacing: 0.03em;
    border: 1px solid rgba(79, 70, 229, 0.25);
}

.month-carousel-body {
    display: flex;
    align-items: center;
    gap: 8px;
    position: relative;
    width: 100%;
    user-select: none;
    touch-action: pan-y;
}

.mc-side-arrow {
    flex-shrink: 0;
    width: 34px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    background: rgba(255, 255, 255, 0.6);
    color: var(--text);
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 0;
}

[data-theme="dark"] .mc-side-arrow {
    background: rgba(255, 255, 255, 0.05);
}

.mc-side-arrow:hover {
    background: var(--primary);
    color: #ffffff;
    border-color: var(--primary);
    transform: scale(1.05);
}

.mc-side-arrow:active {
    transform: scale(0.94);
}

.month-chips-viewport {
    flex: 1;
    overflow: hidden;
    position: relative;
}

.month-chips {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 6px;
    transition: transform 0.22s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.22s ease;
}

.month-chips.slide-next {
    animation: mcSlideNext 0.22s ease-out;
}

.month-chips.slide-prev {
    animation: mcSlidePrev 0.22s ease-out;
}

@keyframes mcSlideNext {
    from { opacity: 0.35; transform: translateX(20px); }
    to { opacity: 1; transform: translateX(0); }
}

@keyframes mcSlidePrev {
    from { opacity: 0.35; transform: translateX(-20px); }
    to { opacity: 1; transform: translateX(0); }
}

.month-hidden-inputs {
    display: none;
}

.mq-btn {
    padding: 6px 13px;
    border-radius: 999px;
    border: 1.5px solid var(--border);
    background: transparent;
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    cursor: pointer;
    transition: all 0.2s ease;
}

.mq-btn:hover {
    border-color: var(--primary);
    color: var(--primary);
    background: rgba(79, 70, 229, 0.06);
}

.mq-btn:active {
    transform: scale(0.96);
}

.month-chip {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 2px;
    border-radius: 9px;
    border: 1.5px solid var(--border);
    background: rgba(255, 255, 255, 0.5);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: var(--text-muted);
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    transition: all 0.18s ease;
}

[data-theme="dark"] .month-chip {
    background: rgba(255, 255, 255, 0.04);
}

/* The real checkbox stays focusable for keyboard + form submission */
.month-chips .month-chip input[type="checkbox"] {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    opacity: 0;
    cursor: pointer;
    accent-color: transparent;
}

.month-chip:hover {
    border-color: var(--primary);
    color: var(--text);
    background: rgba(79, 70, 229, 0.06);
}

.month-chip:has(input:checked) {
    background: var(--primary);
    border-color: var(--primary);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(79, 70, 229, 0.28);
}

.month-chip:has(input:focus-visible) {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Marks the month that matches "now" so it is easy to spot */
.month-chip.is-current::after {
    content: '';
    position: absolute;
    top: 4px;
    right: 5px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--secondary);
}

.month-chip.is-current:has(input:checked)::after {
    background: #ffffff;
}

.month-chip.is-paid {
    opacity: 0.55;
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    border-style: dashed !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
}

[data-theme="dark"] .month-chip.is-paid {
    background: rgba(255, 255, 255, 0.02) !important;
    border-color: rgba(239, 68, 68, 0.4) !important;
}

.month-chip.is-paid:hover {
    background: rgba(0, 0, 0, 0.04) !important;
    border-color: rgba(239, 68, 68, 0.35) !important;
    color: var(--text-muted) !important;
}

.month-chip.is-paid input[type="checkbox"] {
    cursor: not-allowed;
    pointer-events: none;
}

.month-chip .chip-paid-tag {
    position: absolute;
    bottom: 2px;
    font-size: 7.5px;
    font-weight: 700;
    color: #ef4444;
    letter-spacing: 0.5px;
    line-height: 1;
}

.month-summary {
    margin: 10px 0 0;
    font-size: 0.78rem;
    line-height: 1.5;
    color: var(--text-muted);
}

.month-summary strong {
    color: var(--primary);
    font-weight: 700;
}

.month-summary.empty {
    color: #ef4444;
}

/* Count pill shown next to a compressed multi-month billing period in the table */
.bp-count {
    display: inline-block;
    min-width: 17px;
    padding: 0 5px;
    border-radius: 999px;
    background: rgba(79, 70, 229, 0.14);
    color: var(--primary);
    font-size: 0.7rem;
    font-weight: 700;
    line-height: 17px;
    text-align: center;
}

@media (max-width: 520px) {
    .mc-side-arrow {
        width: 28px;
        height: 34px;
    }
    .month-chips {
        grid-template-columns: repeat(4, 1fr);
        gap: 5px;
    }
    .month-chip {
        padding: 8px 2px;
        font-size: 0.75rem;
    }
}

/* ── Monthly Rate Helpers ─────────────────────────────── */
.rate-note {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    border-radius: 10px;
    border: 1px solid rgba(79, 70, 229, 0.22);
    background: rgba(79, 70, 229, 0.07);
    color: var(--text);
    font-size: 0.83rem;
    line-height: 1.5;
}

.rate-note svg {
    flex-shrink: 0;
    margin-top: 2px;
    color: var(--primary);
}

.rate-note strong {
    font-weight: 700;
}

.rate-note.muted {
    border-color: var(--border);
    background: rgba(0, 0, 0, 0.03);
    color: var(--text-muted);
}

.rate-note.muted svg {
    color: var(--text-muted);
}

[data-theme="dark"] .rate-note.muted {
    background: rgba(255, 255, 255, 0.03);
}

/* Inline text-style button used inside hints and notes */
.link-btn {
    display: inline;
    padding: 0;
    border: none;
    background: none;
    font-family: inherit;
    font-size: inherit;
    font-weight: 600;
    color: var(--primary);
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.link-btn:hover {
    opacity: 0.75;
}

/* Live calculation line under the amount field */
.rate-hint {
    display: block;
    min-height: 15px;
    margin-top: 5px;
    font-size: 0.75rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.rate-hint.warn {
    color: #d97706;
}

[data-theme="dark"] .rate-hint.warn {
    color: #fbbf24;
}

/* ── Monthly Rate Pill (Maintenance tab header) ──────── */
.header-title {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 9px;
}

.rate-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 5px 12px 5px 11px;
    border-radius: 999px;
    border: 1px solid rgba(79, 70, 229, 0.22);
    background: rgba(79, 70, 229, 0.08);
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--text-muted);
}

.rate-pill .rp-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.16);
    flex-shrink: 0;
}

.rate-pill .rp-value {
    color: var(--primary);
    font-weight: 700;
    font-size: 0.87rem;
    font-variant-numeric: tabular-nums;
}

.rate-pill .rp-unit {
    opacity: 0.72;
}

.rate-pill .rp-view {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.rate-pill .rp-none {
    font-style: normal;
    opacity: 0.75;
}

/* Inline editor — swapped in while the pill is in edit mode */
.rate-pill .rp-edit-wrap {
    display: none;
    align-items: center;
    gap: 6px;
}

.rate-pill.editing .rp-view,
.rate-pill.editing .rp-edit {
    display: none;
}

.rate-pill.editing .rp-edit-wrap {
    display: inline-flex;
}

.rp-input {
    width: 92px;
    padding: 4px 9px;
    border-radius: 8px;
    border: 1px solid var(--primary);
    background: #fff;
    color: var(--text);
    font-family: inherit;
    font-size: 0.85rem;
    font-weight: 700;
    text-align: right;
    font-variant-numeric: tabular-nums;
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.13);
    outline: none;
    -moz-appearance: textfield;
    appearance: textfield;
}

[data-theme="dark"] .rp-input {
    background: rgba(255, 255, 255, 0.06);
}

.rp-input::-webkit-outer-spin-button,
.rp-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.rp-save {
    margin-left: 4px;
    padding: 3px 13px;
    border-radius: 999px;
    border: 1px solid var(--primary);
    background: var(--primary);
    color: #fff;
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.rp-save:hover {
    opacity: 0.88;
}

.rp-save:disabled {
    cursor: default;
    opacity: 0.6;
}

.rp-cancel {
    width: 20px;
    height: 20px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, 0.06);
    color: var(--text-muted);
    font-family: inherit;
    font-size: 0.7rem;
    line-height: 1;
    cursor: pointer;
    transition: all 0.18s ease;
}

.rp-cancel:hover {
    background: rgba(239, 68, 68, 0.15);
    color: #ef4444;
}

.rate-pill.unset {
    border-color: var(--border);
    background: rgba(0, 0, 0, 0.03);
}

.rate-pill.unset .rp-dot {
    background: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.16);
}

.rp-edit {
    margin-left: 4px;
    padding: 2px 10px;
    border-radius: 999px;
    border: 1px solid rgba(79, 70, 229, 0.3);
    background: transparent;
    color: var(--primary);
    font-family: inherit;
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.18s ease;
}

.rp-edit:hover {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

[data-theme="dark"] .rate-pill {
    background: rgba(79, 70, 229, 0.14);
}

[data-theme="dark"] .rate-pill.unset {
    background: rgba(255, 255, 255, 0.04);
}

@media (max-width: 640px) {
    .header {
        flex-wrap: wrap;
        gap: 14px;
    }
}

/* Payment Toggle */
.payment-toggle {
    display: flex;
    gap: 10px;
}

.pay-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border: 1.5px solid var(--border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.6);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s ease;
}

[data-theme="dark"] .pay-opt {
    background: rgba(255, 255, 255, 0.05);
}

.pay-opt:hover {
    border-color: var(--primary);
    color: var(--text);
}

.pay-opt.active {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.12);
    color: var(--primary);
    box-shadow: 0 2px 8px rgba(79, 70, 229, 0.15);
}

/* File Upload Area */
.file-upload-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 28px 20px;
    border: 2px dashed var(--border);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.4);
}

[data-theme="dark"] .file-upload-area {
    background: rgba(255, 255, 255, 0.03);
}

.file-upload-area:hover {
    border-color: var(--primary);
    background: rgba(79, 70, 229, 0.04);
    color: var(--primary);
}

.file-upload-area.file-selected {
    border-color: var(--secondary);
    border-style: solid;
    background: rgba(16, 185, 129, 0.06);
    color: var(--secondary);
}

.file-upload-area svg {
    opacity: 0.7;
}

.file-label {
    font-size: 0.9rem;
    font-weight: 600;
}

.file-hint {
    font-size: 0.78rem;
    opacity: 0.7;
}

/* Owner Summaries */
.owner-summaries .card {
    padding: 16px;
}

.owner-summaries .card h4 {
    font-size: 0.9rem;
    margin-bottom: 8px;
}

.owner-summaries .card .amount {
    font-size: 1.5rem;
}

/* Toast Notification */
.toast {
    position: fixed;
    top: -250px;
    left: 50%;
    transform: translateX(-50%);
    padding: 12px 20px;
    background: var(--primary);
    color: white;
    z-index: 100005;
    transition: top 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    font-weight: 600;
    font-size: 0.9rem;
    line-height: 1.4;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    max-width: min(92vw, 420px);
    width: auto;
    text-align: center;
}

.toast.show {
    top: 20px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.toast.error {
    background: #ef4444;
}

@media (max-width: 768px) {
    .toast {
        top: -300px;
        padding: 11px 16px;
        font-size: 0.84rem;
        max-width: 90vw;
    }
    .toast.show {
        top: 15px;
    }
}

@keyframes spin {
    100% {
        transform: rotate(360deg);
    }
}

/* Mobile Topbar, Drawer & Backdrop (Hidden on Desktop) */
.mobile-topbar,
.mobile-sidebar-backdrop,
.mobile-sidebar-drawer,
.mobile-header-btn {
    display: none !important;
}

/* Responsive */
@media (max-width: 768px) {
    html, body {
        overflow-x: hidden;
        max-width: 100vw;
    }

    .table th {
        white-space: nowrap;
    }

    .sidebar {
        width: 100%;
        height: 65px;
        position: fixed;
        bottom: 0;
        top: auto;
        flex-direction: row;
        padding: 0;
        z-index: 1000;
        border-right: none;
        border-top: 1px solid var(--border);
        background: #0F172A;
    }

    .sidebar-header {
        display: none;
    }

    .nav-links {
        flex-direction: row;
        width: 100%;
        justify-content: space-between;
        padding: 0;
        overflow-x: auto;
    }

    .nav-links::-webkit-scrollbar {
        display: none;
    }

    .nav-links li {
        flex-direction: column;
        padding: 8px 2px;
        font-size: 0.65rem;
        gap: 4px;
        flex: 1;
        align-items: center;
        text-align: center;
        white-space: normal;
        min-width: 60px;
    }

    .nav-links li svg {
        width: 20px;
        height: 20px;
    }

    .logout-link,
    .nav-divider,
    .nav-sub-progress-container,
    #themeToggleBtn,
    #settingsToggleBtn,
    #subscriptionNavBtn,
    .nav-links li[data-tab="profile"],
    .nav-links li[data-tab="account"],
    .nav-links li[data-tab="help_support"],
    .nav-links li[data-tab="privacy_policy"] {
        display: none !important;
    }

    .mobile-topbar {
        display: flex !important;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 65px;
        padding: 0 15px;
        z-index: 1000;
        border-radius: 0;
        border-top: none;
        border-left: none;
        border-right: none;
    }

    .mobile-topbar .brand {
        display: flex;
        align-items: center;
        gap: 10px;
    }

    .mobile-topbar img {
        width: 34px;
        height: 34px;
        border-radius: 8px;
    }

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

    .mobile-header-btn {
        display: flex !important;
        align-items: center;
        justify-content: center;
        width: 38px;
        height: 38px;
        border-radius: 8px;
        background: transparent;
        border: none;
        color: var(--text);
        cursor: pointer;
        text-decoration: none;
        transition: background 0.2s ease, transform 0.15s ease, color 0.2s ease;
        padding: 0;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-header-btn:hover,
    .mobile-header-btn:active {
        background: rgba(0, 0, 0, 0.06);
    }

    [data-theme="dark"] .mobile-header-btn:hover,
    [data-theme="dark"] .mobile-header-btn:active {
        background: rgba(255, 255, 255, 0.08);
    }

    /* Mobile Sidebar Backdrop */
    .mobile-sidebar-backdrop {
        display: block !important;
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        background: rgba(15, 23, 42, 0.65);
        backdrop-filter: blur(4px);
        -webkit-backdrop-filter: blur(4px);
        z-index: 1050;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    }

    .mobile-sidebar-backdrop.active {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
    }

    /* Mobile Sidebar Drawer */
    .mobile-sidebar-drawer {
        display: flex !important;
        flex-direction: column;
        position: fixed;
        top: 0;
        right: 0;
        width: 290px;
        max-width: 84vw;
        height: 100vh;
        height: 100dvh;
        background: #ffffff;
        z-index: 1060;
        box-shadow: none;
        transform: translateX(100%);
        visibility: hidden;
        pointer-events: none;
        transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
        overflow-y: auto;
        overflow-x: hidden;
        -webkit-overflow-scrolling: touch;
    }

    .mobile-sidebar-drawer.active {
        transform: translateX(0);
        visibility: visible;
        pointer-events: auto;
        box-shadow: -6px 0 28px rgba(0, 0, 0, 0.18);
    }

    [data-theme="dark"] .mobile-sidebar-drawer {
        background: #0f172a;
        border-left: 1px solid rgba(255, 255, 255, 0.1);
        box-shadow: none;
    }

    [data-theme="dark"] .mobile-sidebar-drawer.active {
        box-shadow: -6px 0 35px rgba(0, 0, 0, 0.6);
    }

    .mobile-drawer-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 16px 16px;
        border-bottom: 1px solid var(--border);
        background: rgba(0, 0, 0, 0.02);
        flex-shrink: 0;
    }

    [data-theme="dark"] .mobile-drawer-header {
        background: rgba(255, 255, 255, 0.03);
        border-bottom-color: rgba(255, 255, 255, 0.08);
    }

    .mobile-drawer-user {
        display: flex;
        align-items: center;
        gap: 12px;
        min-width: 0;
        flex: 1;
    }

    .mobile-drawer-logo {
        width: 42px;
        height: 42px;
        border-radius: 10px;
        object-fit: cover;
        flex-shrink: 0;
        border: 1px solid var(--border);
    }

    .mobile-drawer-meta {
        min-width: 0;
        flex: 1;
    }

    .mobile-drawer-meta h4 {
        font-size: 0.98rem;
        font-weight: 700;
        margin: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        color: var(--text);
    }

    .mobile-drawer-secretary {
        font-size: 0.78rem;
        color: var(--accent);
        font-weight: 600;
        display: block;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-top: 2px;
    }

    .mobile-drawer-close {
        width: 36px;
        height: 36px;
        border-radius: 8px;
        border: none;
        background: transparent;
        color: var(--text);
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        transition: background 0.2s;
        margin-left: 8px;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-drawer-close:hover,
    .mobile-drawer-close:active {
        background: rgba(0, 0, 0, 0.08);
    }

    [data-theme="dark"] .mobile-drawer-close:hover,
    [data-theme="dark"] .mobile-drawer-close:active {
        background: rgba(255, 255, 255, 0.1);
    }

    .mobile-drawer-body {
        padding: 14px 12px 24px;
        display: flex;
        flex-direction: column;
        flex: 1;
    }

    .mobile-drawer-section-title {
        font-size: 0.72rem;
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.8px;
        color: #64748b;
        padding: 8px 12px 6px;
    }

    [data-theme="dark"] .mobile-drawer-section-title {
        color: #94a3b8;
    }

    .mobile-drawer-links {
        list-style: none;
        padding: 0;
        margin: 0;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .mobile-drawer-links li {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 11px 14px;
        border-radius: 10px;
        font-size: 0.92rem;
        font-weight: 500;
        color: var(--text);
        cursor: pointer;
        transition: background 0.2s ease, color 0.2s ease;
        user-select: none;
        -webkit-tap-highlight-color: transparent;
    }

    .mobile-drawer-links li svg {
        flex-shrink: 0;
        color: #64748b;
        transition: color 0.2s ease;
    }

    [data-theme="dark"] .mobile-drawer-links li svg {
        color: #94a3b8;
    }

    .mobile-drawer-links li:hover,
    .mobile-drawer-links li:active {
        background: rgba(79, 70, 229, 0.08);
        color: var(--primary);
    }

    .mobile-drawer-links li:hover svg,
    .mobile-drawer-links li:active svg {
        color: var(--primary);
    }

    .mobile-drawer-links li.active {
        background: rgba(79, 70, 229, 0.12);
        color: var(--primary);
        font-weight: 700;
    }

    .mobile-drawer-links li.active svg {
        color: var(--primary);
    }

    [data-theme="dark"] .mobile-drawer-links li:hover,
    [data-theme="dark"] .mobile-drawer-links li:active {
        background: rgba(255, 255, 255, 0.07);
        color: #818cf8;
    }

    [data-theme="dark"] .mobile-drawer-links li:hover svg,
    [data-theme="dark"] .mobile-drawer-links li:active svg {
        color: #818cf8;
    }

    [data-theme="dark"] .mobile-drawer-links li.active {
        background: rgba(79, 70, 229, 0.25);
        color: #a5b4fc;
    }

    [data-theme="dark"] .mobile-drawer-links li.active svg {
        color: #a5b4fc;
    }

    .mobile-drawer-links li span {
        display: flex;
        align-items: center;
        flex: 1;
    }

    .mobile-drawer-divider {
        height: 1px;
        background: var(--border);
        margin: 10px 4px;
    }

    [data-theme="dark"] .mobile-drawer-divider {
        background: rgba(255, 255, 255, 0.08);
    }

    .mobile-drawer-logout {
        color: #ef4444 !important;
    }

    .mobile-drawer-logout svg {
        color: #ef4444 !important;
    }

    .mobile-drawer-logout:hover,
    .mobile-drawer-logout:active {
        background: rgba(239, 68, 68, 0.1) !important;
        color: #dc2626 !important;
    }

    .mobile-drawer-login {
        color: #10b981 !important;
    }

    .mobile-drawer-login svg {
        color: #10b981 !important;
    }

    .mobile-drawer-login:hover,
    .mobile-drawer-login:active {
        background: rgba(16, 185, 129, 0.1) !important;
        color: #059669 !important;
    }

    .mobile-sub-badge {
        display: inline-block;
        font-size: 0.7rem;
        font-weight: 700;
        padding: 2px 8px;
        border-radius: 12px;
        margin-left: 6px;
        text-transform: uppercase;
        background: rgba(225, 172, 34, 0.15);
        color: #b45309;
        border: 1px solid rgba(225, 172, 34, 0.3);
    }

    [data-theme="dark"] .mobile-sub-badge {
        background: rgba(234, 179, 8, 0.18);
        color: #facc15;
        border-color: rgba(234, 179, 8, 0.35);
    }

    .main-content {
        margin-left: 0;
        margin-top: 65px;
        margin-bottom: 65px;
        padding: 15px;
        width: 100%;
    }

    .header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .header h2 {
        font-size: 1.3rem;
    }

    .header-actions {
        display: flex;
        width: 100%;
        gap: 10px;
        margin-bottom: 15px;
    }

    .header-actions button {
        flex: 1;
        margin: 0 !important;
        padding: 10px;
    }

    .header .btn-primary:not(.header-actions button) {
        width: 100%;
    }

    .filters {
        flex-direction: column;
        align-items: stretch;
        padding: 16px;
        gap: 10px;
    }

    .filter-row {
        display: flex;
        gap: 10px;
        width: 100%;
    }

    .filter-row>* {
        flex: 1;
        min-width: 0;
    }

    .filter-row .btn-export {
        margin-top: 0 !important;
    }

    .filters select,
    .filters input,
    .filters button {
        width: 100%;
    }

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

    .owner-summaries.cards-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
}

.collection-card {
    width: 100%;
    min-height: 220px;
    max-width: 100%;
    box-sizing: border-box;
    overflow: hidden;
    border-radius: 16px;
    padding: 22px !important;
    background: linear-gradient(145deg, #1e293b 0%, #334155 50%, #475569 100%) !important;
    border: 1px solid rgba(255, 255, 255, 0.08) !important;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    position: relative;
}

.collection-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), #818CF8, var(--secondary));
    border-radius: 16px 16px 0 0;
    opacity: 0.8;
}

.collection-card:hover {
    transform: translateY(-6px) !important;
    box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
    border-color: rgba(255, 255, 255, 0.12) !important;
}

[data-theme="dark"] .collection-card {
    background: linear-gradient(145deg, #0f172a 0%, #1e293b 50%, #334155 100%) !important;
}

#masterCollectionsGrid {
    grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
    justify-content: flex-start;
    gap: 22px;
}

@media (max-width: 768px) {
    .collection-card {
        min-height: auto;
        padding: 18px !important;
    }

    #masterCollectionsGrid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .modal-content {
        width: 90%;
        padding: 20px;
    }

    .confirm-modal .modal-content {
        width: 80%;
        max-width: 240px;
        padding: 15px;
        font-size: 0.9rem;
        text-align: center;
    }

    .confirm-modal .modal-content h3 {
        font-size: 1.1rem;
        margin-bottom: 15px;
    }

    .login-container {
        width: 85%;
        max-width: 320px;
        padding: 25px;
    }
}

/* Pagination and Export Styles */
.pagination-container {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 15px;
    margin-top: 5px;
    padding: 10px 0;
    flex-wrap: wrap;
}

.page-btn {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: var(--text);
    padding: 8px 16px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.95rem;
    font-weight: 500;
}

.page-btn:hover:not(:disabled) {
    background: var(--secondary);
    border-color: var(--secondary);
    transform: translateY(-2px);
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-info {
    font-size: 0.95rem;
    color: var(--text);
    opacity: 0.8;
}

.btn-export {
    margin-left: auto;
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.4);
    color: #10b981;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
}

.btn-export:hover {
    background: rgba(16, 185, 129, 0.3);
    border-color: #10b981;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}

@media (max-width: 768px) {
    .btn-export {
        margin-left: 0;
        width: 100%;
        justify-content: center;
        margin-top: 0;
    }

    .pagination-container {
        justify-content: center;
        flex-wrap: nowrap;
        gap: 8px;
        margin-top: 5px;
        padding: 5px 0 10px 0;
    }

    .page-btn {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .page-info {
        font-size: 0.85rem;
    }
}

/* Hide number input spinners (arrows) */
input[type=number]::-webkit-inner-spin-button,
input[type=number]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type=number] {
    -moz-appearance: textfield;
    /* Firefox */
}

.mobile-login {
    color: #10b981;
    background: rgba(16, 185, 129, 0.1);
    padding: 8px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-login:active {
    background: rgba(16, 185, 129, 0.2);
}

.login-link {
    margin-top: auto;
    text-decoration: none;
    color: inherit;
}

.login-link li:hover {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
}

@media (max-width: 768px) {
    .login-link {
        display: none;
    }
}

/* ==========================================================
   Subscription Plan Modal & Cards (Day & Night Mode)
   ========================================================== */
.subscription-modal-content {
    max-width: 1060px !important;
    width: 95% !important;
    max-height: 92vh !important;
    overflow-y: auto !important;
    padding: 32px 28px !important;
    border-radius: 20px !important;
    background: #ffffff !important;
    border: 1px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15) !important;
    position: relative !important;
}

[data-theme="dark"] .subscription-modal-content {
    background: #0f172a !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.75) !important;
}

/* Subscription tab: render the plans as a normal page section, not a floating card */
#subscription .subscription-modal-content {
    max-width: 1180px !important;
    width: 100% !important;
    margin: 0 auto !important;
    padding: 0 !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
    backdrop-filter: none !important;
    -webkit-backdrop-filter: none !important;
    max-height: none !important;
    overflow: visible !important;
    position: static !important;
}


.sub-header-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
    border-radius: 20px;
    color: #059669;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    margin-bottom: 12px;
}

[data-theme="dark"] .sub-header-pill {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.35);
    color: #34d399;
}

.sub-title {
    font-size: 1.85rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: #0f172a;
}

[data-theme="dark"] .sub-title {
    color: #f8fafc;
}

.sub-subtitle {
    color: #64748b;
    font-size: 0.95rem;
    max-width: 650px;
    margin: 0 auto;
    line-height: 1.5;
}

[data-theme="dark"] .sub-subtitle {
    color: #94a3b8;
}

.subscription-cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
    gap: 22px;
    align-items: stretch;
    margin-top: 24px;
}

.sub-card {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    border-radius: 16px;
    padding: 26px 22px;
    position: relative;
    background: #ffffff;
    border: 1.5px solid #e2e8f0;
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.04);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.sub-card:hover {
    transform: translateY(-4px);
    border-color: #cbd5e1;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

[data-theme="dark"] .sub-card {
    background: rgba(30, 41, 59, 0.7);
    border: 1.5px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .sub-card:hover {
    border-color: rgba(255, 255, 255, 0.2);
    box-shadow: 0 14px 32px rgba(0, 0, 0, 0.5);
}

/* Featured / Advanced Plan */
.sub-card.sub-featured {
    border: 2px solid #10b981;
    background: linear-gradient(180deg, #ffffff 0%, #f0fdf4 100%);
    box-shadow: 0 8px 28px rgba(16, 185, 129, 0.12);
}

.sub-card.sub-featured:hover {
    box-shadow: 0 16px 36px rgba(16, 185, 129, 0.22);
}

[data-theme="dark"] .sub-card.sub-featured {
    border: 2px solid #10b981;
    background: linear-gradient(180deg, rgba(30, 41, 59, 0.95) 0%, rgba(6, 78, 59, 0.25) 100%);
    box-shadow: 0 10px 30px rgba(16, 185, 129, 0.2);
}

.sub-card.current-active-plan {
    border: 2px solid #059669;
}

[data-theme="dark"] .sub-card.current-active-plan {
    border: 2px solid #10b981;
}

/* Plan Badges */
.sub-plan-badge {
    position: absolute;
    top: -12px;
    right: 20px;
    background: #10b981;
    color: #ffffff;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 3px 8px rgba(16, 185, 129, 0.3);
}

.sub-featured-badge {
    position: absolute;
    top: -13px;
    left: 50%;
    transform: translateX(-50%);
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    padding: 4px 14px;
    border-radius: 14px;
    font-size: 0.72rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    white-space: nowrap;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.35);
}

/* Card Typography */
.sub-plan-tier {
    color: #059669;
    font-size: 0.82rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
}

[data-theme="dark"] .sub-plan-tier {
    color: #34d399;
}

.sub-plan-title {
    font-size: 1.55rem;
    font-weight: 800;
    margin: 4px 0 8px;
    color: #0f172a;
}

[data-theme="dark"] .sub-plan-title {
    color: #f8fafc;
}

.sub-plan-desc {
    color: #64748b;
    font-size: 0.86rem;
    min-height: 40px;
    line-height: 1.45;
}

[data-theme="dark"] .sub-plan-desc {
    color: #94a3b8;
}

/* Pricing Box */
.sub-pricing-box {
    margin: 16px 0 22px;
    padding: 13px 15px;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

[data-theme="dark"] .sub-pricing-box {
    background: rgba(15, 23, 42, 0.6);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.sub-card.sub-featured .sub-pricing-box {
    background: #ecfdf5;
    border: 1px solid #a7f3d0;
}

[data-theme="dark"] .sub-card.sub-featured .sub-pricing-box {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.25);
}

.sub-pricing-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
}

.sub-price-label {
    font-size: 0.85rem;
    color: #64748b;
}

[data-theme="dark"] .sub-price-label {
    color: #94a3b8;
}

.sub-price-val {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
}

[data-theme="dark"] .sub-price-val {
    color: #f8fafc;
}

.sub-price-yearly {
    font-size: 1.25rem;
    font-weight: 800;
    color: #059669;
}

[data-theme="dark"] .sub-price-yearly {
    color: #34d399;
}

.sub-price-dur {
    font-size: 0.75rem;
    color: #64748b;
    font-weight: 400;
}

[data-theme="dark"] .sub-price-dur {
    color: #94a3b8;
}

/* Feature List */
.sub-feature-list {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    font-size: 0.88rem;
    display: flex;
    flex-direction: column;
    gap: 11px;
}

.sub-feature-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    color: #1e293b;
    line-height: 1.4;
}

[data-theme="dark"] .sub-feature-item {
    color: #f8fafc;
}

.sub-feature-item svg {
    flex-shrink: 0;
    margin-top: 1px;
}

.sub-feature-disabled {
    color: #94a3b8;
    opacity: 0.75;
}

.sub-feature-disabled span {
    text-decoration: line-through;
}

[data-theme="dark"] .sub-feature-disabled {
    color: #64748b;
}

.sub-feature-highlight {
    color: #059669;
    font-weight: 700;
}

[data-theme="dark"] .sub-feature-highlight {
    color: #34d399;
    font-weight: 700;
}

/* Buttons inside Cards */
.btn-sub-trial {
    background: #ecfdf5;
    border: 1.5px solid #10b981;
    color: #059669;
    font-weight: 700;
    width: 100%;
    padding: 10px 0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
}

.btn-sub-trial:hover {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.25);
}

[data-theme="dark"] .btn-sub-trial {
    background: rgba(16, 185, 129, 0.15);
    border: 1.5px solid #10b981;
    color: #34d399;
}

[data-theme="dark"] .btn-sub-trial:hover {
    background: #10b981;
    color: #ffffff;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}

.btn-sub-monthly {
    width: 100%;
    padding: 9px 0;
    font-size: 0.88rem;
    font-weight: 600;
    border-radius: 8px;
    background: #f1f5f9;
    color: #1e293b;
    border: 1px solid #cbd5e1;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sub-monthly:hover {
    background: #e2e8f0;
    border-color: #94a3b8;
    color: #0f172a;
}

[data-theme="dark"] .btn-sub-monthly {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: #f8fafc;
}

[data-theme="dark"] .btn-sub-monthly:hover {
    background: rgba(255, 255, 255, 0.16);
    border-color: rgba(255, 255, 255, 0.3);
}

.btn-sub-yearly {
    width: 100%;
    padding: 9px 0;
    font-size: 0.88rem;
    font-weight: 700;
    border-radius: 8px;
    background: #0f172a;
    color: #ffffff;
    border: 1px solid #0f172a;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-sub-yearly:hover {
    background: #1e293b;
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.2);
}

[data-theme="dark"] .btn-sub-yearly {
    background: #4f46e5;
    border: 1px solid #4f46e5;
    color: #ffffff;
}

[data-theme="dark"] .btn-sub-yearly:hover {
    background: #4338ca;
    box-shadow: 0 4px 15px rgba(79, 70, 229, 0.4);
}

.sub-card.sub-featured .btn-sub-yearly {
    background: #10b981;
    border: 1px solid #10b981;
    color: #ffffff;
}

.sub-card.sub-featured .btn-sub-yearly:hover {
    background: #059669;
    box-shadow: 0 4px 14px rgba(16, 185, 129, 0.35);
}

[data-theme="dark"] .sub-card.sub-featured .btn-sub-yearly {
    background: #10b981;
    border: 1px solid #10b981;
    color: #ffffff;
}

[data-theme="dark"] .sub-card.sub-featured .btn-sub-yearly:hover {
    background: #059669;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.45);
}

/* Disabled Lower Plan Cards when Advanced is Active */
.sub-card.sub-card-disabled {
    opacity: 0.52 !important;
    background: #f8fafc !important;
    border-color: #e2e8f0 !important;
    pointer-events: none !important;
    user-select: none !important;
    transform: none !important;
    box-shadow: none !important;
}

[data-theme="dark"] .sub-card.sub-card-disabled {
    background: rgba(15, 23, 42, 0.45) !important;
    border-color: rgba(255, 255, 255, 0.06) !important;
}

.sub-card.sub-card-disabled button {
    pointer-events: none !important;
    cursor: not-allowed !important;
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    border-color: #cbd5e1 !important;
    box-shadow: none !important;
    transform: none !important;
}

[data-theme="dark"] .sub-card.sub-card-disabled button {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #64748b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.btn-sub-trial:disabled,
.btn-sub-monthly:disabled,
.btn-sub-yearly:disabled {
    opacity: 0.55 !important;
    background: #e2e8f0 !important;
    color: #94a3b8 !important;
    border-color: #cbd5e1 !important;
    cursor: not-allowed !important;
    pointer-events: none !important;
    box-shadow: none !important;
    transform: none !important;
}

[data-theme="dark"] .btn-sub-trial:disabled,
[data-theme="dark"] .btn-sub-monthly:disabled,
[data-theme="dark"] .btn-sub-yearly:disabled {
    background: rgba(255, 255, 255, 0.05) !important;
    color: #64748b !important;
    border-color: rgba(255, 255, 255, 0.08) !important;
}

.sub-disabled-badge {
    position: absolute;
    top: -11px;
    right: 20px;
    background: #64748b;
    color: #ffffff;
    padding: 3px 12px;
    border-radius: 12px;
    font-size: 0.72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

.sub-active-plan-status {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px 14px;
    background: #ecfdf5;
    border: 1.5px solid #10b981;
    border-radius: 10px;
    color: #059669;
    font-size: 0.88rem;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.12);
    user-select: none;
    text-align: center;
}

[data-theme="dark"] .sub-active-plan-status {
    background: rgba(16, 185, 129, 0.15);
    border: 1.5px solid #10b981;
    color: #34d399;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.25);
}

/* ── Notification Badge ─────────────────────────────────────── */
.nav-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    background: #ef4444;
    color: #fff;
    font-size: 0.68rem;
    font-weight: 700;
    border-radius: 999px;
    margin-left: 6px;
    line-height: 1;
    vertical-align: middle;
    animation: badge-pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
}

.nav-badge[data-count="0"],
.nav-badge:empty {
    display: none;
}

@keyframes badge-pop {
    from { transform: scale(0.4); opacity: 0; }
    to   { transform: scale(1);   opacity: 1; }
}

/* Badge on collection cards */
.collection-new-badge {
    position: absolute;
    top: 10px;
    right: 48px; /* leaves room for edit/delete buttons */
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.45);
    animation: badge-pop 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
    pointer-events: none;
}

/* ── Locked navigation tabs (when subscription is mandatory) ── */
.nav-links li.nav-locked,
.mobile-drawer-links li.nav-locked {
    opacity: 0.45 !important;
    cursor: not-allowed !important;
    position: relative;
    user-select: none;
}

.nav-links li.nav-locked:hover,
.mobile-drawer-links li.nav-locked:hover {
    background: transparent !important;
    color: var(--text-muted) !important;
}

.nav-links li.nav-locked::after,
.mobile-drawer-links li.nav-locked::after {
    content: "🔒";
    font-size: 0.72rem;
    margin-left: auto;
    opacity: 0.8;
}

/* ── Full-Screen 4-Second Logo Animation Loader Layer ── */
.logo-animation-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: #ffffff;
    z-index: 9999999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.35s ease, visibility 0.35s ease;
}

.logo-animation-overlay.active {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.logo-animation-wrapper {
    width: 100%;
    max-width: 520px;
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.logo-animation-wrapper video {
    width: 100%;
    max-width: 480px;
    height: auto;
    object-fit: contain;
    outline: none;
    border: none;
    background: #ffffff;
    border-radius: 12px;
}

@media (max-width: 600px) {
    .logo-animation-wrapper {
        max-width: 92vw;
        padding: 10px;
    }
    .logo-animation-wrapper video {
        max-width: 100%;
    }
}

/* ══════════════════════════════════════════════════════════════
   FLOATING NETWORK STATUS BANNER (OFFLINE / ONLINE)
   ══════════════════════════════════════════════════════════════ */
.network-status-banner {
    position: fixed;
    top: -90px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100000;
    transition: top 0.4s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.35s ease;
    opacity: 0;
    pointer-events: none;
    max-width: 92vw;
}

.network-status-banner.show {
    top: 20px;
    opacity: 1;
    pointer-events: auto;
}

.network-status-banner .ns-content {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    padding: 10px 18px;
    border-radius: 9999px;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28), 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: 'Inter', system-ui, -apple-system, sans-serif;
    transition: background 0.3s ease, border-color 0.3s ease, color 0.3s ease;
}

/* OFFLINE STATE */
.network-status-banner.is-offline .ns-content {
    background: rgba(220, 38, 38, 0.94);
    border: 1px solid rgba(254, 202, 202, 0.35);
    color: #ffffff;
}

.network-status-banner.is-offline .ns-icon-offline {
    display: block;
    animation: nsPulse 2s infinite ease-in-out;
}

.network-status-banner.is-offline .ns-icon-online {
    display: none;
}

/* ONLINE STATE (RECONNECTED) */
.network-status-banner.is-online .ns-content {
    background: rgba(16, 185, 129, 0.95);
    border: 1px solid rgba(167, 243, 208, 0.4);
    color: #ffffff;
}

.network-status-banner.is-online .ns-icon-offline {
    display: none;
}

.network-status-banner.is-online .ns-icon-online {
    display: block;
    animation: nsBounce 0.4s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}

.network-status-banner.is-online .ns-retry-btn {
    display: none;
}

.network-status-banner .ns-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.network-status-banner .ns-icon {
    width: 20px;
    height: 20px;
}

.network-status-banner .ns-text-wrap {
    display: flex;
    flex-direction: column;
    line-height: 1.25;
}

.network-status-banner .ns-title {
    font-weight: 700;
    font-size: 0.86rem;
    letter-spacing: -0.2px;
}

.network-status-banner .ns-subtitle {
    font-size: 0.74rem;
    opacity: 0.9;
}

.network-status-banner .ns-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    padding: 5px 12px;
    border-radius: 9999px;
    font-size: 0.78rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s ease;
    margin-left: 4px;
    white-space: nowrap;
}

.network-status-banner .ns-retry-btn:hover {
    background: rgba(255, 255, 255, 0.32);
    transform: scale(1.03);
}

.network-status-banner .ns-retry-btn:active {
    transform: scale(0.97);
}

.network-status-banner .ns-retry-btn:disabled {
    opacity: 0.75;
    cursor: not-allowed;
    pointer-events: none;
}

.ns-btn-shake {
    animation: nsShake 0.35s ease-in-out;
}

@keyframes nsPulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.65; transform: scale(0.92); }
}

@keyframes nsBounce {
    0% { transform: scale(0.5); }
    70% { transform: scale(1.15); }
    100% { transform: scale(1); }
}

@keyframes nsShake {
    0%, 100% { transform: translateX(0); }
    20%, 60% { transform: translateX(-4px); }
    40%, 80% { transform: translateX(4px); }
}

@media (max-width: 600px) {
    .network-status-banner {
        width: calc(100% - 24px);
    }
    .network-status-banner .ns-content {
        width: 100%;
        justify-content: space-between;
        border-radius: 14px;
        padding: 9px 14px;
    }
}