/* ── Cabinet Layout ──────────────────────────────────── */

.auth-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9fafb;
}

.auth-page {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 24px;
}

.auth-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 36px 40px;
    width: 400px;
    box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.auth-logo {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.03em;
    margin-bottom: 4px;
}

.auth-tagline {
    font-size: 13px;
    color: #6b7280;
    margin-bottom: 24px;
}

/* ── Tabs ────────────────────────────────────────────── */

.auth-tabs {
    display: flex;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 24px;
    gap: 0;
}

.auth-tab {
    flex: 1;
    padding: 9px 0;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    font-size: 14px;
    font-weight: 500;
    color: #6b7280;
    cursor: pointer;
    transition: color 0.15s, border-color 0.15s;
}

.auth-tab.active {
    color: #2563eb;
    border-bottom-color: #2563eb;
}

.auth-panel { display: none; }
.auth-panel.active { display: block; }

.auth-bonus-note {
    background: #eff6ff;
    border: 1px solid #bfdbfe;
    color: #1d4ed8;
    border-radius: 6px;
    padding: 10px 13px;
    font-size: 12px;
    margin-bottom: 16px;
    line-height: 1.5;
}

.form-optional {
    font-size: 11px;
    color: #9ca3af;
    font-weight: 400;
}

/* ── Cabinet main layout ─────────────────────────────── */

.cab-layout {
    display: flex;
    min-height: 100vh;
}

.cab-sidebar {
    width: 220px;
    flex-shrink: 0;
    background: #111827;
    display: flex;
    flex-direction: column;
    padding: 0;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.cab-brand {
    font-size: 16px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.03em;
    padding: 24px 20px 20px;
    border-bottom: 1px solid rgba(255,255,255,.08);
}

.cab-nav {
    flex: 1;
    padding: 12px 0;
}

.cab-nav-item {
    display: flex;
    align-items: center;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 500;
    color: rgba(255,255,255,.6);
    text-decoration: none;
    transition: color 0.15s, background 0.15s;
    gap: 10px;
}

.cab-nav-item:hover {
    color: #fff;
    background: rgba(255,255,255,.06);
}

.cab-nav-item.active {
    color: #fff;
    background: rgba(37,99,235,.4);
}

.cab-nav-section {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,.25);
    padding: 16px 20px 6px;
}

/* ── Sidebar footer ──────────────────────────────────── */

.cab-sidebar-footer {
    border-top: 1px solid rgba(255,255,255,.08);
    padding: 16px 20px;
}

.cab-balance-block {
    background: rgba(37,99,235,.2);
    border: 1px solid rgba(37,99,235,.3);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 14px;
}

.cab-balance-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: rgba(255,255,255,.5);
    margin-bottom: 4px;
}

.cab-balance-value {
    font-size: 18px;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.02em;
    line-height: 1;
}

.cab-user-email {
    font-size: 12px;
    color: rgba(255,255,255,.45);
    margin-bottom: 8px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cab-logout {
    font-size: 12px;
    color: rgba(255,255,255,.4);
    text-decoration: none;
    transition: color 0.15s;
}

.cab-logout:hover {
    color: rgba(255,255,255,.7);
}

/* ── Main content ────────────────────────────────────── */

.cab-main {
    flex: 1;
    min-width: 0;
    background: #f9fafb;
    padding: 28px 32px;
}

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

.cab-page-title {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.03em;
}

/* ── Stat cards ──────────────────────────────────────── */

.cab-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
    gap: 14px;
    margin-bottom: 28px;
}

.cab-stat {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
}

.cab-stat-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: #9ca3af;
    margin-bottom: 8px;
}

.cab-stat-value {
    font-size: 28px;
    font-weight: 700;
    color: #111827;
    letter-spacing: -0.03em;
    line-height: 1;
}

.cab-stat-value.blue  { color: #2563eb; }
.cab-stat-value.green { color: #16a34a; }

.cab-ref-code {
    font-size: 18px;
    letter-spacing: 0.05em;
    cursor: pointer;
    user-select: all;
}

/* ── Section ─────────────────────────────────────────── */

.cab-section {
    margin-bottom: 28px;
}

.cab-section-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 14px;
}

/* ── Action cards grid ───────────────────────────────── */

.cab-actions-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 12px;
}

.cab-action-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 18px 20px;
    text-decoration: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    display: block;
}

.cab-action-card:hover {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

.cab-action-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 4px;
}

.cab-action-desc {
    font-size: 12px;
    color: #6b7280;
    line-height: 1.4;
}

/* ── Cabinet table wrapper ───────────────────────────── */

.cab-table-wrap {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    overflow: hidden;
}

.cab-table-header {
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cab-table-title {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
}

/* ── Status badges ───────────────────────────────────── */

.badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 9px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
}

.badge-green  { background: #dcfce7; color: #16a34a; }
.badge-gray   { background: #f3f4f6; color: #6b7280; }
.badge-blue   { background: #dbeafe; color: #2563eb; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-amber  { background: #fef3c7; color: #d97706; }

/* ── Empty state ─────────────────────────────────────── */

.cab-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.cab-empty-title {
    font-size: 15px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.cab-empty-desc {
    font-size: 13px;
    margin-bottom: 20px;
}

/* ── Card ────────────────────────────────────────────── */

.cab-card {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 10px;
    padding: 24px;
    margin-bottom: 20px;
}

.cab-card-title {
    font-size: 15px;
    font-weight: 600;
    color: #111827;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid #f3f4f6;
}

/* ── Referral link block ─────────────────────────────── */

.ref-link-block {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 20px;
}

.ref-link-url {
    flex: 1;
    font-size: 13px;
    color: #374151;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ── Modal ───────────────────────────────────────────── */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 100;
    align-items: center;
    justify-content: center;
}

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

.modal {
    background: #fff;
    border-radius: 12px;
    width: 520px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
}

.modal-header {
    padding: 20px 24px 16px;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.modal-title {
    font-size: 16px;
    font-weight: 600;
    color: #111827;
}

.modal-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #9ca3af;
    cursor: pointer;
    line-height: 1;
    padding: 2px 6px;
}

.modal-close:hover { color: #374151; }

.modal-body {
    padding: 20px 24px;
}

.modal-footer {
    padding: 14px 24px;
    border-top: 1px solid #e5e7eb;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* ── Tickets ─────────────────────────────────────────── */

.ticket-row {
    display: flex;
    align-items: center;
    padding: 14px 20px;
    border-bottom: 1px solid #f3f4f6;
    gap: 14px;
    text-decoration: none;
    color: inherit;
    transition: background 0.1s;
}

.ticket-row:last-child { border-bottom: none; }
.ticket-row:hover { background: #fafafa; }

.ticket-subject {
    flex: 1;
    font-size: 14px;
    font-weight: 500;
    color: #111827;
}

.ticket-meta {
    font-size: 12px;
    color: #9ca3af;
}

/* ── Balance / transaction ───────────────────────────── */

.tx-type-label {
    font-size: 12px;
    color: #6b7280;
}

.tx-amount {
    font-weight: 600;
}

.tx-amount.positive { color: #16a34a; }
.tx-amount.negative { color: #dc2626; }

/* ── Responsive ──────────────────────────────────────── */

@media (max-width: 768px) {
    .cab-sidebar {
        width: 60px;
    }
    .cab-brand,
    .cab-nav-item span,
    .cab-sidebar-footer { display: none; }
    .cab-main { padding: 16px; }
    .cab-stats { grid-template-columns: repeat(2, 1fr); }
}
