/* ============================================================================
   TumaSMS — portal styles (customer + admin)
   Look follows MMCONNECT-CRM; typeface follows Kuza Gateway (Plus Jakarta Sans)
   ========================================================================== */
:root {
    --primary: #F06355;
    --primary-hover: #DE4A3B;
    --primary-dark: #B23A2C;
    --primary-light: #FDEDEB;
    --primary-border: #F6B3AA;
    --accent: #F5C518;
    --font: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;

    --bg-body: #fbf6f4;
    --bg-card: #ffffff;
    --border: #ece3e0;
    --text-1: #221a18;
    --text-2: #35302e;
    --text-3: #6b6360;
    --text-4: #948b87;
    --hover-bg: #f7efed;

    --sidebar-width: 268px;
    --topbar-height: 64px;
    --sb-border: #f0e7e4;
    --sb-hover: #fdf2f0;
    --sb-text: #5c534f;
    --sb-section: #a89d98;

    --shadow-xs: 0 1px 3px rgba(150, 55, 45, .07);
    --shadow-sm: 0 2px 8px rgba(150, 55, 45, .08), 0 1px 3px rgba(150, 55, 45, .05);
    --shadow-md: 0 4px 16px rgba(150, 55, 45, .10), 0 2px 6px rgba(150, 55, 45, .06);
    --shadow-lg: 0 10px 28px rgba(150, 55, 45, .11), 0 4px 10px rgba(150, 55, 45, .07);

    --bs-primary: var(--primary);
    --bs-primary-rgb: 240, 99, 85;
    --bs-link-color: var(--primary-dark);
    --bs-link-color-rgb: 178, 58, 44;
    --bs-link-hover-color: var(--primary);
    --bs-body-font-family: var(--font);
    --bs-font-sans-serif: var(--font);
    --bs-body-color: var(--text-2);
    --bs-border-color: var(--border);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    font-family: var(--font);
    background: var(--bg-body);
    color: var(--text-2);
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    margin: 0;
}
h1, h2, h3, h4, h5, h6 { color: var(--text-1); font-weight: 700; letter-spacing: -.01em; }
a { text-decoration: none; }
.text-muted { color: var(--text-4) !important; }
.text-primary { color: var(--primary-dark) !important; }
.fw-800 { font-weight: 800; }
.small-caps { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-4); }
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .92em; }

