/* Admin dashboard — styles. Loaded by index.html. */
      :root { --bg:#0f1117; --panel:#181b24; --panel-2:#1f2330; --border:#2a2f3d; --text:#e6e8ee; --muted:#9aa0ad; --brand:#2b6ef0; --brand-2:#4f97ff; --ok:#2f9e44; --bad:#e03131; }
      * { box-sizing: border-box; }
      body { margin:0; font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,sans-serif; background:var(--bg); color:var(--text); }
      button { cursor:pointer; border:none; border-radius:8px; padding:9px 15px; font-weight:600; font-size:14px; }
      .btn-primary { background:linear-gradient(135deg,var(--brand),var(--brand-2)); color:#fff; }
      .btn-ghost { background:var(--panel-2); color:var(--text); border:1px solid var(--border); }
      .btn-danger { background:transparent; color:var(--bad); border:1px solid var(--bad); padding:6px 10px; font-size:13px; }
      .btn-sm { padding:6px 11px; font-size:13px; }
      input, textarea, select { width:100%; padding:10px 12px; border-radius:8px; border:1px solid var(--border); background:var(--panel-2); color:var(--text); font-size:14px; margin-top:6px; font-family:inherit; }
      textarea { min-height:70px; resize:vertical; }
      label { font-size:13px; color:var(--muted); display:block; margin-top:14px; }
      .row-checkbox { display:flex; align-items:center; gap:10px; margin-top:14px; } .row-checkbox input { width:auto; margin:0; }
      .inline { display:flex; gap:12px; flex-wrap:wrap; align-items:flex-end; }
      .inline > div { flex:1; min-width:120px; }

      #login { min-height:100vh; display:flex; align-items:center; justify-content:center; padding:20px; }
      .card { background:var(--panel); border:1px solid var(--border); border-radius:16px; padding:32px; width:100%; max-width:380px; }
      .logo { font-size:22px; font-weight:800; } .logo span { color:var(--brand-2); }
      .brandlogo { display:block; width:210px; max-width:78%; margin:0 auto 8px; background:#fff; border-radius:18px; padding:16px 14px; }
      .hint { margin-top:18px; font-size:12px; color:var(--muted); background:var(--panel-2); border:1px dashed var(--border); border-radius:8px; padding:10px 12px; line-height:1.6; }
      .hint code { color:var(--brand-2); cursor:pointer; }
      .error { color:var(--bad); font-size:13px; margin-top:12px; min-height:16px; }

      #app { display:none; min-height:100vh; grid-template-columns:240px 1fr; }
      .sidebar { background:var(--panel); border-right:1px solid var(--border); padding:22px 16px; }
      .store-name { font-weight:700; font-size:16px; }
      .store-role { font-size:12px; color:var(--muted); margin-top:2px; }
      .nav { margin-top:24px; display:flex; flex-direction:column; gap:4px; }
      .nav button { text-align:left; background:transparent; color:var(--muted); padding:10px 12px; border-radius:8px; width:100%; font-weight:500; }
      .nav button:hover { background:var(--panel-2); color:var(--text); }
      .nav button.active { background:var(--panel-2); color:#fff; }
      .main { padding:28px 32px; overflow:auto; }
      .topbar { display:flex; justify-content:space-between; align-items:flex-start; margin-bottom:24px; gap:16px; }
      h1 { font-size:22px; margin:0; }
      .modules { display:flex; gap:8px; flex-wrap:wrap; margin-top:8px; }
      .pill { font-size:11px; background:var(--panel-2); border:1px solid var(--border); padding:4px 10px; border-radius:20px; color:var(--muted); }
      .pill.on { color:var(--brand-2); border-color:var(--brand); }
      table { width:100%; border-collapse:collapse; margin-top:8px; }
      th, td { text-align:left; padding:11px 12px; border-bottom:1px solid var(--border); font-size:14px; vertical-align:middle; }
      th { color:var(--muted); font-weight:600; font-size:12px; text-transform:uppercase; letter-spacing:.04em; }
      .empty { color:var(--muted); padding:30px 0; text-align:center; }
      .panel-box { background:var(--panel); border:1px solid var(--border); border-radius:12px; padding:22px; }
      .searchbox { width:100%; max-width:420px; padding:10px 13px; margin:0 0 14px; border-radius:10px; border:1px solid var(--border); background:var(--panel-2); color:var(--text); font-size:14px; }
      .tablewrap { overflow-x:auto; -webkit-overflow-scrolling:touch; }
      .hamburger { display:none; background:var(--panel-2); border:1px solid var(--border); color:var(--text); width:42px; height:42px; border-radius:10px; font-size:20px; cursor:pointer; flex:0 0 auto; }
      .navbackdrop { display:none; position:fixed; inset:0; background:rgba(0,0,0,.5); z-index:55; }
      .navbackdrop.show { display:block; }
      @media (max-width:820px) {
        #app { grid-template-columns:1fr; }
        .sidebar { position:fixed; top:0; left:0; height:100%; width:250px; transform:translateX(-100%); transition:transform .25s ease; z-index:60; overflow-y:auto; }
        .sidebar.open { transform:none; box-shadow:0 0 40px rgba(0,0,0,.55); }
        .main { padding:16px 14px; }
        .hamburger { display:block; }
        .topbar { flex-wrap:wrap; align-items:center; gap:12px; }
        .topbar h1 { font-size:20px; margin:0; }
        .modules { display:none; } /* hide module pills on mobile — they crowd the topbar */
        .panel-box { padding:14px; }
        .modal { padding:18px; max-width:100%; }
        th, td { padding:9px 8px; font-size:13px; }
        .searchbox { max-width:100%; }
        .subnav { overflow-x:auto; flex-wrap:nowrap; }
        .msgwrap { height:80vh; }
        .msgcol { width:120px; }
      }
      .grid { display:grid; grid-template-columns:repeat(auto-fill,minmax(180px,1fr)); gap:14px; }
      .stat { background:var(--panel-2); border:1px solid var(--border); border-radius:10px; padding:16px; }
      .stat .k { font-size:12px; color:var(--muted); } .stat .v { font-size:20px; font-weight:700; margin-top:4px; }
      .toast { position:fixed; bottom:24px; right:24px; background:var(--ok); color:#fff; padding:12px 18px; border-radius:10px; font-weight:600; opacity:0; transition:opacity .2s; z-index:100; }
      .toast.bad { background:var(--bad); } .toast.show { opacity:1; }
      .modal-bg { position:fixed; inset:0; background:rgba(0,0,0,.6); display:none; align-items:center; justify-content:center; padding:20px; z-index:50; }
      .modal-bg.show { display:flex; }
      .modal { background:var(--panel); border:1px solid var(--border); border-radius:14px; padding:26px; width:100%; max-width:460px; max-height:90vh; overflow:auto; }
      .modal h3 { margin:0 0 4px; }
      .modal-actions { display:flex; justify-content:flex-end; gap:10px; margin-top:22px; }
      .module-toggle { display:flex; align-items:center; justify-content:space-between; padding:11px 14px; border:1px solid var(--border); border-radius:10px; margin-top:10px; }
      .switch { position:relative; width:44px; height:24px; flex:none; }
      .switch input { opacity:0; width:0; height:0; }
      .slider { position:absolute; inset:0; background:var(--panel-2); border:1px solid var(--border); border-radius:24px; transition:.2s; }
      .slider:before { content:""; position:absolute; height:18px; width:18px; left:3px; top:2px; background:var(--muted); border-radius:50%; transition:.2s; }
      .switch input:checked + .slider { background:var(--brand); border-color:var(--brand); }
      .switch input:checked + .slider:before { transform:translateX(20px); background:#fff; }
      .section-label { font-size:12px; text-transform:uppercase; letter-spacing:.05em; color:var(--muted); margin:20px 0 4px; }
      .uploader { display:flex; align-items:center; gap:12px; margin-top:6px; }
      .uploadbtn { display:inline-block; background:var(--panel-2); border:1px solid var(--border); border-radius:8px; padding:9px 14px; font-size:14px; font-weight:600; cursor:pointer; margin:0; color:var(--text); }
      table.vmatrix { border-collapse:collapse; }
      table.vmatrix th, table.vmatrix td { border:1px solid var(--border); padding:5px 6px; text-align:center; }
      table.vmatrix th { background:var(--panel-2); font-size:12px; }
      table.vmatrix input { margin:0; padding:5px 6px; }
      .uploadbtn:hover { border-color:var(--brand); }
      .upname { color:var(--muted); font-size:13px; }
      .uppreview { max-width:140px; max-height:140px; margin-top:12px; border-radius:8px; border:1px solid var(--border); display:block; }
      .threads { display:grid; grid-template-columns:repeat(auto-fill,minmax(300px,1fr)); gap:14px; }
      .thread { background:var(--panel); border:1px solid var(--border); border-radius:12px; overflow:hidden; }
      .thead { display:flex; align-items:center; gap:10px; padding:12px 14px; border-bottom:1px solid var(--border); }
      .tav { width:34px; height:34px; border-radius:50%; background:linear-gradient(135deg,var(--brand),var(--brand-2)); display:flex; align-items:center; justify-content:center; font-weight:700; }
      .tbody { padding:12px 14px; display:flex; flex-direction:column; gap:8px; max-height:320px; overflow-y:auto; }
      .cmsg { display:flex; flex-direction:column; align-items:flex-start; }
      .cmsg.me { align-items:flex-end; }
      .cbub { background:var(--panel-2); border:1px solid var(--border); border-radius:12px; border-bottom-left-radius:4px; padding:8px 12px; font-size:14px; display:inline-block; max-width:90%; }
      .cbub.mebub { background:var(--me,#3797f0); border-color:transparent; color:#fff; border-bottom-left-radius:12px; border-bottom-right-radius:4px; }
      .ctime { font-size:10px; color:var(--muted); margin-top:2px; }
      .reply { display:flex; gap:8px; padding:10px 12px; border-top:1px solid var(--border); }
      .reply input { flex:1; background:var(--panel-2); border:1px solid var(--border); color:var(--text); border-radius:8px; padding:9px 11px; font-size:14px; }
      /* messaging inbox: list + chat */
      .msgwrap { display:flex; height:74vh; border:1px solid var(--border); border-radius:12px; overflow:hidden; background:var(--panel); }
      .msgcol { width:300px; border-right:1px solid var(--border); display:flex; flex-direction:column; min-width:0; }
      .msgsearch { padding:10px; border-bottom:1px solid var(--border); }
      .msgsearch input { width:100%; background:var(--panel-2); border:1px solid var(--border); color:var(--text); border-radius:8px; padding:8px 10px; font-size:13px; }
      .msglist { flex:1; overflow-y:auto; }
      .msgitem { display:flex; gap:10px; align-items:center; padding:11px 12px; border-bottom:1px solid var(--border); cursor:pointer; }
      .msgitem:hover { background:var(--panel-2); }
      .msgitem.active { background:var(--panel-2); border-left:3px solid var(--brand); }
      .preview { color:var(--muted); font-size:12px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; margin-top:2px; }
      .msgchat { flex:1; display:flex; flex-direction:column; min-width:0; }
      .chathead { display:flex; align-items:center; gap:10px; padding:12px 14px; border-bottom:1px solid var(--border); }
      .msgchat .tbody { max-height:none; flex:1; }
      .chart { display:flex; align-items:flex-end; gap:10px; height:120px; padding-top:8px; }
      .bar { flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:4px; }
      .barfill { width:70%; background:linear-gradient(180deg,var(--brand-2),var(--brand)); border-radius:5px 5px 0 0; min-height:4px; }
      .barlbl { font-size:11px; color:var(--muted); }
      .subnav { display:flex; gap:6px; margin-bottom:18px; flex-wrap:wrap; }
      .subnav button { background:var(--panel-2); color:var(--muted); border:1px solid var(--border); }
      .subnav button.active { background:var(--brand); color:#fff; border-color:var(--brand); }
      .slots { display:grid; grid-template-columns:repeat(auto-fill,minmax(92px,1fr)); gap:10px; margin-top:16px; }
      .slot { padding:12px 8px; border-radius:10px; text-align:center; font-weight:600; font-size:14px; border:1px solid var(--border); }
      .slot.free { background:rgba(47,158,68,.12); border-color:var(--ok); color:#8ce99a; cursor:pointer; }
      .slot.free:hover { background:rgba(47,158,68,.25); }
      .slot.busy { background:var(--panel-2); color:var(--muted); cursor:not-allowed; }
      .slot .r { display:block; font-size:10px; font-weight:500; margin-top:3px; text-transform:uppercase; letter-spacing:.04em; }
    
