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

:root {
    --brand: #6366f1;
    --brand-dim: #4f46e5;
    --brand-soft: #ede9fe;
    --brand-text: #4338ca;
    --surface: #ffffff;
    --surface-1: #f8fafc;
    --surface-2: #f1f5f9;
    --surface-3: #e2e8f0;
    --text-1: #0f172a;
    --text-2: #475569;
    --text-3: #94a3b8;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --radius: 10px;
    --radius-lg: 16px;
    --radius-xl: 24px;
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, .06), 0 1px 2px rgba(0, 0, 0, .04);
    --shadow: 0 4px 12px rgba(0, 0, 0, .07), 0 2px 6px rgba(0, 0, 0, .04);
    --shadow-lg: 0 20px 48px rgba(0, 0, 0, .1), 0 8px 20px rgba(0, 0, 0, .06);
    --sidebar-w: 240px;
}

body {
    font-family: 'Inter', sans-serif;
    background: var(--surface-1);
    color: var(--text-1);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.6
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none
}

input,
textarea,
select {
    font-family: inherit;
    outline: none;
    border: none
}

a {
    text-decoration: none;
    color: inherit
}

.hidden {
    display: none !important
}

/* ─── TOAST ─────────────────────────────────────────────── */
#toast-wrap {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    background: #fff;
    border-radius: var(--radius);
    padding: 12px 16px;
    box-shadow: var(--shadow-lg);
    border-left: 3px solid var(--brand);
    min-width: 260px;
    max-width: 360px;
    animation: slideIn .25s ease;
    font-size: 13px;
    font-weight: 500
}

.toast.success {
    border-color: var(--success)
}

.toast.error {
    border-color: var(--danger)
}

.toast.warning {
    border-color: var(--warning)
}

.toast-icon {
    font-size: 16px;
    flex-shrink: 0
}

.toast-msg {
    flex: 1;
    color: var(--text-1)
}

.toast-close {
    color: var(--text-3);
    cursor: pointer;
    padding: 2px 4px;
    border-radius: 4px;
    background: none;
    border: none;
    font-size: 16px;
    line-height: 1
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px)
    }

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

/* ─── LOADER ─────────────────────────────────────────────── */
#global-loader {
    position: fixed;
    inset: 0;
    background: #fff;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 16px
}

.spinner {
    width: 36px;
    height: 36px;
    border: 3px solid var(--surface-3);
    border-top-color: var(--brand);
    border-radius: 50%;
    animation: spin .8s linear infinite
}

@keyframes spin {
    to {
        transform: rotate(360deg)
    }
}

.loader-logo {
    font-size: 22px;
    font-weight: 800;
    color: var(--brand);
    letter-spacing: -0.5px
}

/* ─── AUTH ───────────────────────────────────────────────── */
#auth-screen {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8fafc 0%, #ede9fe 50%, #dbeafe 100%);
    padding: 20px
}

.auth-card {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 40px;
    width: 100%;
    max-width: 420px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--brand), #8b5cf6, #3b82f6)
}

.auth-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 28px
}

.auth-logo-icon {
    width: 40px;
    height: 40px;
    background: var(--brand);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center
}

.auth-logo-icon svg {
    width: 22px;
    height: 22px;
    fill: #fff
}

.auth-logo-text {
    font-size: 22px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.5px
}

.auth-logo-sub {
    font-size: 11px;
    color: var(--text-3);
    letter-spacing: 1px;
    text-transform: uppercase;
    margin-top: 1px
}

.auth-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 6px
}

.auth-subtitle {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 24px
}

.field {
    margin-bottom: 16px
}

.field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
    letter-spacing: .3px;
    text-transform: uppercase
}

.field input {
    width: 100%;
    padding: 10px 14px;
    border: 1.5px solid var(--surface-3);
    border-radius: var(--radius);
    font-size: 14px;
    color: var(--text-1);
    background: #fff;
    transition: border .2s
}

.field input:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .1)
}

.field input::placeholder {
    color: var(--text-3)
}

.btn-primary {
    width: 100%;
    padding: 12px;
    background: var(--brand);
    color: #fff;
    border-radius: var(--radius);
    font-size: 14px;
    font-weight: 600;
    transition: all .2s;
    letter-spacing: .2px
}