/* ── Sidebar ─────────────────────────────────────────────────────────────── */
#sidebar {
    position: fixed; top: 0; left: 0; bottom: 0; width: var(--sidebar-width);
    background: #fff; border-right: 1px solid var(--sb-border);
    display: flex; flex-direction: column; z-index: 1050;
    box-shadow: 2px 0 12px rgba(150, 55, 45, .04);
    transition: transform .25s ease, width .2s ease;
}
.sidebar-brand {
    display: flex; align-items: center; gap: 12px; padding: 16px 20px;
    border-bottom: 1px solid var(--sb-border); height: var(--topbar-height); flex-shrink: 0;
}
.sidebar-brand img { width: 36px; height: 36px; border-radius: 10px; box-shadow: 0 4px 12px rgba(240, 99, 85, .35); }
.sidebar-brand .sb-name { display: block; font-weight: 800; color: var(--text-1); font-size: 15px; line-height: 1.15; }
.sidebar-brand .sb-sub { display: block; font-size: 10.5px; color: var(--text-4); font-weight: 600; letter-spacing: .04em; }
.sidebar-brand .sb-badge { font-size: 9px; background: var(--primary); color: #fff; padding: 2px 7px; border-radius: 10px; font-weight: 700; letter-spacing: .06em; }

.sidebar-scroll { flex: 1; overflow-y: auto; padding: 8px 0 12px; }
.sidebar-scroll::-webkit-scrollbar { width: 3px; }
.sidebar-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.nav-section { padding: 16px 22px 6px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .12em; color: var(--sb-section); }
.nav-wrap { padding: 1px 12px; }
.nav-link-item {
    position: relative; display: flex; align-items: center; gap: 11px;
    padding: 8px 10px; border-radius: 10px; color: var(--sb-text);
    font-size: 13.5px; font-weight: 500; transition: background .13s, color .13s;
    width: 100%; border: 0; background: transparent; text-align: left;
}
.nav-link-item .nav-icon {
    width: 30px; height: 30px; border-radius: 8px; flex-shrink: 0;
    display: inline-flex; align-items: center; justify-content: center;
    font-size: 15px; color: var(--text-4); background: #f8f3f1; transition: all .13s;
}
.nav-link-item:hover { background: var(--sb-hover); color: var(--text-1); }
.nav-link-item:hover .nav-icon { color: var(--primary); background: #fff; }
.nav-link-item.active { background: var(--primary-light); color: var(--primary-dark); font-weight: 700; }
.nav-link-item.active::before { content: ''; position: absolute; left: -12px; top: 8px; bottom: 8px; width: 4px; border-radius: 0 4px 4px 0; background: var(--primary); }
.nav-link-item.active .nav-icon { background: var(--primary); color: #fff; box-shadow: 0 3px 8px rgba(240, 99, 85, .35); }
.nav-chip { margin-left: auto; font-size: 10.5px; font-weight: 700; padding: 2px 8px; border-radius: 20px; background: #f3ebe8; color: var(--text-3); }
.nav-chip.chip-warn { background: #fef3c7; color: #92400e; }
.nav-chip.chip-danger { background: #fee2e2; color: #b91c1c; }
.nav-link-item.nav-logout { color: #dc2626; }
.nav-link-item.nav-logout .nav-icon { background: #fff1f2; color: #dc2626; }
.nav-link-item.nav-logout:hover { background: #fff1f2; }

.sidebar-balance {
    margin: 8px 16px 4px; padding: 14px 16px; border-radius: 14px; color: #fff;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 6px 16px rgba(178, 58, 44, .28); position: relative; overflow: hidden;
}
.sidebar-balance::after { content: ''; position: absolute; right: -24px; top: -24px; width: 90px; height: 90px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.sidebar-balance .lbl { font-size: 11px; opacity: .85; font-weight: 600; }
.sidebar-balance .val { font-size: 22px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; }
.sidebar-balance a { color: #fff; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; margin-top: 4px; position: relative; z-index: 1; }

.sidebar-footer { border-top: 1px solid var(--sb-border); padding: 10px 12px; flex-shrink: 0; }
.sidebar-user-btn {
    display: flex; align-items: center; gap: 10px; width: 100%; padding: 8px; border-radius: 10px;
    border: 0; background: transparent; text-align: left; transition: background .13s;
}
.sidebar-user-btn:hover { background: var(--sb-hover); }
.sb-user-name { font-size: 13px; font-weight: 700; color: var(--text-1); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-user-role { font-size: 11px; color: var(--text-4); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.avatar {
    width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0; object-fit: cover;
    display: inline-flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--primary-dark), var(--primary));
    color: #fff; font-size: 12px; font-weight: 800;
}
.avatar.avatar-lg { width: 64px; height: 64px; border-radius: 18px; font-size: 22px; }
.avatar.avatar-sm { width: 30px; height: 30px; border-radius: 8px; font-size: 11px; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
#topbar {
    position: fixed; top: 0; left: var(--sidebar-width); right: 0; height: var(--topbar-height);
    background: rgba(255, 255, 255, .9); backdrop-filter: saturate(180%) blur(10px);
    border-bottom: 1px solid var(--border); display: flex; align-items: center; gap: 12px;
    padding: 0 24px; z-index: 1040;
}
.topbar-title { font-size: 17px; font-weight: 800; color: var(--text-1); letter-spacing: -.02em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-crumb { font-size: 11.5px; color: var(--text-4); font-weight: 500; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.icon-btn {
    width: 38px; height: 38px; border-radius: 10px; border: 1px solid var(--border); background: #fff;
    display: inline-flex; align-items: center; justify-content: center; color: var(--text-3); font-size: 16px;
    transition: all .13s; flex-shrink: 0;
}
.icon-btn:hover { background: var(--hover-bg); color: var(--primary-dark); }
.balance-chip {
    display: inline-flex; align-items: center; gap: 8px; padding: 6px 12px 6px 8px; border-radius: 10px;
    background: var(--primary-light); color: var(--primary-dark); font-weight: 700; font-size: 13px; border: 1px solid var(--primary-border);
}
.balance-chip i { width: 24px; height: 24px; border-radius: 7px; background: var(--primary); color: #fff; display: inline-flex; align-items: center; justify-content: center; font-size: 12px; }
.mode-pill { font-size: 11px; font-weight: 700; padding: 5px 10px; border-radius: 20px; background: #fef3c7; color: #92400e; border: 1px solid #fde68a; }

#main-content { margin-left: var(--sidebar-width); padding-top: var(--topbar-height); min-height: 100vh; }
.content-area { padding: 24px; max-width: 1440px; }

#sidebarBackdrop { display: none; position: fixed; inset: 0; background: rgba(34, 26, 24, .45); z-index: 1045; backdrop-filter: blur(2px); }

@media (max-width: 991.98px) {
    #sidebar { transform: translateX(-100%); }
    body.sb-open #sidebar { transform: translateX(0); }
    body.sb-open #sidebarBackdrop { display: block; }
    #topbar { left: 0; padding: 0 16px; }
    #main-content { margin-left: 0; }
    .content-area { padding: 16px; }
}

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: 14px; box-shadow: var(--shadow-xs); }
.card-header { background: transparent; border-bottom: 1px solid var(--border); padding: 15px 20px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.card-header:first-child { border-radius: 14px 14px 0 0; }
.card-title { font-size: 14.5px; font-weight: 700; color: var(--text-1); margin: 0; }
.card-sub { font-size: 12px; color: var(--text-4); margin: 0; }
.card-body { padding: 20px; }
.card-footer { background: #fdfaf9; border-top: 1px solid var(--border); padding: 12px 20px; border-radius: 0 0 14px 14px; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.page-head h1 { font-size: 22px; font-weight: 800; margin: 0; }
.page-head p { margin: 4px 0 0; color: var(--text-3); font-size: 13.5px; }

/* Stat cards (gradient, CRM style) */
.stat-card { border-radius: 16px; padding: 20px; color: #fff; position: relative; overflow: hidden; border: 0; height: 100%; box-shadow: var(--shadow-sm); }
.stat-card::after { content: ''; position: absolute; top: -26px; right: -26px; width: 96px; height: 96px; border-radius: 50%; background: rgba(255, 255, 255, .12); }
.stat-card .stat-icon { width: 42px; height: 42px; border-radius: 12px; background: rgba(255, 255, 255, .2); display: inline-flex; align-items: center; justify-content: center; font-size: 19px; margin-bottom: 14px; }
.stat-card .stat-value { font-size: 26px; font-weight: 800; letter-spacing: -.03em; line-height: 1.1; }
.stat-card .stat-label { font-size: 12.5px; opacity: .88; font-weight: 600; margin-top: 4px; }
.stat-card .stat-foot { font-size: 11.5px; opacity: .8; margin-top: 10px; }
.stat-card.coral { background: linear-gradient(135deg, #B23A2C, #F06355); }
.stat-card.violet { background: linear-gradient(135deg, #6d28d9, #a78bfa); }
.stat-card.emerald { background: linear-gradient(135deg, #047857, #10b981); }
.stat-card.amber { background: linear-gradient(135deg, #b45309, #f59e0b); }
.stat-card.sky { background: linear-gradient(135deg, #0369a1, #38bdf8); }
.stat-card.slate { background: linear-gradient(135deg, #334155, #64748b); }

/* Mini stat (plain) */
.mini-stat { display: flex; flex-direction: row; align-items: center; gap: 14px; padding: 16px 18px; color: inherit; }
.card.mini-stat { flex-direction: row; }
a.card.mini-stat:hover { border-color: var(--primary-border); box-shadow: var(--shadow-sm); }
.mini-stat .ic { width: 44px; height: 44px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; font-size: 19px; flex-shrink: 0; }
.mini-stat .v { font-size: 20px; font-weight: 800; color: var(--text-1); line-height: 1.1; }
.mini-stat .l { font-size: 12px; color: var(--text-4); font-weight: 600; }
.ic-coral { background: var(--primary-light); color: var(--primary-dark); }
.ic-green { background: #dcfce7; color: #15803d; }
.ic-amber { background: #fef3c7; color: #b45309; }
.ic-blue { background: #dbeafe; color: #1d4ed8; }
.ic-violet { background: #ede9fe; color: #6d28d9; }
.ic-red { background: #fee2e2; color: #b91c1c; }

/* ── Tables ──────────────────────────────────────────────────────────────── */
.table { margin: 0; --bs-table-bg: transparent; }
.table > :not(caption) > * > * { padding: 12px 16px; border-bottom-color: var(--border); }
.table thead th { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--text-4); background: #fdf9f8; border-bottom: 1px solid var(--border); white-space: nowrap; }
.table td { vertical-align: middle; font-size: 13.5px; color: var(--text-2); }
.table tbody tr:last-child td { border-bottom: 0; }
.table-hover > tbody > tr:hover > * { --bs-table-hover-bg: #fdf6f4; background: #fdf6f4; }
.table .cell-user { display: flex; align-items: center; gap: 10px; min-width: 200px; }
.table .cell-user .n { font-weight: 700; color: var(--text-1); line-height: 1.2; }
.table .cell-user .e { font-size: 12px; color: var(--text-4); }
.table-responsive { border-radius: 0 0 14px 14px; }

/* ── Badges ──────────────────────────────────────────────────────────────── */
.badge { font-size: 11px; font-weight: 700; padding: 5px 9px; border-radius: 7px; letter-spacing: .01em; }
.badge-soft-success { background: #dcfce7; color: #166534; }
.badge-soft-warning { background: #fef3c7; color: #92400e; }
.badge-soft-danger { background: #fee2e2; color: #991b1b; }
.badge-soft-info { background: #dbeafe; color: #1e40af; }
.badge-soft-secondary { background: #f1ece9; color: #5c534f; }
.badge-soft-primary { background: var(--primary-light); color: var(--primary-dark); }
.badge-google { background: #fff; color: #3c4043; border: 1px solid #dadce0; }

/* ── Forms & buttons ─────────────────────────────────────────────────────── */
.form-label { font-size: 12.5px; font-weight: 700; color: var(--text-2); margin-bottom: 6px; }
.form-text { font-size: 12px; color: var(--text-4); }
.form-control, .form-select {
    border: 1px solid var(--border); border-radius: 10px; font-size: 13.5px; padding: 9px 13px; color: var(--text-1);
    background-color: #fff;
}
.form-control:focus, .form-select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(240, 99, 85, .14); }
.form-control-lg { font-size: 15px; padding: 11px 15px; }
.form-check-input:checked { background-color: var(--primary); border-color: var(--primary); }
.form-check-input:focus { box-shadow: 0 0 0 3px rgba(240, 99, 85, .18); border-color: var(--primary); }
.form-switch .form-check-input:focus { --bs-form-switch-bg: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23F6B3AA'/%3e%3c/svg%3e"); }
.input-group-text { background: #fdf9f8; border-color: var(--border); color: var(--text-3); border-radius: 10px; font-size: 13.5px; }

.btn { font-weight: 600; font-size: 13.5px; border-radius: 10px; padding: 8px 16px; }
.btn-sm { font-size: 12.5px; padding: 5px 11px; border-radius: 8px; }
.btn-lg { font-size: 15px; padding: 11px 22px; border-radius: 12px; }
.btn-primary { --bs-btn-bg: var(--primary); --bs-btn-border-color: var(--primary); --bs-btn-hover-bg: var(--primary-hover); --bs-btn-hover-border-color: var(--primary-hover); --bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark); --bs-btn-disabled-bg: var(--primary); --bs-btn-disabled-border-color: var(--primary); box-shadow: 0 3px 10px rgba(240, 99, 85, .28); }
.btn-outline-primary { --bs-btn-color: var(--primary-dark); --bs-btn-border-color: var(--primary-border); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-hover-color: #fff; --bs-btn-active-bg: var(--primary-dark); --bs-btn-active-border-color: var(--primary-dark); }
.btn-light { --bs-btn-bg: #fff; --bs-btn-border-color: var(--border); --bs-btn-hover-bg: var(--hover-bg); --bs-btn-hover-border-color: var(--border); --bs-btn-color: var(--text-2); }
.btn-soft { background: var(--primary-light); color: var(--primary-dark); border: 1px solid transparent; }
.btn-soft:hover { background: #fbdcd7; color: var(--primary-dark); }

/* Segmented tabs */
.seg { display: inline-flex; background: #f6efed; padding: 4px; border-radius: 12px; gap: 2px; flex-wrap: wrap; }
.seg a, .seg button { border: 0; background: transparent; padding: 7px 14px; border-radius: 9px; font-size: 13px; font-weight: 600; color: var(--text-3); white-space: nowrap; }
.seg a:hover, .seg button:hover { color: var(--text-1); }
.seg a.active, .seg button.active { background: #fff; color: var(--primary-dark); box-shadow: var(--shadow-xs); }
.seg .count { font-size: 11px; background: #ebe2df; color: var(--text-3); border-radius: 10px; padding: 1px 7px; margin-left: 4px; }
.seg .active .count { background: var(--primary-light); color: var(--primary-dark); }

/* Alerts */
.alert { border: 0; border-radius: 12px; border-left: 4px solid; font-size: 13.5px; padding: 12px 16px; }
.alert-success { background: #f0fdf4; color: #166534; border-left-color: #22c55e; }
.alert-danger { background: #fef2f2; color: #991b1b; border-left-color: #ef4444; }
.alert-warning { background: #fffbeb; color: #92400e; border-left-color: #f59e0b; }
.alert-info { background: #eff6ff; color: #1e40af; border-left-color: #3b82f6; }

/* Empty state */
.empty-state { text-align: center; padding: 56px 24px; }
.empty-state .ic { width: 72px; height: 72px; border-radius: 20px; background: var(--primary-light); color: var(--primary); font-size: 30px; display: flex; align-items: center; justify-content: center; margin: 0 auto 18px; }
.empty-state h5 { font-size: 16px; font-weight: 800; margin-bottom: 6px; }
.empty-state p { font-size: 13.5px; color: var(--text-4); max-width: 380px; margin: 0 auto 16px; }

/* Pagination */
.pagination { --bs-pagination-color: var(--text-3); --bs-pagination-border-color: var(--border); --bs-pagination-hover-bg: var(--hover-bg); --bs-pagination-hover-color: var(--primary-dark); --bs-pagination-active-bg: var(--primary); --bs-pagination-active-border-color: var(--primary); --bs-pagination-focus-box-shadow: 0 0 0 3px rgba(240, 99, 85, .15); margin: 0; font-size: 13px; }
.pagination-wrap { padding: 14px 20px; border-top: 1px solid var(--border); }
.pagination-wrap nav > div.d-sm-flex { gap: 12px; }
.pagination-wrap p.small { margin: 0; color: var(--text-4); }

/* Dropdown */
.dropdown-menu { border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--shadow-lg); padding: 6px; font-size: 13.5px; }
.dropdown-item { border-radius: 8px; padding: 8px 12px; color: var(--text-2); }
.dropdown-item:hover { background: var(--hover-bg); color: var(--text-1); }
.dropdown-item.active, .dropdown-item:active { background: var(--primary); }

/* Modal */
.modal-content { border: 0; border-radius: 18px; box-shadow: var(--shadow-lg); }
.modal-header { border-bottom: 1px solid var(--border); padding: 18px 22px; }
.modal-title { font-weight: 800; font-size: 16px; }
.modal-body { padding: 22px; }
.modal-footer { border-top: 1px solid var(--border); padding: 14px 22px; }

/* ── Compose page ────────────────────────────────────────────────────────── */
.sms-meter { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.sms-meter span { font-size: 12px; font-weight: 600; background: #f6efed; color: var(--text-3); padding: 4px 10px; border-radius: 8px; }
.sms-meter span b { color: var(--text-1); }
.sms-meter span.warn { background: #fef3c7; color: #92400e; }
.phone-preview {
    width: 100%; max-width: 300px; margin: 0 auto; border-radius: 36px; padding: 14px; background: #1f1a19;
    box-shadow: 0 20px 40px rgba(34, 26, 24, .25);
}
.phone-preview .screen { background: #f5f1f0; border-radius: 26px; min-height: 420px; padding: 18px 14px; display: flex; flex-direction: column; }
.phone-preview .from { text-align: center; font-size: 12px; color: var(--text-4); margin-bottom: 14px; }
.phone-preview .from .who { display: block; font-weight: 800; color: var(--text-1); font-size: 14px; }
.phone-preview .bubble { align-self: flex-start; max-width: 88%; background: #fff; border-radius: 18px 18px 18px 4px; padding: 10px 13px; font-size: 13px; line-height: 1.45; color: var(--text-1); box-shadow: var(--shadow-xs); white-space: pre-wrap; word-break: break-word; }
.phone-preview .bubble.empty { color: var(--text-4); font-style: italic; }
.summary-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px dashed var(--border); font-size: 13.5px; }
.summary-row:last-child { border-bottom: 0; }
.summary-row .k { color: var(--text-3); }
.summary-row .v { font-weight: 700; color: var(--text-1); }

.recipient-tabs .nav-link { color: var(--text-3); font-weight: 600; font-size: 13px; border-radius: 9px; padding: 7px 13px; }
.recipient-tabs .nav-link.active { background: var(--primary-light); color: var(--primary-dark); }
.group-pick { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 10px; cursor: pointer; transition: all .12s; margin: 0; }
.group-pick:hover { border-color: var(--primary-border); background: #fffaf9; }
.group-pick input:checked + .gp-body .gp-name { color: var(--primary-dark); }
.group-pick:has(input:checked) { border-color: var(--primary); background: var(--primary-light); }
.gp-name { font-weight: 700; color: var(--text-1); font-size: 13.5px; }
.gp-count { font-size: 12px; color: var(--text-4); }

/* Billing slider */
.price-slider { -webkit-appearance: none; appearance: none; width: 100%; height: 8px; border-radius: 8px; background: linear-gradient(to right, var(--primary) var(--fill, 20%), #f0e5e2 var(--fill, 20%)); outline: none; }
.price-slider::-webkit-slider-thumb { -webkit-appearance: none; appearance: none; width: 24px; height: 24px; border-radius: 50%; background: #fff; border: 4px solid var(--primary); box-shadow: 0 2px 8px rgba(178, 58, 44, .35); cursor: pointer; }
.price-slider::-moz-range-thumb { width: 18px; height: 18px; border-radius: 50%; background: #fff; border: 4px solid var(--primary); cursor: pointer; }
.tier-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); gap: 8px; }
.tier { border: 1px solid var(--border); border-radius: 12px; padding: 10px 12px; text-align: center; transition: all .15s; }
.tier .p { font-weight: 800; font-size: 16px; color: var(--text-1); }
.tier .r { font-size: 11px; color: var(--text-4); font-weight: 600; }
.tier.active { border-color: var(--primary); background: var(--primary-light); }
.tier.active .p { color: var(--primary-dark); }
.pay-method { display: flex; align-items: center; gap: 10px; padding: 11px 13px; border: 1px solid var(--border); border-radius: 12px; cursor: pointer; margin: 0; font-weight: 600; font-size: 13px; color: var(--text-2); }
.pay-method:has(input:checked) { border-color: var(--primary); background: var(--primary-light); color: var(--primary-dark); }
.pay-method input { accent-color: var(--primary); }

.code-block { background: #1f1a19; color: #f5ece9; border-radius: 12px; padding: 16px 18px; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 12.5px; line-height: 1.6; overflow-x: auto; white-space: pre; margin: 0; }
.code-block .c { color: #a89d98; }
.code-block .s { color: #fbbf9f; }
.key-box { display: flex; align-items: center; gap: 8px; background: #fdf9f8; border: 1px dashed var(--primary-border); border-radius: 12px; padding: 12px 14px; }
.key-box code { flex: 1; font-size: 13px; color: var(--text-1); word-break: break-all; }

.kv { display: grid; grid-template-columns: 140px 1fr; gap: 10px 14px; font-size: 13.5px; }
.kv dt { color: var(--text-4); font-weight: 600; }
.kv dd { margin: 0; color: var(--text-1); font-weight: 600; word-break: break-word; }

.progress { height: 8px; border-radius: 8px; background: #f2e9e6; }
.progress-bar { background: var(--primary); }

.repeater-row { display: grid; grid-template-columns: 1fr 1.6fr 38px; gap: 8px; margin-bottom: 8px; }

::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #e2d6d2; border-radius: 4px; }

/* ── Auth pages ──────────────────────────────────────────────────────────── */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-side {
    position: relative; overflow: hidden; color: #fff; padding: 48px 56px; display: flex; flex-direction: column;
    background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, .14), transparent 40%), linear-gradient(140deg, #8f2a1f 0%, #B23A2C 35%, #F06355 100%);
}
.auth-side::after { content: ''; position: absolute; width: 420px; height: 420px; border-radius: 50%; border: 60px solid rgba(255, 255, 255, .06); right: -140px; bottom: -140px; }
.auth-side h2 { color: #fff; font-size: 34px; font-weight: 800; letter-spacing: -.03em; line-height: 1.15; }
.auth-side p { color: rgba(255, 255, 255, .85); font-size: 15px; }
.auth-side .feat { display: flex; gap: 12px; align-items: flex-start; margin-bottom: 16px; position: relative; z-index: 1; }
.auth-side .feat i { width: 36px; height: 36px; border-radius: 10px; background: rgba(255, 255, 255, .16); display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; }
.auth-side .feat b { display: block; font-size: 14px; }
.auth-side .feat span { font-size: 13px; color: rgba(255, 255, 255, .78); }
.auth-main { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: #fff; }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h1 { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.btn-google {
    display: flex; align-items: center; justify-content: center; gap: 10px; width: 100%; padding: 11px 16px;
    border: 1px solid #dadce0; border-radius: 12px; background: #fff; color: #3c4043; font-weight: 700; font-size: 14px;
    transition: all .15s;
}
.btn-google:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(60, 64, 67, .2); color: #202124; }
.divider { display: flex; align-items: center; gap: 12px; color: var(--text-4); font-size: 12px; font-weight: 600; margin: 22px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }
@media (max-width: 991.98px) {
    .auth-wrap { grid-template-columns: 1fr; }
    .auth-side { display: none; }
}

/* Brand wordmark: Tuma + SMS */
.wordmark { font-weight: 800; letter-spacing: -.03em; color: var(--text-1); }
.wordmark .wm-accent { color: #E5503F; }
.site-footer .wordmark, .auth-side .wordmark { color: #fff; }
.site-footer .wordmark .wm-accent, .auth-side .wordmark .wm-accent { color: #FFB4A8; }

/* ── Collapsible sidebar (desktop icon rail) ─────────────────────────────── */
:root { --sidebar-collapsed: 78px; }
#topbar, #main-content { transition: left .2s ease, margin-left .2s ease; }
.sidebar-balance-mini { display: none; }
.sidebar-brand, .nav-link-item { white-space: nowrap; }
@media (min-width: 992px) {
    body.sb-collapsed #sidebar { width: var(--sidebar-collapsed); }
    body.sb-collapsed #topbar { left: var(--sidebar-collapsed); }
    body.sb-collapsed #main-content { margin-left: var(--sidebar-collapsed); }
    body.sb-collapsed .sidebar-brand { padding: 14px 0; justify-content: center; }
    body.sb-collapsed .sb-brand-text,
    body.sb-collapsed .sb-user-text,
    body.sb-collapsed .sidebar-balance,
    body.sb-collapsed .nav-link-item > span:not(.nav-icon):not(.nav-chip) { display: none; }
    body.sb-collapsed .nav-section { font-size: 0; padding: 10px 0 4px; margin: 0 22px; border-top: 1px solid var(--sb-border); }
    body.sb-collapsed .nav-section:first-of-type { border-top: 0; }
    body.sb-collapsed .nav-wrap { padding: 2px 12px; }
    body.sb-collapsed .nav-link-item { justify-content: center; padding: 7px 0; }
    body.sb-collapsed .nav-link-item.active::before { left: -12px; }
    body.sb-collapsed .nav-link-item .nav-icon { width: 36px; height: 36px; font-size: 16px; }
    body.sb-collapsed .nav-chip { position: absolute; top: 2px; right: 6px; margin: 0; padding: 0 5px; font-size: 9px; line-height: 15px; min-width: 15px; text-align: center; }
    body.sb-collapsed .sidebar-footer { padding: 10px 0; }
    body.sb-collapsed .sidebar-user-btn { justify-content: center; padding: 6px 0; }
    body.sb-collapsed .sidebar-balance-mini {
        display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; margin: 8px auto 2px;
        border-radius: 12px; color: #fff; font-size: 18px;
        background: linear-gradient(135deg, var(--primary), var(--primary-dark)); box-shadow: 0 4px 12px rgba(178, 58, 44, .3);
    }
}
/* Toggle icon: hamburger on mobile, sidebar icons on desktop */
#sidebarToggle .tg-expanded, #sidebarToggle .tg-collapsed { display: none; }
@media (min-width: 992px) {
    #sidebarToggle .tg-mobile { display: none; }
    body:not(.sb-collapsed) #sidebarToggle .tg-expanded { display: inline; }
    body.sb-collapsed #sidebarToggle .tg-collapsed { display: inline; }
}
