/* Trang dang dien thoai dung chung (quan tri, nhan vien, dang ky...) - cung kieu Thong ke / Khach hang */
:root { --ink: #0f172a; --muted: #64748b; --line: #e8ecf2; --bg: #f4f6fa; --blue: #2563eb; --green: #16a34a; --red: #dc2626; --amber: #b45309; }
[hidden] { display: none !important; }
* { box-sizing: border-box; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif; -webkit-font-smoothing: antialiased; overscroll-behavior: none; }
button, input, select, textarea { font: inherit; }
@media (max-width: 900px) { input, select, textarea { font-size: 16px !important; } }
a { color: var(--blue); }
.wrap { max-width: 980px; margin: 0 auto; padding: calc(env(safe-area-inset-top) + 10px) 14px 100px; }
.hd { display: flex; align-items: center; gap: 10px; margin: 2px 2px 12px; }
.hd img { width: 30px; height: 30px; border-radius: 8px; }
.hd h1 { font-size: 20px; margin: 0; flex: 1; }
.hd small { color: var(--muted); font-size: 13px; }
.card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; margin-bottom: 12px; }
.card h2 { font-size: 16px; margin: 0 0 10px; }
.kpi { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 12px; }
.kpi div { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 12px; }
.kpi b { display: block; font-size: 22px; } .kpi span { font-size: 12px; color: var(--muted); }
@media (max-width: 560px) { .kpi { grid-template-columns: repeat(2, 1fr); } }
.btn { border: 0; border-radius: 10px; padding: 9px 14px; background: var(--blue); color: #fff; font-weight: 600; cursor: pointer; white-space: nowrap; text-decoration: none; display: inline-block; }
.btn.ghost { background: #eef3fb; color: var(--blue); }
.btn.red { background: #fee2e2; color: var(--red); }
.btn.green { background: var(--green); }
.btn.sm { padding: 6px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.field { display: flex; flex-direction: column; gap: 4px; margin-bottom: 10px; }
.field label { font-size: 13px; color: #334155; font-weight: 600; }
.field input, .field select, .field textarea { border: 1px solid #d6dee9; border-radius: 10px; padding: 10px 12px; outline: 0; background: #fff; }
.field input:focus, .field select:focus { border-color: var(--blue); box-shadow: 0 0 0 3px #dbe7ff; }
.field small { color: var(--muted); font-size: 12px; }
.g2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 10px; }
@media (max-width: 560px) { .g2 { grid-template-columns: 1fr; } }
.row { display: grid; grid-template-columns: 1fr auto; gap: 8px 12px; align-items: center; padding: 12px 2px; border-top: 1px solid var(--line); }
.row:first-of-type { border-top: 0; }
.nm { font-weight: 700; font-size: 15px; } .ds { font-size: 12.5px; color: var(--muted); margin-top: 2px; line-height: 1.5; }
.acts { display: flex; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { display: inline-block; font-size: 11.5px; font-weight: 700; padding: 2px 8px; border-radius: 999px; margin-left: 4px; vertical-align: 1px; }
.chip.active { background: #dcfce7; color: #166534; } .chip.pending { background: #fef3c7; color: #92400e; } .chip.locked, .chip.expired { background: #fee2e2; color: #991b1b; }
.chip.plan { background: #eef2ff; color: #3730a3; } .chip.role { background: #f1f5f9; color: #334155; } .chip.me { background: #e0f2fe; color: #075985; }
.empty { color: var(--muted); text-align: center; padding: 20px; font-size: 14px; }
.toast { position: fixed; left: 50%; transform: translateX(-50%); bottom: calc(env(safe-area-inset-bottom) * .5 + 76px); background: #1f2937; color: #fff; border-radius: 12px; padding: 10px 16px; z-index: 90; font-size: 14px; max-width: calc(100vw - 24px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.toast.err { background: #991b1b; }
.secret { background: #fefce8; border: 1px dashed #eab308; border-radius: 12px; padding: 12px; margin: 10px 0; font-size: 14px; line-height: 1.7; }
.secret code { font-size: 17px; font-weight: 800; background: #fff; padding: 2px 8px; border-radius: 6px; letter-spacing: .5px; }
.modal { position: fixed; inset: 0; background: rgba(15,23,42,.45); display: flex; align-items: flex-end; justify-content: center; z-index: 80; }
.modal > div { background: #fff; width: min(560px, 100%); max-height: 92dvh; overflow: auto; border-radius: 18px 18px 0 0; padding: 16px 16px calc(env(safe-area-inset-bottom) + 16px); }
@media (min-width: 700px) { .modal { align-items: center; } .modal > div { border-radius: 18px; } }
.modal h3 { margin: 0 0 12px; font-size: 18px; display: flex; justify-content: space-between; align-items: center; }
.modal h3 button { background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--muted); }
.tabs-in { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.tabs-in button { border: 1px solid var(--line); background: #fff; border-radius: 999px; padding: 6px 12px; font-size: 13.5px; cursor: pointer; }
.tabs-in button.on { background: #e7f0ff; border-color: #bcd3ff; color: #1d4ed8; font-weight: 600; }