.btn-primary:hover {
    background: var(--brand-dim);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(99, 102, 241, .3)
}

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

.btn-primary:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
    font-size: 13px;
    color: var(--text-2)
}

.auth-switch a {
    color: var(--brand);
    font-weight: 600;
    cursor: pointer
}

.auth-switch a:hover {
    text-decoration: underline
}

.auth-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 20px 0;
    color: var(--text-3);
    font-size: 12px
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--surface-3)
}

/* ─── APP LAYOUT ─────────────────────────────────────────── */
#app-screen {
    display: flex;
    min-height: 100vh
}

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

.sidebar-logo {
    padding: 20px 20px 16px;
    border-bottom: 1px solid var(--surface-2);
    display: flex;
    align-items: center;
    gap: 10px
}

.sidebar-logo-icon {
    width: 34px;
    height: 34px;
    background: var(--brand);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0
}

.sidebar-logo-icon svg {
    width: 18px;
    height: 18px;
    fill: #fff
}

.sidebar-logo-name {
    font-size: 17px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -0.5px
}

.sidebar-logo-tag {
    font-size: 9px;
    background: var(--brand-soft);
    color: var(--brand-text);
    padding: 2px 6px;
    border-radius: 4px;
    font-weight: 600;
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-left: 2px
}

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

.nav-section {
    margin-bottom: 20px
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: 1.2px;
    text-transform: uppercase;
    padding: 0 10px;
    margin-bottom: 6px
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius);
    cursor: pointer;
    transition: all .15s;
    color: var(--text-2);
    font-weight: 500;
    font-size: 13px;
    margin-bottom: 2px
}

.nav-item:hover {
    background: var(--surface-1);
    color: var(--text-1)
}

.nav-item.active {
    background: var(--brand-soft);
    color: var(--brand-text)
}

.nav-item svg {
    width: 17px;
    height: 17px;
    flex-shrink: 0;
    opacity: .7
}

.nav-item.active svg {
    opacity: 1
}

.nav-badge {
    margin-left: auto;
    background: var(--brand);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
    min-width: 20px;
    text-align: center
}

.sidebar-footer {
    padding: 14px 12px;
    border-top: 1px solid var(--surface-2)
}

.user-card {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    border-radius: var(--radius);
    background: var(--surface-1);
    cursor: pointer;
    transition: background .15s
}

.user-card:hover {
    background: var(--surface-2)
}

.avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: var(--brand);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
    flex-shrink: 0
}

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

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis
}

.user-plan {
    font-size: 11px;
    color: var(--text-3);
    text-transform: capitalize
}

.logout-btn {
    background: none;
    border: none;
    color: var(--text-3);
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    display: flex
}

.logout-btn:hover {
    color: var(--danger);
    background: rgba(239, 68, 68, .1)
}

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

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

.topbar-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-1)
}

.topbar-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 1px
}

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

.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px
}

.hamburger span {
    display: block;
    width: 20px;
    height: 2px;
    background: var(--text-2);
    border-radius: 2px;
    transition: .3s
}

.content {
    flex: 1;
    padding: 28px
}

/* ─── CARDS ─────────────────────────────────────────────── */
.card {
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid var(--surface-3);
    padding: 24px;
    margin-bottom: 20px
}

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

.card-title {
    font-size: 15px;
    font-weight: 700;
    color: var(--text-1)
}

.card-sub {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 2px
}

/* Stat cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 24px
}

.stat-card {
    background: #fff;
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    overflow: hidden
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: var(--stat-color, var(--brand))
}

.stat-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 8px
}

.stat-value {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -1px;
    line-height: 1
}

.stat-note {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 6px
}

/* ─── KEY DISPLAY ─────────────────────────────────────────── */
.key-box {
    background: var(--surface-1);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius);
    padding: 12px 14px;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px
}

.key-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: .5px;
    text-transform: uppercase;
    margin-bottom: 4px
}

.key-value {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: var(--text-1);
    flex: 1;
    word-break: break-all;
    font-weight: 500
}

.key-masked {
    font-family: 'JetBrains Mono', monospace;
    font-size: 13px;
    color: var(--text-2);
    flex: 1;
    letter-spacing: 2px
}

