:root{
  --fb-blue:#1877f2;
  --fb-blue-dark:#0866d8;
  --bg:#f0f2f5;
  --surface:#ffffff;
  --surface-soft:#f7f8fa;
  --text:#050505;
  --muted:#65676b;
  --line:#d8dadf;
  --line-soft:#eef0f3;
  --green:#00a400;
  --red:#d93025;
  --amber:#b7791f;
  --shadow:0 1px 2px rgba(0,0,0,.10),0 8px 24px rgba(0,0,0,.06);
  --radius:12px;
}
*{box-sizing:border-box}
html{font-size:15px}
body{margin:0;background:var(--bg);color:var(--text);font-family:Segoe UI,Roboto,Helvetica,Arial,sans-serif;-webkit-font-smoothing:antialiased}
a{text-decoration:none;color:inherit}
button,input,textarea,select{font:inherit}

.fb-topbar{height:58px;background:var(--surface);border-bottom:1px solid var(--line);display:flex;align-items:center;gap:12px;padding:7px max(12px,env(safe-area-inset-left));position:sticky;top:0;z-index:30;box-shadow:0 1px 2px rgba(0,0,0,.05)}
.fb-brand{display:flex;align-items:center;min-width:124px;max-width:190px;height:44px;overflow:hidden}
.logo-img{max-width:170px;max-height:44px;width:auto;height:auto;object-fit:contain;display:block}
.fb-nav{margin-left:auto;display:flex;align-items:center;gap:6px}
.fb-nav a,.user-chip{height:38px;display:inline-flex;align-items:center;justify-content:center;border-radius:999px;padding:0 13px;font-size:13px;font-weight:700;color:#3a3b3c;white-space:nowrap}
.fb-nav a:hover{background:#f2f3f5}
.fb-nav .nav-primary{background:var(--fb-blue);color:#fff}.fb-nav .nav-primary:hover{background:var(--fb-blue-dark)}
.logout-link{color:#d93025!important}.user-chip{background:#eef3ff;color:#1d4ed8;max-width:170px;overflow:hidden;text-overflow:ellipsis}
.nav-toggle{display:none}.hamburger{display:none;margin-left:auto;width:42px;height:38px;border-radius:999px;background:#f2f3f5;align-items:center;justify-content:center;flex-direction:column;gap:4px;cursor:pointer}.hamburger span{width:18px;height:2px;background:#4b5563;border-radius:2px}

.page-shell{width:min(1180px,100%);margin:0 auto;padding:14px 12px 34px}
.flash-stack{margin:0 0 10px}.flash{padding:10px 12px;border-radius:10px;margin:0 0 8px;border:1px solid;font-weight:650;font-size:13px;background:#fff}.flash.success{background:#ecfdf3;border-color:#b7ebc6;color:#176b2c}.flash.danger{background:#fff1f0;border-color:#ffccc7;color:#a8071a}.flash.warning{background:#fffbe6;border-color:#ffe58f;color:#8a5a00}

.page-head{display:flex;justify-content:space-between;align-items:flex-end;gap:12px;margin:4px 0 12px}.compact-head{align-items:center}.eyebrow{margin:0 0 3px;color:var(--fb-blue);font-size:11px;font-weight:900;text-transform:uppercase;letter-spacing:.06em}.title{margin:0 0 3px;font-size:22px;line-height:1.15;font-weight:800}.sub{margin:0;color:var(--muted);font-size:13px;line-height:1.35}

.card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:12px;margin-bottom:12px;box-shadow:var(--shadow)}
.card-head{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-bottom:10px}.card-head h1,.card-head h2{margin:0;font-size:16px;line-height:1.2}.pill{display:inline-flex;align-items:center;height:26px;border-radius:999px;background:#f2f3f5;color:#4b5563;padding:0 10px;font-size:12px;font-weight:800;white-space:nowrap}

.stat-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:10px;margin-bottom:12px}.stat-card{background:var(--surface);border:1px solid var(--line);border-radius:var(--radius);padding:12px;box-shadow:var(--shadow);min-height:80px}.stat-card span{display:block;color:var(--muted);font-size:12px;font-weight:750;margin-bottom:8px}.stat-card strong{display:block;font-size:23px;line-height:1;font-weight:850;letter-spacing:-.02em}.stat-card.primary{background:linear-gradient(135deg,#1877f2,#3b82f6);color:#fff;border-color:#1877f2}.stat-card.primary span{color:#dbeafe}

.btn{height:38px;border:0;border-radius:9px;padding:0 14px;display:inline-flex;align-items:center;justify-content:center;background:var(--fb-blue);color:#fff;font-weight:800;font-size:13px;cursor:pointer;white-space:nowrap;box-shadow:0 1px 2px rgba(0,0,0,.08)}.btn:hover{background:var(--fb-blue-dark)}.btn.secondary{background:#e7f3ff;color:#1877f2;box-shadow:none}.btn.secondary:hover{background:#dceeff}.btn.small{height:30px;padding:0 10px;font-size:12px}.btn.full{width:100%;margin-top:4px}

.auth-layout{min-height:calc(100vh - 92px);display:grid;grid-template-columns:1fr 430px;gap:18px;align-items:center}.auth-layout.single{grid-template-columns:minmax(0,700px);justify-content:center}.auth-hero{padding:22px}.auth-hero h1{font-size:34px;line-height:1.05;margin:0 0 12px;letter-spacing:-.04em}.auth-hero p{color:var(--muted);font-size:15px;line-height:1.45;max-width:520px}.auth-card{padding:18px}.auth-card.wide{max-width:700px;width:100%}.form-compact{margin-top:12px}.form-row{margin-bottom:10px}label{display:block;font-size:12px;font-weight:800;color:#3a3b3c;margin-bottom:5px}input,textarea,select{width:100%;height:38px;border:1px solid #ccd0d5;border-radius:8px;background:#fff;padding:7px 9px;color:#111827;outline:none}textarea{height:78px;resize:vertical}input:focus,textarea:focus,select:focus{border-color:#1877f2;box-shadow:0 0 0 3px rgba(24,119,242,.12)}.two{display:grid;grid-template-columns:1fr 1fr;gap:10px}.balance-strip{background:#eef3ff;border:1px solid #d7e5ff;border-radius:12px;padding:10px 12px;margin-bottom:12px;display:flex;align-items:center;justify-content:space-between}.balance-strip span{font-size:12px;color:#315083;font-weight:800}.balance-strip strong{font-size:22px;color:#1877f2}.resend-form{margin-top:10px}.otp-input{text-align:center;font-size:22px;font-weight:850;letter-spacing:.35em}

.table-wrap{overflow:auto;-webkit-overflow-scrolling:touch}.excel-wrap{border:1px solid #bfc5ce;border-radius:10px;max-height:68vh;background:#fff}.excel-grid{border-collapse:separate;border-spacing:0;width:100%;min-width:760px;background:#fff;font-size:12.5px}.excel-grid th,.excel-grid td{border-right:1px solid #d8dde6;border-bottom:1px solid #d8dde6;padding:7px 8px;text-align:left;white-space:nowrap;vertical-align:middle}.excel-grid th{position:sticky;top:0;z-index:2;background:#f5f6f7;color:#3a3b3c;font-weight:900;box-shadow:inset 0 -1px #bfc5ce}.excel-grid th:first-child,.excel-grid td:first-child{position:sticky;left:0;z-index:1;background:#fff}.excel-grid th:first-child{z-index:3;background:#f5f6f7}.excel-grid tbody tr:nth-child(even) td{background:#fbfcfd}.excel-grid tbody tr:hover td{background:#eef3ff}.excel-grid .empty-cell{text-align:center;color:var(--muted);padding:18px}.wrap-text{white-space:normal;min-width:250px;line-height:1.35}
.badge{display:inline-flex;align-items:center;height:24px;border-radius:999px;padding:0 8px;font-size:11px;font-weight:900}.badge.ok{background:#e7f7e7;color:#137333}.badge.pending{background:#fff4d6;color:#8a5a00}.badge.bad{background:#fde8e8;color:#b42318}.inline-edit-form{display:grid;grid-template-columns:118px minmax(150px,1fr) auto;gap:6px;align-items:center;min-width:360px}.action-grid{min-width:980px}

.scan-card{max-width:460px;margin:34px auto;text-align:center;padding:22px}.scan-icon{width:58px;height:58px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;font-size:26px;font-weight:900;margin-bottom:10px}.scan-icon.success{background:#e7f7e7;color:#137333}.scan-icon.warning{background:#fff4d6;color:#8a5a00}.scan-icon.danger{background:#fde8e8;color:#b42318}.reward-value{font-size:54px;line-height:1;margin:2px 0 8px;color:#00a400;letter-spacing:-.04em}.scan-note{margin:8px 0 15px;color:#3a3b3c}.action-row{display:flex;gap:8px;justify-content:center;flex-wrap:wrap}.mini-info{display:flex;gap:6px;justify-content:center;flex-direction:column;background:#f7f8fa;border:1px solid var(--line);border-radius:10px;padding:10px;margin-top:10px}.mini-info span{color:var(--muted)}

@media(max-width:860px){
  .fb-topbar{height:auto;min-height:56px;flex-wrap:wrap;padding:7px 10px}.hamburger{display:flex}.fb-brand{min-width:110px}.logo-img{max-width:145px}.fb-nav{display:none;width:100%;margin-left:0;gap:6px;overflow-x:auto;padding:4px 0 2px}.nav-toggle:checked~.fb-nav{display:flex}.fb-nav a,.user-chip{height:34px;padding:0 11px;background:#f2f3f5}.page-shell{padding:10px 8px 24px}.page-head{align-items:flex-start;flex-direction:column}.stat-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}.stat-card{padding:10px;min-height:72px}.stat-card strong{font-size:20px}.auth-layout,.auth-layout.single{display:block;min-height:0}.auth-hero{padding:14px 4px}.auth-hero h1{font-size:25px}.auth-card{padding:14px}.two{grid-template-columns:1fr;gap:0}.card{border-radius:11px;padding:10px;margin-bottom:10px}.title{font-size:20px}.excel-wrap{max-height:64vh;border-radius:8px}.excel-grid{min-width:720px;font-size:12px}.excel-grid th,.excel-grid td{padding:6px 7px}.inline-edit-form{grid-template-columns:1fr;min-width:230px}.btn.full{height:40px}.scan-card{margin:18px auto;padding:18px}.reward-value{font-size:48px}}
@media(max-width:430px){.stat-grid{grid-template-columns:1fr 1fr}.stat-card span{font-size:11px}.stat-card strong{font-size:18px}.card-head{align-items:flex-start}.pill{height:24px}.fb-nav{display:none}.nav-toggle:checked~.fb-nav{display:grid;grid-template-columns:1fr 1fr}.fb-nav a,.user-chip{width:100%;border-radius:8px}.excel-wrap{margin-left:-2px;margin-right:-2px}.auth-hero{display:none}}

.captcha-box{margin:10px 0 12px;padding:10px;border:1px solid var(--line);border-radius:10px;background:#f7f8fa;text-align:left}
.captcha-row{display:flex;align-items:center;gap:8px;margin-bottom:8px}
.captcha-img{width:170px;height:54px;border:1px solid #ccd0d5;border-radius:9px;background:#fff;object-fit:cover}
.captcha-refresh{width:42px;height:42px;border:0;border-radius:999px;background:#e7f3ff;color:#1877f2;font-size:21px;font-weight:900;cursor:pointer;line-height:1}
.captcha-refresh:hover{background:#dceeff}
.captcha-input{text-transform:uppercase;letter-spacing:.08em;font-weight:800}
.captcha-help{margin:6px 0 0;color:var(--muted);font-size:12px}
.claim-captcha-form{max-width:310px;margin:12px auto 0}
.claim-captcha-form .captcha-row{justify-content:center}
@media(max-width:430px){.captcha-row{align-items:flex-start}.captcha-img{width:150px;height:50px}.captcha-refresh{width:40px;height:40px}}
