/* ── Reset ──────────────────────────────────────────────────────────────── */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html,body{height:100%}
body{font-family:-apple-system,"Segoe UI",system-ui,sans-serif;font-size:14px;line-height:1.6;color:#1f2328;background:#eef1f7}

/* ── Layout ─────────────────────────────────────────────────────────────── */
.app-body{height:100vh;overflow:hidden;background:#eef1f7}
#app-shell{display:flex;flex-direction:column;height:100vh;overflow:hidden}
#app-shell.hidden{display:none!important}
.app-shell-inner{display:flex;flex:1;overflow:hidden}
.sidebar{width:210px;min-width:210px;background:linear-gradient(180deg,#0e1726 0%,#131f35 100%);display:flex;flex-direction:column;height:100%;overflow:hidden;flex-shrink:0;transition:transform .25s ease;border-right:1px solid rgba(255,255,255,.06)}
.main-content{flex:1;overflow-y:auto;padding:24px;background:#eef1f7}

/* ── Sidebar ────────────────────────────────────────────────────────────── */
.sidebar-logo{padding:18px 16px 14px;font-size:15px;font-weight:800;color:#fff;letter-spacing:.5px;border-bottom:1px solid rgba(255,255,255,.07);display:flex;align-items:center;gap:8px}
.sidebar-logo-icon{width:28px;height:28px;background:linear-gradient(135deg,#3b82d4,#6366f1);border-radius:8px;display:flex;align-items:center;justify-content:center;font-size:14px;flex-shrink:0}
.sidebar-nav{flex:1;padding:8px 0;overflow-y:auto}
.nav-item{width:100%;display:flex;align-items:center;gap:10px;padding:9px 14px;background:none;border:none;color:rgba(255,255,255,.55);font-size:13px;cursor:pointer;text-align:left;border-radius:0;transition:all .15s;position:relative}
.nav-item:hover{background:rgba(255,255,255,.06);color:rgba(255,255,255,.9)}
.nav-item.active{background:rgba(59,130,212,.18);color:#fff;font-weight:600}
.nav-item.active::before{content:'';position:absolute;left:0;top:0;bottom:0;width:3px;background:linear-gradient(180deg,#3b82d4,#6366f1);border-radius:0 2px 2px 0}
.nav-icon{font-size:15px;width:20px;text-align:center;flex-shrink:0}
.nav-label{font-size:13px}
.sidebar-footer{padding:10px 12px 14px;border-top:1px solid rgba(255,255,255,.07)}
.sidebar-user{display:flex;align-items:center;gap:8px;margin-bottom:10px;padding:8px 6px;border-radius:8px;background:rgba(255,255,255,.05)}
.user-avatar{width:32px;height:32px;border-radius:50%;background:linear-gradient(135deg,#3b82d4,#6366f1);color:#fff;font-size:13px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-shrink:0}
.user-name{font-size:12.5px;font-weight:600;color:#fff;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.user-role{font-size:10px;color:rgba(255,255,255,.4);text-transform:uppercase;letter-spacing:.06em}
/* sidebar action buttons */
.btn-sidebar-action{flex:1;padding:6px 4px;background:rgba(255,255,255,.07);border:1px solid rgba(255,255,255,.1);border-radius:7px;color:rgba(255,255,255,.65);cursor:pointer;font-size:11.5px;transition:all .15s;text-align:center;white-space:nowrap}
.btn-sidebar-action:hover{background:rgba(255,255,255,.13);color:#fff}
.btn-logout{flex:1;padding:6px 8px;background:rgba(220,38,38,.15);border:1px solid rgba(220,38,38,.3);border-radius:7px;color:rgba(255,100,100,.85);cursor:pointer;font-size:11.5px;transition:all .15s;display:flex;align-items:center;justify-content:center;gap:5px;white-space:nowrap}
.btn-logout:hover{background:rgba(220,38,38,.35);border-color:rgba(220,38,38,.6);color:#fff}

/* ── Hamburger (mobile only) ────────────────────────────────────────────── */
.hamburger{display:none;align-items:center;justify-content:center;width:38px;height:38px;background:none;border:1.5px solid rgba(255,255,255,.2);border-radius:7px;cursor:pointer;color:#fff;font-size:18px;flex-shrink:0;margin-right:4px}
.hamburger:hover{background:rgba(255,255,255,.1)}

/* Mobile top bar shown only on small screens */
.mobile-topbar{display:none;align-items:center;gap:8px;padding:10px 14px;background:#0e1726;border-bottom:1px solid rgba(255,255,255,.08);position:sticky;top:0;z-index:90}
.mobile-topbar-title{color:#fff;font-size:15px;font-weight:700;flex:1}

/* Overlay backdrop */
.sidebar-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,.5);z-index:199;backdrop-filter:blur(2px)}
.sidebar-overlay.active{display:block}

/* ── Login ──────────────────────────────────────────────────────────────── */
.login-page{position:fixed;inset:0;display:flex;align-items:center;justify-content:center;background:linear-gradient(135deg,#0e1726 0%,#1a2d4e 50%,#0e1726 100%);z-index:100;padding:16px}
.login-card{background:#fff;border:none;border-radius:16px;padding:44px 40px;width:100%;max-width:400px;box-shadow:0 20px 60px rgba(0,0,0,.35)}
.login-logo{font-size:40px;text-align:center;margin-bottom:10px}
.login-title{font-size:24px;font-weight:800;text-align:center;margin-bottom:4px;color:#0e1726}
.login-sub{font-size:13px;color:#57606a;text-align:center;margin-bottom:28px}
.login-error{background:#fef2f2;border:1px solid #fca5a5;border-radius:8px;padding:10px 14px;font-size:13px;color:#991b1b;margin-bottom:16px}
.form-group{margin-bottom:16px}
.form-group label{display:block;font-size:12.5px;font-weight:600;color:#374151;margin-bottom:6px;text-transform:uppercase;letter-spacing:.04em}
.form-group input,.form-group select{width:100%;padding:10px 14px;border:1.5px solid #e5e7eb;border-radius:9px;font-size:14px;outline:none;transition:border-color .15s,box-shadow .15s;background:#fff}
.form-group input:focus,.form-group select:focus{border-color:#3b82d4;box-shadow:0 0 0 3px rgba(59,130,212,.12)}
.btn-block{width:100%;padding:11px;font-size:14px;margin-top:8px;border-radius:9px;font-weight:600}

/* ── Public share page ─────────────────────────────────────────────────── */
.share-page{min-height:100vh;background:#f1f5f9;padding:22px;overflow-y:auto}
.share-page.hidden{display:none!important}
.share-shell{max-width:980px;margin:0 auto;background:#fff;border:1px solid #e5e7eb;border-radius:16px;box-shadow:0 10px 30px rgba(15,23,42,.08);padding:20px}
.share-header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;border-bottom:1px solid #e5e7eb;padding-bottom:14px;margin-bottom:14px;flex-wrap:wrap}
.share-header h1{font-size:20px;color:#0e1726;margin-bottom:4px}
.share-subtitle{font-size:13px;color:#64748b}
.share-price{background:#dcfce7;color:#15803d;border:1px solid #86efac;border-radius:999px;padding:7px 13px;font-size:13px;font-weight:800}
.share-credentials{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:10px}
.share-credentials>div{background:#f8fafc;border:1px solid #e5e7eb;border-radius:10px;padding:10px 12px}
.share-label{font-size:11px;text-transform:uppercase;letter-spacing:.06em;color:#64748b;font-weight:700;margin-bottom:5px}
.share-value{display:flex;align-items:center;gap:8px;font-size:14px;font-weight:700;color:#0f172a;word-break:break-all}
.share-vietqr{display:flex;align-items:center;justify-content:space-between;gap:14px;background:#f8fafc;border:1px solid #dbeafe;border-radius:12px;padding:12px;margin-bottom:10px;flex-wrap:wrap}
.share-vietqr.hidden{display:none!important}
.share-vietqr-bank{font-size:14px;font-weight:800;color:#0f172a;margin-bottom:4px}
.share-vietqr-code{font-size:12.5px;color:#475569;margin-bottom:4px}
.share-vietqr-amount{font-size:18px;font-weight:900;color:#15803d;margin-bottom:8px}
.share-vietqr-img{width:280px;max-width:100%;border:1px solid #e5e7eb;border-radius:10px;background:#fff;padding:8px}
.share-payment-lock{background:#fff7ed;border:1px solid #fdba74;color:#9a3412;border-radius:10px;padding:10px 12px;font-size:13px;font-weight:700;margin-bottom:10px}
.share-payment-lock.hidden{display:none!important}
.share-note{background:#fffbeb;border:1px solid #fde68a;color:#92400e;border-radius:9px;padding:9px 12px;font-size:12.5px;margin-bottom:10px}
.share-toolbar{display:flex;align-items:center;gap:8px;flex-wrap:wrap;margin:12px 0}
.share-email-list{border-top:1px solid #e5e7eb;padding-top:8px}
.share-email-detail{border-top:1px solid #e5e7eb;padding-top:12px}

/* ── Quick OTP Banner ────────────────────────────────────────────────────── */
.share-quick-extract{margin-bottom:12px;padding:14px 16px;background:linear-gradient(135deg,#fffbeb 0%,#fef3c7 100%);border:2px solid #f59e0b;border-radius:14px;animation:otp-pulse-border 2.5s ease-in-out infinite}
.share-quick-extract.hidden{display:none!important}
.share-quick-extract-title{font-size:11px;font-weight:700;color:#92400e;letter-spacing:.07em;text-transform:uppercase;margin-bottom:8px;opacity:.8}
.share-quick-extract-body{display:flex;flex-wrap:wrap;gap:8px;align-items:center}
.share-otp-badge{display:inline-flex;align-items:center;gap:8px;background:#fff;border:2px solid #f59e0b;border-radius:10px;padding:8px 14px;cursor:pointer;user-select:none;transition:background .15s,transform .1s;box-shadow:0 2px 8px rgba(245,158,11,.18)}
.share-otp-badge:hover{background:#fef9c3;transform:scale(1.03)}
.share-otp-badge:active{transform:scale(.97)}
.share-otp-badge.copied{background:#dcfce7;border-color:#22c55e}
.share-otp-badge-code{font-size:22px;font-weight:900;color:#92400e;letter-spacing:.12em;font-variant-numeric:tabular-nums}
.share-otp-badge-icon{font-size:13px;opacity:.6}
.share-link-badge{display:inline-flex;align-items:center;gap:5px;background:#eff6ff;border:1.5px solid #3b82f6;border-radius:9px;padding:7px 13px;color:#1d4ed8;font-weight:600;font-size:13px;text-decoration:none;transition:background .15s}
.share-link-badge:hover{background:#dbeafe}
@keyframes otp-pulse-border{0%,100%{border-color:#f59e0b;box-shadow:0 0 0 0 rgba(245,158,11,.2)}50%{border-color:#d97706;box-shadow:0 0 0 6px rgba(245,158,11,0)}}

/* ── Page structure ─────────────────────────────────────────────────────── */
.page{display:none}.page.active{display:block}
.page-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:20px;gap:12px;flex-wrap:wrap}
.page-header h2{font-size:19px;font-weight:800;color:#0e1726;letter-spacing:-.02em}
.page-subtitle{margin-top:2px;color:#64748b;font-size:12.5px}
.page-header-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap}

/* ── Stats chips ────────────────────────────────────────────────────────── */
.stats-row{display:flex;gap:8px;flex-wrap:wrap}
.stat-chip{padding:4px 13px;border-radius:20px;font-size:12px;font-weight:600;background:#f1f5f9;border:1px solid #e2e8f0;color:#475569}
.chip-green{background:#dcfce7;border-color:#86efac;color:#15803d}
.chip-amber{background:#fef3c7;border-color:#fde68a;color:#92400e}
.chip-red{background:#fee2e2;border-color:#fca5a5;color:#991b1b}
.chip-gray{background:#f1f5f9;border-color:#cbd5e1;color:#64748b}

/* ── Filter bar ─────────────────────────────────────────────────────────── */
.filter-bar{display:flex;flex-wrap:wrap;gap:8px;margin-bottom:16px;align-items:center}
.filter-input{padding:8px 12px;border:1.5px solid #e2e8f0;border-radius:8px;font-size:13px;outline:none;min-width:180px;background:#fff;transition:all .15s;color:#1f2328;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.filter-input:focus{border-color:#3b82d4;box-shadow:0 0 0 3px rgba(59,130,212,.1)}
.filter-select{padding:8px 10px;border:1.5px solid #e2e8f0;border-radius:8px;font-size:13px;outline:none;background:#fff;cursor:pointer;color:#1f2328;transition:all .15s;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.filter-select:focus{border-color:#3b82d4}
.filter-select-sm{padding:5px 8px;font-size:12.5px}
.input-number{width:58px;padding:7px 8px;border:1.5px solid #e2e8f0;border-radius:8px;font-size:13px;outline:none;text-align:center}

/* ── Account operations workspace ──────────────────────────────────────── */
.account-ops-panel{background:#fff;border:1px solid #dfe6ef;border-radius:12px;padding:14px;margin-bottom:14px;box-shadow:0 1px 4px rgba(15,23,42,.05)}
.account-summary-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}
.account-metric{position:relative;overflow:hidden;border:1px solid #e5e7eb;border-radius:10px;background:#f8fafc;padding:12px 14px;min-height:92px}
.account-metric::before{content:'';position:absolute;left:0;top:0;bottom:0;width:4px;background:#94a3b8}
.account-metric.metric-ready{background:#f0fdf4;border-color:#bbf7d0}
.account-metric.metric-ready::before{background:#16a34a}
.account-metric.metric-junk{background:#fff7ed;border-color:#fed7aa}
.account-metric.metric-junk::before{background:#f97316}
.metric-label{font-size:11px;font-weight:800;text-transform:uppercase;color:#64748b;letter-spacing:.06em}
.metric-value{font-size:28px;line-height:1.15;font-weight:850;color:#111827;margin-top:7px}
.metric-hint{font-size:12px;color:#64748b;margin-top:2px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.account-toolbar{display:flex;align-items:center;gap:8px;padding-top:12px;border-top:1px solid #edf1f5;flex-wrap:wrap}
.account-search-wrap{position:relative;flex:1;min-width:260px}
.account-search-icon{position:absolute;left:11px;top:50%;transform:translateY(-50%);color:#94a3b8;font-size:18px;line-height:1;pointer-events:none}
.account-search{width:100%;min-width:0;padding-left:34px}
.account-limit-select{min-width:116px}
.account-refresh-btn{height:36px}

/* ── Buttons ────────────────────────────────────────────────────────────── */
.btn{padding:7px 15px;border-radius:8px;border:1.5px solid #e2e8f0;background:#fff;cursor:pointer;font-size:13px;font-weight:500;transition:all .15s;white-space:nowrap;color:#374151;box-shadow:0 1px 3px rgba(0,0,0,.06)}
.btn:hover{background:#f3f4f6;border-color:#9ca3af;box-shadow:0 2px 6px rgba(0,0,0,.08)}
.btn-primary{background:linear-gradient(135deg,#3b82d4,#2563eb);border-color:#2563eb;color:#fff;box-shadow:0 2px 8px rgba(37,99,235,.25)}
.btn-primary:hover{background:linear-gradient(135deg,#2d74c5,#1d4ed8);border-color:#1d4ed8;box-shadow:0 3px 12px rgba(37,99,235,.35)}
.btn-danger{background:linear-gradient(135deg,#ef4444,#dc2626);border-color:#dc2626;color:#fff;box-shadow:0 2px 8px rgba(220,38,38,.2)}
.btn-danger:hover{background:linear-gradient(135deg,#dc2626,#b91c1c);box-shadow:0 3px 12px rgba(220,38,38,.3)}
.btn-success{background:linear-gradient(135deg,#22c55e,#16a34a);border-color:#16a34a;color:#fff;box-shadow:0 2px 8px rgba(22,163,74,.2)}
.btn-success:hover{background:linear-gradient(135deg,#16a34a,#15803d)}
.btn-warning{background:linear-gradient(135deg,#f59e0b,#d97706);border-color:#d97706;color:#fff;box-shadow:0 2px 8px rgba(217,119,6,.2)}
.btn-warning:hover{background:linear-gradient(135deg,#d97706,#b45309)}
.btn-token{background:#fff7ed;border-color:#f59e0b;color:#92400e}
.btn-token:hover{background:#fef3c7}
.btn-sm{padding:5px 11px;font-size:12.5px}
.btn-group{display:flex;gap:6px;align-items:center}

/* ── Card ───────────────────────────────────────────────────────────────── */
.card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:22px;box-shadow:0 1px 4px rgba(0,0,0,.05)}
.mb-10{margin-bottom:10px}.mb-12{margin-bottom:12px}.mt-8{margin-top:8px}
.text-muted{color:#57606a;font-size:13px}
code{background:#f1f5f9;padding:2px 6px;border-radius:4px;font-size:12px;font-family:monospace}
.file-input{display:block;margin:8px 0}

/* ── Table ──────────────────────────────────────────────────────────────── */
.table-wrap{background:#fff;border:1px solid #e5e7eb;border-radius:12px;overflow:hidden;box-shadow:0 1px 4px rgba(0,0,0,.05)}
.data-table{width:100%;border-collapse:collapse}
.data-table thead tr{background:linear-gradient(180deg,#f8fafc,#f1f5f9)}
.data-table th{padding:11px 13px;text-align:left;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#64748b;border-bottom:1.5px solid #e5e7eb;white-space:nowrap}
.data-table td{padding:9px 13px;border-bottom:1px solid #f1f5f9;font-size:13px;max-width:200px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.data-table tbody tr:last-child td{border-bottom:none}
.data-table tbody tr:hover td{background:#f7f9fc}

/* ── Badges ─────────────────────────────────────────────────────────────── */
.badge{display:inline-block;padding:2px 9px;border-radius:12px;font-size:11px;font-weight:700;text-transform:uppercase;letter-spacing:.04em}
.badge-active{background:#dcfce7;color:#15803d}
.badge-expired{background:#fef3c7;color:#92400e}
.badge-error{background:#fee2e2;color:#991b1b}
.badge-unknown{background:#f1f5f9;color:#64748b}
.badge-checking{background:#e0f2fe;color:#0369a1}
.badge-admin{background:#ede9fe;color:#6d28d9}
.badge-user{background:#dbeafe;color:#1d4ed8}

/* ── Import tabs ────────────────────────────────────────────────────────── */
.tab-bar{display:flex;gap:4px;margin-bottom:16px;border-bottom:1px solid #e5e7eb;padding-bottom:8px;flex-wrap:wrap}
.tab-btn{background:none;border:1.5px solid transparent;border-radius:8px;padding:5px 13px;cursor:pointer;font-size:13px;color:#57606a;transition:all .15s}
.tab-btn.active{background:#eff6ff;border-color:#3b82d4;color:#1d4ed8;font-weight:600}
.tab-btn:hover:not(.active){background:#f3f4f6}
.tab-content{display:none}.tab-content.active{display:block}
.tab-content>*{margin-bottom:10px}
textarea{width:100%;resize:vertical;border:1.5px solid #e2e8f0;border-radius:8px;padding:10px;font-size:13px;font-family:monospace;outline:none;transition:border-color .15s}
textarea:focus{border-color:#3b82d4}
.import-result{margin-top:14px;padding:12px 16px;border-radius:8px;background:#f0fdf4;border:1px solid #86efac;font-size:13px}
.import-result.has-error{background:#fef2f2;border-color:#fca5a5}

/* ── Modal form helpers ─────────────────────────────────────────────────── */
.modal-title{font-size:16px;font-weight:700;margin-bottom:16px;color:#1f2328}
.mform-group{margin-bottom:14px}
.mform-label{display:block;font-size:13px;font-weight:600;color:#374151;margin-bottom:5px}
.mform-input{width:100%;padding:9px 12px;border:1.5px solid #e2e8f0;border-radius:8px;font-size:14px;outline:none;transition:all .15s;background:#fff;color:#1f2328}
.mform-input:focus{border-color:#3b82d4;box-shadow:0 0 0 3px rgba(59,130,212,.1)}
.mform-footer{margin-top:20px;display:flex;justify-content:flex-end;gap:8px}
.modal .btn{padding:9px 18px;font-size:13.5px}
.modal .btn-sm{padding:7px 13px;font-size:13px}

/* ── Customer status badges ──────────────────────────────────────────────── */
.cust-status-badge{display:inline-block;padding:2px 8px;border-radius:10px;font-size:10.5px;font-weight:700;letter-spacing:.02em;white-space:nowrap;flex-shrink:0}
.cs-normal{background:#f1f5f9;color:#475569}
.cs-pending{background:#fef3c7;color:#92400e}
.cs-prepaid{background:#dcfce7;color:#15803d}
.cs-delivery{background:#dbeafe;color:#1d4ed8}
/* Platform badge */
.cust-platform-badge{display:inline-flex;align-items:center;gap:3px;padding:2px 7px;border-radius:10px;font-size:10.5px;font-weight:600;background:#f0f9ff;color:#0369a1;border:1px solid #bae6fd;white-space:nowrap;flex-shrink:0}

/* ── Customers ──────────────────────────────────────────────────────────── */
.customers-layout{display:grid;grid-template-columns:260px 1fr;gap:16px;height:calc(100vh - 130px)}
.customer-list-panel{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:14px;overflow-y:auto;box-shadow:0 1px 4px rgba(0,0,0,.05)}
.customer-detail-panel{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:20px;overflow-y:auto;box-shadow:0 1px 4px rgba(0,0,0,.05)}
.customer-item{padding:9px 10px;border-radius:8px;cursor:pointer;border:1px solid transparent;margin-bottom:3px;transition:all .12s}
.customer-item:hover{background:#f3f4f6}
.customer-item.selected{background:#eff6ff;border-color:#bfdbfe}
.customer-detail-header{display:flex;align-items:flex-start;justify-content:space-between;margin-bottom:18px;padding-bottom:14px;border-bottom:1px solid #e5e7eb;flex-wrap:wrap;gap:10px}
.cust-name-title{font-size:18px;font-weight:700}
.section-block{margin-bottom:16px;padding:14px;background:#f8fafc;border-radius:10px;border:1px solid #e5e7eb}
.section-block-header{display:flex;align-items:center;justify-content:space-between;margin-bottom:10px;flex-wrap:wrap;gap:8px}
.cust-account-item{display:flex;align-items:center;justify-content:space-between;padding:7px 0;border-bottom:1px solid #e5e7eb;font-size:13px}
.cust-account-item:last-child{border:none}

/* ── Customer account cards ─────────────────────────────────────────────── */
#cust-accounts-list{list-style:none;display:flex;flex-direction:column;gap:7px;margin-top:4px}
.cust-acc-card{background:#fff;border:1.5px solid #e5e7eb;border-radius:11px;overflow:hidden;transition:all .15s;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.cust-acc-card:hover{box-shadow:0 2px 8px rgba(0,0,0,.08)}
.cust-acc-card-open{border-color:#3b82d4;box-shadow:0 2px 12px rgba(59,130,212,.15)}
.cust-acc-header{display:flex;align-items:center;gap:8px;padding:10px 13px;cursor:pointer;user-select:none;transition:background .1s}
.cust-acc-header:hover{background:#f7f9fc}
.cust-acc-chevron{font-size:16px;color:#9ca3af;transition:transform .2s;line-height:1;display:inline-block;flex-shrink:0}
.cust-acc-info{flex:1;display:flex;align-items:center;gap:7px;overflow:hidden;min-width:0}
.cust-acc-email{font-size:13px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cust-acc-note-preview{font-size:11.5px;color:#57606a;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:160px}
.acc-assigned-at{font-size:11px;color:#9ca3af;white-space:nowrap;flex-shrink:0}
.cust-acc-badges{display:flex;align-items:center;gap:6px;flex-shrink:0}
.cust-delivery-badge{display:inline-flex;align-items:center;gap:3px;padding:3px 9px;border-radius:12px;font-size:11.5px;font-weight:600;cursor:pointer;user-select:none;transition:all .15s;white-space:nowrap}
.cust-delivery-badge:hover{opacity:.8}
.cust-delivery-badge.delivered{background:#dcfce7;color:#15803d;border:1px solid #86efac}
.cust-delivery-badge.undelivered{background:#f1f5f9;color:#64748b;border:1px solid #cbd5e1}
/* Paid badge */
.cust-paid-badge{display:inline-flex;align-items:center;gap:3px;padding:3px 9px;border-radius:12px;font-size:11.5px;font-weight:600;cursor:pointer;user-select:none;transition:all .15s;white-space:nowrap}
.cust-paid-badge:hover{opacity:.8}
.cust-paid-badge.paid{background:#dcfce7;color:#15803d;border:1px solid #86efac}
.cust-paid-badge.unpaid{background:#fef3c7;color:#92400e;border:1px solid #fde68a}
.cust-acc-body{background:#f8fafc;border-top:1px solid #e5e7eb}
.cust-acc-section{padding:12px 14px;border-bottom:1px solid #e5e7eb}
.cust-acc-section:last-child{border-bottom:none}
.cust-acc-section-title{font-size:11.5px;font-weight:700;text-transform:uppercase;letter-spacing:.05em;color:#64748b;margin-bottom:8px}

/* ── Customer mail rows ─────────────────────────────────────────────────── */
.cust-mail-row{background:#fff;border:1px solid #e5e7eb;border-radius:8px;margin-bottom:5px;overflow:hidden;transition:all .12s}
.cust-mail-row.unread{border-left:3px solid #3b82d4;background:#eff6ff}
.cust-mail-row-main{display:flex;align-items:center;gap:8px;padding:9px 12px;cursor:pointer;transition:background .1s}
.cust-mail-row-main:hover{background:#f7f9fc}
.cust-mail-chevron{font-size:14px;color:#9ca3af;transition:transform .2s;line-height:1;flex-shrink:0}
.cust-mail-subject{font-size:13px;font-weight:600;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.cust-mail-meta{font-size:11px;color:#57606a;display:flex;gap:10px;flex-wrap:wrap;margin-top:1px}
.cust-mail-body{padding:10px 12px 12px;border-top:1px solid #e5e7eb;background:#f8fafc}
.cust-mail-preview{font-size:12px;color:#374151;line-height:1.6;white-space:pre-wrap;margin-bottom:8px;padding:8px;background:#fff;border:1px solid #e5e7eb;border-radius:6px;max-height:100px;overflow-y:auto}
.cust-mail-detail-grid{display:flex;flex-wrap:wrap;gap:4px 16px;font-size:12px;color:#57606a}

/* ── OTP / link extraction ──────────────────────────────────────────────── */
.otp-box{display:inline-flex;align-items:center;gap:6px;background:#fef9c3;border:1.5px solid #fcd34d;border-radius:8px;padding:5px 12px;font-size:14px;font-weight:700;color:#78350f;letter-spacing:.12em;cursor:pointer;user-select:all;margin:4px 0;transition:background .12s}
.otp-box:hover{background:#fef3c7}
.otp-copied{background:#dcfce7!important;border-color:#86efac!important;color:#15803d!important}
.verify-link-box{display:inline-flex;align-items:center;gap:6px;background:#eff6ff;border:1.5px solid #93c5fd;border-radius:8px;padding:5px 12px;font-size:12.5px;font-weight:600;color:#1d4ed8;cursor:pointer;margin:4px 0;max-width:100%;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:background .12s}
.verify-link-box:hover{background:#dbeafe}
.extracted-info{margin-top:6px;display:flex;flex-wrap:wrap;gap:5px;align-items:center}
.extracted-info-label{display:none}
.otp-pill{display:inline-flex;align-items:center;gap:4px;background:#fef9c3;border:1.5px solid #fcd34d;border-radius:6px;padding:2px 9px;font-size:12.5px;font-weight:700;color:#78350f;letter-spacing:.08em;cursor:pointer;white-space:nowrap;transition:background .12s}
.otp-pill:hover,.otp-pill:active{background:#fde68a}
.otp-pill.copied{background:#dcfce7;border-color:#86efac;color:#166534}
.link-pill{display:inline-flex;align-items:center;gap:4px;background:#eff6ff;border:1.5px solid #93c5fd;border-radius:6px;padding:2px 10px;font-size:12px;font-weight:600;color:#1d4ed8;white-space:nowrap;text-decoration:none;transition:background .12s}
.link-pill:hover{background:#dbeafe}

/* ── Customer live-mail detail panel ────────────────────────────────────── */
.cust-live-detail{padding:12px 14px;background:#fff;border-top:1px solid #e5e7eb}

/* ── Inbox ───────────────────────────────────────────────────────────────── */
.inbox-layout{display:grid;grid-template-columns:230px 1fr;gap:16px;height:calc(100vh - 130px)}
.inbox-sidebar{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:14px;overflow-y:auto;box-shadow:0 1px 4px rgba(0,0,0,.05)}
.inbox-main{background:#fff;border:1px solid #e5e7eb;border-radius:12px;display:flex;flex-direction:column;overflow:hidden;box-shadow:0 1px 4px rgba(0,0,0,.05)}
.inbox-toolbar{padding:10px 14px;border-bottom:1.5px solid #e5e7eb;display:flex;align-items:center;gap:8px;flex-wrap:wrap;background:linear-gradient(180deg,#f8fafc,#f1f5f9)}
.inbox-active-label{font-weight:600;font-size:13px;flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:80px;color:#1d4ed8}
.email-list-wrap{flex:1;overflow-y:auto;padding:6px 0}
.email-item{padding:13px 16px;margin:0 8px 6px;border:1.5px solid #e5e7eb;border-radius:10px;cursor:pointer;transition:all .12s;background:#fff}
.email-item:hover{background:#f7f9fc;border-color:#c7d2e0;box-shadow:0 2px 8px rgba(0,0,0,.06)}
.email-item.unread{background:#eff6ff;border-color:#bfdbfe;border-left:3px solid #3b82d4}
.email-subject{font-weight:600;font-size:13.5px;margin-bottom:3px}
.email-meta{font-size:11.5px;color:#57606a;display:flex;gap:12px;margin-bottom:2px;flex-wrap:wrap}
.email-preview{font-size:12px;color:#6b7280;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.attach-icon{color:#3b82d4}
.email-detail-panel{flex:1;overflow-y:auto;padding:20px}
.email-detail-panel.hidden{display:none}
#email-detail-content h2{font-size:16px;margin:10px 0 6px}
.meta-row{font-size:12px;color:#57606a;margin-bottom:3px}
.body-wrap{margin-top:14px;border-top:1px solid #e5e7eb;padding-top:14px;font-size:13.5px;line-height:1.7;max-height:60vh;overflow-y:auto}
.inbox-account-item{padding:8px 10px;border-radius:8px;cursor:pointer;font-size:12.5px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;transition:background .1s;margin-bottom:2px;border:1px solid transparent}
.inbox-account-item:hover{background:#f3f4f6}
.inbox-account-item.selected{background:#eff6ff;border-color:#bfdbfe;font-weight:600}
#inbox-account-list li{padding:8px 10px;border-radius:8px;cursor:pointer;font-size:12.5px;display:flex;align-items:center;justify-content:space-between;transition:all .12s;margin-bottom:2px;border:1px solid transparent;overflow:hidden}
#inbox-account-list li:hover{background:#f3f4f6}
#inbox-account-list li.selected{background:#eff6ff;border-color:#bfdbfe;font-weight:600}
.inbox-account-email{overflow:hidden;text-overflow:ellipsis;white-space:nowrap;min-width:0}
.new-mail-tag{margin-left:6px;padding:2px 6px;border-radius:999px;background:#dcfce7;color:#15803d;font-size:10px;font-weight:800;line-height:1.2;flex-shrink:0;text-transform:uppercase;letter-spacing:.03em}
.acc-status{flex-shrink:0;margin-left:6px}

/* ── Modal ───────────────────────────────────────────────────────────────── */
.modal-overlay{position:fixed;inset:0;background:rgba(0,0,0,.55);display:flex;align-items:center;justify-content:center;z-index:999;backdrop-filter:blur(3px);padding:16px}
.modal{background:#fff;border-radius:14px;padding:26px;min-width:320px;max-width:min(620px,92vw);width:100%;max-height:88vh;overflow-y:auto;box-shadow:0 16px 50px rgba(0,0,0,.25);position:relative}
/* Table inside modal: luôn scroll ngang */
.modal .table-scroll{overflow-x:auto;-webkit-overflow-scrolling:touch;margin:0 -4px;padding:0 4px}
.modal table{width:100%;min-width:340px}
/* flex rows in modal: wrap on small screens */
.modal-flex-row{display:flex;align-items:center;flex-wrap:wrap;gap:8px}
.modal-x{position:absolute;top:14px;right:14px;background:none;border:none;font-size:16px;cursor:pointer;color:#9ca3af;line-height:1;padding:4px}
.modal-x:hover{color:#374151}
.modal-footer{margin-top:16px;display:flex;justify-content:flex-end;gap:8px;flex-wrap:wrap}

/* ── Payment modal ──────────────────────────────────────────────────────── */
.payment-modal-body{text-align:center}
.payment-qr-wrap{background:linear-gradient(135deg,#e8f4fd,#dbeafe);border-radius:16px;padding:24px 20px;display:inline-block;margin:0 auto 16px}
.payment-qr-img{width:220px;height:220px;border-radius:10px;display:block;box-shadow:0 4px 16px rgba(0,0,0,.15)}
.payment-bank-name{font-size:13px;font-weight:700;color:#1d4ed8;margin-bottom:4px;text-transform:uppercase;letter-spacing:.05em}
.payment-account-name{font-size:18px;font-weight:800;color:#0e1726;margin-bottom:4px}
.payment-account-number{font-size:15px;font-weight:600;color:#374151;background:#f1f5f9;padding:6px 16px;border-radius:8px;display:inline-block;margin-bottom:4px;font-family:monospace;letter-spacing:.05em}
.payment-bank-branch{font-size:12px;color:#57606a;margin-bottom:12px}
.payment-note{font-size:12.5px;color:#92400e;background:#fef3c7;border:1px solid #fde68a;border-radius:7px;padding:8px 14px;text-align:center}

/* ── Bug report modal ───────────────────────────────────────────────────── */
.bug-form-group{margin-bottom:12px}
.bug-form-group label{display:block;font-size:12.5px;font-weight:600;color:#374151;margin-bottom:5px}
.bug-form-group textarea,.bug-form-group input,.bug-form-group select{width:100%;padding:8px 11px;border:1.5px solid #e2e8f0;border-radius:7px;font-size:13px;outline:none;font-family:inherit;transition:border-color .15s}
.bug-form-group textarea:focus,.bug-form-group input:focus,.bug-form-group select:focus{border-color:#3b82d4}

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast{position:fixed;bottom:24px;right:24px;background:#1a1f2e;color:#fff;padding:11px 20px;border-radius:10px;font-size:13.5px;z-index:9999;max-width:calc(100vw - 48px);box-shadow:0 6px 20px rgba(0,0,0,.3)}
.toast.success{background:linear-gradient(135deg,#16a34a,#15803d)}
.toast.error{background:linear-gradient(135deg,#dc2626,#b91c1c)}

/* ── Spinner ─────────────────────────────────────────────────────────────── */
.spinner{display:inline-block;width:13px;height:13px;border:2px solid #e5e7eb;border-top-color:#3b82d4;border-radius:50%;animation:spin .6s linear infinite;vertical-align:middle;margin-right:5px}
@keyframes spin{to{transform:rotate(360deg)}}

/* ── Pagination ──────────────────────────────────────────────────────────── */
#pagination-bar{padding:12px 4px 6px}
.pagination{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}
.pg-info{font-size:12.5px;color:#57606a}
.pg-btns{display:flex;align-items:center;gap:3px;flex-wrap:wrap}
.pg-btn{min-width:30px;height:30px;padding:0 6px;border:1.5px solid #e5e7eb;background:#fff;border-radius:7px;font-size:12.5px;cursor:pointer;color:#374151;transition:all .12s}
.pg-btn:hover:not(:disabled){background:#f3f4f6;border-color:#9ca3af}
.pg-btn.active{background:#3b82d4;border-color:#3b82d4;color:#fff;font-weight:700}
.pg-btn:disabled{opacity:.4;cursor:default}
.pg-ellipsis{padding:0 4px;color:#9ca3af;font-size:13px;line-height:30px}

/* ── Empty ───────────────────────────────────────────────────────────────── */
.empty-state{padding:40px;text-align:center;color:#57606a;font-size:13.5px}

/* ── Account group rows ──────────────────────────────────────────────────── */
.acc-group-row td{background:#f8fafc;font-size:12px;font-weight:700;color:#334155;padding:8px 13px;cursor:pointer;user-select:none;border-top:1px solid #e5e7eb;border-bottom:1px solid #e5e7eb}
.acc-group-row:hover td{background:#eef6ff}
.acc-group-row td .grp-chevron{display:inline-block;transition:transform .18s;margin-right:6px;font-style:normal;color:#3b82d4}
.acc-group-row.grp-collapsed td .grp-chevron{transform:rotate(-90deg)}
.acc-group-row td .grp-badge{display:inline-flex;align-items:center;gap:5px;margin-left:8px;font-weight:400;color:#57606a;font-size:11.5px}
tr.acc-group-hidden{display:none}

/* ── Account type tabs (Mail nguyên liệu / Mail có mã) ──────────────────── */
.acc-type-tabs{display:flex;gap:6px;margin-bottom:14px;border:none;border-radius:0;overflow:visible;background:transparent;box-shadow:none}
.acc-type-tab{flex:1;padding:10px 12px;border:1.5px solid #e2e8f0;background:#fff;cursor:pointer;font-size:13px;font-weight:650;color:#57606a;transition:all .15s;border-radius:10px;white-space:nowrap;text-align:center;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.acc-type-tab:last-child{border-right:none}
.acc-type-tab:hover:not(.active){background:#f8fafc;color:#374151;border-color:#cbd5e1}
.acc-type-tab.active{background:#eff6ff;border-color:#93c5fd;color:#1d4ed8;font-weight:800;box-shadow:0 3px 10px rgba(37,99,235,.10)}
.acc-type-count{font-size:11px;font-weight:600;color:#64748b;margin-left:4px;padding:1px 6px;background:#e2e8f0;border-radius:8px}
.acc-type-tab.active .acc-type-count{background:#dbeafe;color:#1d4ed8}
/* junk tab active */
.acc-type-tab[data-type="junk"].active{color:#b91c1c;background:#fff1f2;border-color:#fecdd3;box-shadow:0 3px 10px rgba(225,29,72,.08)}
.acc-type-tab[data-type="junk"].active .acc-type-count{background:#fee2e2;color:#b91c1c}

/* Dropdown đổi loại tài khoản trong bảng */
.acc-type-select{padding:3px 6px;font-size:11.5px;border:1.5px solid #e2e8f0;border-radius:6px;background:#f8fafc;color:#374151;cursor:pointer;outline:none;max-width:116px}
.acc-type-select:focus{border-color:#3b82d4}

/* Section label giữa các bảng */
.acc-section-label{font-size:12px;font-weight:800;color:#334155;text-transform:uppercase;letter-spacing:.06em;padding:16px 2px 7px;display:flex;align-items:center;gap:8px}
.acc-section-label::after{content:'';flex:1;height:1px;background:#e5e7eb}

/* ── Bulk action toolbar ─────────────────────────────────────────────────── */
.bulk-toolbar{position:sticky;top:0;z-index:40;display:flex;align-items:center;flex-wrap:wrap;gap:8px;padding:10px 14px;background:#0f172a;border:1.5px solid #1e293b;border-radius:10px;margin-bottom:12px;font-size:13px;box-shadow:0 8px 20px rgba(15,23,42,.18)}
.bulk-toolbar.hidden{display:none!important}
.bulk-count{font-weight:800;color:#fff;min-width:80px}
.bulk-sep{color:#64748b}
.bulk-action-label{color:#cbd5e1;font-size:12.5px}
.bulk-type-btn{background:#fff;border:1.5px solid #e2e8f0}
.bulk-type-btn:hover{border-color:#3b82d4;background:#eff6ff}
.bulk-cb-cell{width:32px;text-align:center;padding:0 4px!important}
.bulk-row-cb{width:14px;height:14px;cursor:pointer;accent-color:#3b82d4}
.grp-select-btn{margin-left:10px;padding:2px 8px;font-size:11px;background:#fff;border:1px solid #bfdbfe;color:#1d4ed8;vertical-align:middle}
.grp-select-btn:hover{background:#dbeafe;border-color:#93c5fd}

/* ── Import type selector ────────────────────────────────────────────────── */
.import-type-row{display:flex;align-items:flex-start;gap:12px;margin-bottom:14px;padding:10px 14px;background:#f8fafc;border:1.5px solid #e2e8f0;border-radius:8px;flex-wrap:wrap}
.import-type-label{font-size:12.5px;font-weight:600;color:#374151;white-space:nowrap;padding-top:2px}
.import-type-opts{display:flex;flex-wrap:wrap;gap:8px}
.import-type-opt{display:flex;align-items:center;gap:5px;cursor:pointer;font-size:13px;padding:4px 10px;border:1.5px solid #e2e8f0;border-radius:7px;background:#fff;transition:all .12s}
.import-type-opt:hover{border-color:#3b82d4;background:#eff6ff}
.import-type-opt input[type=radio]{accent-color:#3b82d4;width:13px;height:13px;cursor:pointer}
.import-type-opt:has(input:checked){border-color:#3b82d4;background:#dbeafe}

/* ── Checkbox multi-select ───────────────────────────────────────────────── */
.assign-check-item{display:flex;align-items:center;gap:10px;padding:8px 12px;border-bottom:1px solid #f1f5f9;font-size:13px;cursor:pointer}
.assign-check-item:hover{background:#f7f9fc}
.assign-check-item input[type=checkbox]{width:15px;height:15px;cursor:pointer;accent-color:#3b82d4}
.assign-check-item label{flex:1;cursor:pointer}

/* ── Dashboard ───────────────────────────────────────────────────────────── */
.dash-cards-row{display:grid;grid-template-columns:repeat(4,1fr);gap:12px;margin-bottom:16px}
.dash-card{background:#fff;border:1px solid #e5e7eb;border-radius:12px;padding:18px 20px;box-shadow:0 1px 4px rgba(0,0,0,.05);transition:box-shadow .15s}
.dash-card:hover{box-shadow:0 4px 12px rgba(0,0,0,.08)}
.dash-card-accent{border-color:#3b82d4;background:linear-gradient(135deg,#eff6ff,#dbeafe)}
.dash-card-label{font-size:11.5px;color:#64748b;font-weight:600;text-transform:uppercase;letter-spacing:.05em;margin-bottom:8px}
.dash-card-value{font-size:24px;font-weight:800;color:#0e1726;letter-spacing:-.03em}
.dash-card-accent .dash-card-value{color:#2563eb}

/* ── Copy inline button ─────────────────────────────────────────────────── */
.btn-copy-inline{display:inline-flex;align-items:center;justify-content:center;width:20px;height:20px;padding:0;background:none;border:1px solid #d1d5db;border-radius:4px;cursor:pointer;font-size:11px;color:#9ca3af;transition:all .12s;flex-shrink:0;line-height:1}
.btn-copy-inline:hover{background:#f3f4f6;color:#374151;border-color:#9ca3af}
.btn-copy-inline.copied{background:#dcfce7;border-color:#86efac;color:#15803d}

/* ── Platform badge copyable ────────────────────────────────────────────── */
.platform-copyable{cursor:pointer;transition:opacity .12s}
.platform-copyable:hover{opacity:.8}
.platform-copyable.copied{background:#dcfce7!important;border-color:#86efac!important;color:#15803d!important}

/* ── Settings page ───────────────────────────────────────────────────────── */
.settings-section-title{font-size:12px;font-weight:700;text-transform:uppercase;letter-spacing:.06em;color:#64748b;margin-bottom:16px;padding-bottom:8px;border-bottom:1px solid #e5e7eb}
.settings-row{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:12px 0;border-bottom:1px solid #f1f5f9}
.settings-row:last-of-type{border-bottom:none}
.settings-label{flex:1;min-width:0}
.settings-label>span:first-child{display:block;font-size:13.5px;font-weight:600;color:#374151;margin-bottom:2px}
.settings-hint{display:block;font-size:12px;color:#9ca3af;line-height:1.4}
.settings-control{flex-shrink:0}

/* ── Utilities ───────────────────────────────────────────────────────────── */
.hidden{display:none!important}
#app-shell.hidden{display:none!important}

/* ════════════════════════════════════════════════════════════════════════
   RESPONSIVE — Tablet  (≤ 900px)
   ════════════════════════════════════════════════════════════════════════ */
@media(max-width:900px){
  .main-content{padding:16px}
  .account-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
  .customers-layout{grid-template-columns:220px 1fr}
  .inbox-layout{grid-template-columns:200px 1fr}
}
/* ── Mobile Bottom Nav ───────────────────────────────────────────────────── */
.mobile-bottom-nav{display:none}

/* ======================== RESPONSIVE - Mobile (640px) ======================== */
@media(max-width:640px){

  /* Shell */
  .app-body{overflow:hidden;height:100dvh}
  #app-shell{flex-direction:column;height:100dvh;overflow:hidden}
  .app-shell-inner{flex:1;overflow:hidden;min-height:0}

  /* Sidebar drawer */
  .sidebar{position:fixed;top:0;left:0;width:240px!important;min-width:240px!important;height:100dvh!important;z-index:300;transform:translateX(-100%);box-shadow:6px 0 32px rgba(0,0,0,.4)}
  .sidebar.open{transform:translateX(0)}
  .nav-label{display:block!important}

  /* Top bar */
  .mobile-topbar{display:flex;height:52px;flex-shrink:0}
  .hamburger{display:flex}

  /* Main content — padded for bottom nav */
  .main-content{flex:1;overflow-y:auto;padding:12px 12px 80px;min-height:0}

  /* Bottom nav */
  .mobile-bottom-nav{display:flex;position:fixed;bottom:0;left:0;right:0;height:60px;background:#0e1726;border-top:1px solid rgba(255,255,255,.1);z-index:200;padding-bottom:env(safe-area-inset-bottom,0)}
  .mbn-item{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;background:none;border:none;color:rgba(255,255,255,.5);cursor:pointer;font-size:11px;padding:6px 4px;transition:color .15s;-webkit-tap-highlight-color:transparent}
  .mbn-item:active{background:rgba(255,255,255,.07)}
  .mbn-item.active{color:#fff}
  .mbn-item.active .mbn-icon{background:rgba(59,130,212,.3);border-radius:10px;padding:2px 10px}
  .mbn-icon{font-size:20px;line-height:1.2;display:block}
  .mbn-label{font-size:10px;white-space:nowrap}

  /* Page header */
  .page-header{flex-direction:row;align-items:center;flex-wrap:wrap;gap:8px;margin-bottom:12px}
  .page-header h2{font-size:15px}
  .page-header-actions{flex-wrap:wrap;gap:6px}
  .stats-row{gap:4px}
  .stat-chip{font-size:10.5px;padding:2px 8px}

  /* Filter bar */
  .filter-bar{gap:6px}
  .filter-input{min-width:0;flex:1 1 100%}
  .filter-select{flex:1 1 calc(50% - 3px)}
  .account-ops-panel{padding:10px;border-radius:10px;margin-bottom:10px}
  .account-summary-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
  .account-metric{min-height:82px;padding:10px 11px}
  .metric-value{font-size:22px}
  .metric-hint{font-size:11px}
  .account-toolbar{gap:6px}
  .account-search-wrap{min-width:0;flex:1 1 100%}
  .account-limit-select{flex:1 1 calc(50% - 3px)}
  .account-refresh-btn{flex:1 1 calc(50% - 3px)}
  .acc-type-tabs{overflow-x:auto;padding-bottom:2px}
  .acc-type-tab{flex:0 0 auto;min-width:132px;padding:8px 10px}
  .bulk-toolbar{top:52px;border-radius:9px}

  /* Table */
  .table-wrap{overflow-x:auto;-webkit-overflow-scrolling:touch;border-radius:10px}
  .data-table{min-width:520px}
  .data-table th,.data-table td{padding:8px 10px;font-size:12px}

  /* Dashboard */
  .dash-cards-row{grid-template-columns:repeat(2,1fr);gap:8px}
  .dash-card{padding:14px}
  .dash-card-value{font-size:20px}

  /* Customers */
  .customers-layout{grid-template-columns:1fr;height:auto;gap:10px}
  .customer-list-panel{max-height:240px;border-radius:10px}
  .customer-detail-panel{border-radius:10px;min-height:280px;padding:12px}
  .cust-name-title{font-size:16px}
  .customer-detail-header{flex-direction:column;align-items:flex-start}
  .cust-acc-header{flex-wrap:wrap;gap:6px}
  .cust-acc-badges{flex-wrap:wrap}
  /* Acc card section toolbar */
  .cust-acc-section-title>div{flex-wrap:wrap!important;gap:4px!important}

  /* Inbox */
  .inbox-layout{grid-template-columns:1fr;height:auto;gap:10px}
  .inbox-sidebar{max-height:180px;border-radius:10px}
  .inbox-main{border-radius:10px;min-height:320px}
  .inbox-toolbar{gap:6px;padding:8px 10px;flex-wrap:wrap}
  .inbox-active-label{display:block;font-size:12px;flex:1 1 100%;order:-1}
  .input-number{width:50px}
  .email-item{padding:11px 13px}
  .email-subject{font-size:13px}

  /* Pills */
  .otp-pill{font-size:12px;padding:3px 9px}
  .link-pill{font-size:11.5px;padding:3px 9px}

  /* Cards */
  .card{padding:14px;border-radius:10px}
  .card[style*="max-width"]{max-width:100%!important}

  /* Modal from bottom */
  .modal-overlay{align-items:flex-end;padding:0}
  .modal{min-width:0;width:100%;max-width:100%;border-radius:18px 18px 0 0;max-height:92dvh;padding:20px 16px calc(24px + env(safe-area-inset-bottom,0))}
  /* Content inside modal mobile */
  .modal .mform-footer{flex-wrap:wrap}
  .modal .mform-footer .btn{flex:1 1 calc(50% - 4px);text-align:center}
  /* Assign list in modal */
  .assign-list-wrap{max-height:220px!important}
  /* Button groups in modal header */
  .modal [style*="display:flex"]{flex-wrap:wrap}

  /* Toast above bottom nav */
  .toast{bottom:72px;right:12px;left:12px;text-align:center;font-size:13px}

  /* Login */
  .login-page{align-items:flex-end;background:linear-gradient(180deg,#0e1726 30%,#1a2d4e 100%)}
  .login-card{border-radius:20px 20px 0 0;padding:32px 20px calc(24px + env(safe-area-inset-bottom,0));max-width:100%}
  .login-title{font-size:20px}

  /* Import */
  .tab-bar{gap:3px}
  .tab-btn{padding:5px 9px;font-size:12px}
  textarea{font-size:12px}

  /* Sidebar footer compact */
  .btn-sidebar-action,.btn-logout{font-size:10.5px;padding:5px 4px}

  /* Buttons */
  .btn{padding:7px 12px;font-size:13px}
  .btn-sm{padding:6px 10px;font-size:12px}
  .btn-group{flex-wrap:wrap}

  /* Section block */
  .section-block{padding:10px;border-radius:8px}
  .section-block-header{flex-direction:column;align-items:flex-start}
}