.key-actions {
    display: flex;
    gap: 6px;
    flex-shrink: 0
}

.icon-btn {
    width: 30px;
    height: 30px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--surface-3);
    cursor: pointer;
    transition: all .15s;
    color: var(--text-2)
}

.icon-btn:hover {
    background: var(--brand-soft);
    border-color: var(--brand);
    color: var(--brand)
}

.icon-btn.danger:hover {
    background: rgba(239, 68, 68, .1);
    border-color: rgba(239, 68, 68, .3);
    color: var(--danger)
}

.icon-btn svg {
    width: 15px;
    height: 15px
}

/* Key type badges */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 5px;
    letter-spacing: .3px;
    text-transform: uppercase
}

.badge-account {
    background: #ede9fe;
    color: #4338ca
}

.badge-mail {
    background: #d1fae5;
    color: #065f46
}

.badge-request {
    background: #dbeafe;
    color: #1e40af
}

.badge-free {
    background: var(--surface-2);
    color: var(--text-2)
}

.badge-starter {
    background: #dbeafe;
    color: #1e40af
}

.badge-pro {
    background: #ede9fe;
    color: #4338ca
}

.badge-business {
    background: #fef3c7;
    color: #92400e
}

.badge-enterprise {
    background: #d1fae5;
    color: #065f46
}

.badge-active {
    background: #d1fae5;
    color: #065f46
}

.badge-suspended {
    background: #fee2e2;
    color: #991b1b
}

/* ─── USAGE BAR ─────────────────────────────────────────── */
.usage-bar {
    height: 8px;
    background: var(--surface-2);
    border-radius: 10px;
    overflow: hidden;
    margin: 8px 0
}

.usage-fill {
    height: 100%;
    border-radius: 10px;
    background: var(--brand);
    transition: width .6s ease
}

.usage-fill.warn {
    background: var(--warning)
}

.usage-fill.danger {
    background: var(--danger)
}

/* ─── TABLE ─────────────────────────────────────────────── */
.table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch
}

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

th {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-3);
    letter-spacing: .5px;
    text-transform: uppercase;
    padding: 10px 12px;
    border-bottom: 1px solid var(--surface-3);
    text-align: left;
    white-space: nowrap
}

td {
    padding: 12px 12px;
    border-bottom: 1px solid var(--surface-2);
    font-size: 13px;
    color: var(--text-1)
}

tr:last-child td {
    border-bottom: none
}

tr:hover td {
    background: var(--surface-1)
}

/* ─── FORM ───────────────────────────────────────────────── */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px
}

@media(max-width:600px) {
    .form-row {
        grid-template-columns: 1fr
    }
}

.form-field {
    margin-bottom: 14px
}

.form-field label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
    margin-bottom: 6px;
    letter-spacing: .3px;
    text-transform: uppercase
}

.form-field input,
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 9px 13px;
    border: 1.5px solid var(--surface-3);
    border-radius: var(--radius);
    font-size: 13px;
    color: var(--text-1);
    background: #fff;
    transition: border .2s
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, .08)
}

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

.form-field select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='%2394a3b8' viewBox='0 0 16 16'%3E%3Cpath d='M7.247 11.14L2.451 5.658C1.885 5.013 2.345 4 3.204 4h9.592a1 1 0 0 1 .753 1.659l-4.796 5.48a1 1 0 0 1-1.506 0z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer
}

.form-hint {
    font-size: 11px;
    color: var(--text-3);
    margin-top: 5px
}

.btn-sm {
    padding: 7px 14px;
    border-radius: var(--radius);
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: all .15s;
    display: inline-flex;
    align-items: center;
    gap: 6px
}

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

.btn-brand:hover {
    background: var(--brand-dim)
}

.btn-outline {
    background: #fff;
    border: 1.5px solid var(--surface-3);
    color: var(--text-2)
}

.btn-outline:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: var(--brand-soft)
}

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

.btn-danger:hover {
    background: #dc2626
}

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

.btn-success:hover {
    background: #059669
}

/* ─── MODAL ─────────────────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .5);
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px)
}

.modal {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 28px;
    width: 100%;
    max-width: 480px;
    position: relative;
    box-shadow: var(--shadow-lg);
    animation: modalIn .2s ease
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.95) translateY(-10px)
    }

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

.modal-title {
    font-size: 17px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 4px
}

.modal-sub {
    font-size: 13px;
    color: var(--text-2);
    margin-bottom: 22px
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    border-radius: 7px;
    background: var(--surface-2);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-2)
}

.modal-close:hover {
    background: var(--surface-3);
    color: var(--text-1)
}

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

/* ─── DOCS / CODE ─────────────────────────────────────────── */
.code-block {
    background: #0f172a;
    border-radius: var(--radius-lg);
    padding: 20px;
    position: relative;
    margin: 12px 0
}

.code-block pre {
    font-family: 'JetBrains Mono', monospace;
    font-size: 12px;
    color: #e2e8f0;
    line-height: 1.7;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-all
}

.code-copy {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(255, 255, 255, .1);
    border: 1px solid rgba(255, 255, 255, .1);
    color: #e2e8f0;
    border-radius: 6px;
    padding: 5px 10px;
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500
}

.code-copy:hover {
    background: rgba(255, 255, 255, .2)
}

.code-lang {
    position: absolute;
    top: 12px;
    left: 12px;
    font-size: 10px;
    color: #64748b;
    font-family: 'JetBrains Mono', monospace;
    letter-spacing: .5px;
    text-transform: uppercase
}

/* ─── TABS ───────────────────────────────────────────────── */
.tabs {
    display: flex;
    gap: 2px;
    background: var(--surface-2);
    border-radius: var(--radius);
    padding: 3px;
    margin-bottom: 20px;
    overflow-x: auto
}

.tab {
    padding: 7px 16px;
    border-radius: 7px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: var(--text-2);
    white-space: nowrap;
    transition: all .15s
}

.tab.active {
    background: #fff;
    color: var(--brand);
    font-weight: 600;
    box-shadow: var(--shadow-sm)
}

.tab:hover:not(.active) {
    color: var(--text-1)
}

/* ─── EMPTY STATE ─────────────────────────────────────────── */
.empty {
    text-align: center;
    padding: 48px 20px
}

.empty-icon {
    font-size: 40px;
    margin-bottom: 12px;
    opacity: .3
}

.empty-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 6px
}

.empty-sub {
    font-size: 13px;
    color: var(--text-3)
}

/* ─── ADMIN ─────────────────────────────────────────────── */
.admin-badge {
    background: linear-gradient(135deg, #f59e0b, #ef4444);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 4px;
    letter-spacing: .5px
}

/* ─── PLAN CARDS ─────────────────────────────────────────── */
.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px
}

.plan-card {
    border: 2px solid var(--surface-3);
    border-radius: var(--radius-lg);
    padding: 20px;
    text-align: center;
    cursor: pointer;
    transition: all .2s;
    position: relative
}

.plan-card.selected {
    border-color: var(--brand);
    background: var(--brand-soft)
}

.plan-card:hover:not(.selected) {
    border-color: var(--brand);
    background: var(--brand-soft)
}

.plan-name {
    font-size: 14px;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 6px
}

.plan-price {
    font-size: 26px;
    font-weight: 800;
    color: var(--text-1);
    letter-spacing: -1px
}

.plan-price span {
    font-size: 12px;
    font-weight: 400;
    color: var(--text-3)
}

.plan-limit {
    font-size: 12px;
    color: var(--text-2);
    margin-top: 6px
}

/* ─── RESPONSIVE ─────────────────────────────────────────── */
@media(max-width:768px) {
    .sidebar {
        transform: translateX(-100%)
    }

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

    .main {
        margin-left: 0
    }

    .hamburger {
        display: flex
    }

    .content {
        padding: 16px
    }

    .topbar {
        padding: 12px 16px
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr
    }

    .plans-grid {
        grid-template-columns: 1fr 1fr
    }

    .modal {
        margin: 0;
        border-radius: var(--radius-xl) var(--radius-xl) 0 0;
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        max-width: 100%
    }

    .modal-overlay {
        align-items: flex-end;
        padding: 0
    }
}

.overlay-bg {
    position: fixed;
    inset: 0;
    z-index: 99;
    display: none
}

.overlay-bg.active {
    display: block
}