/* =========================================================
   S Task — Super Admin console + Organization Settings
   ========================================================= */
/* storage meter */
.sb-meter{min-width:170px}
.sb-track{height:6px;border-radius:6px;background:#e9edf0;overflow:hidden}
.sb-fill{height:100%;background:var(--green);border-radius:6px;transition:width .3s}
.sb-fill.warn{background:#fcae51}
.sb-fill.full{background:var(--st-cancelled)}
.sb-txt{display:flex;align-items:center;gap:4px;margin-top:5px;font:400 12px var(--font);color:var(--muted);white-space:nowrap}
.sb-txt b{color:var(--text);font-weight:700}
.sb-txt span{margin-left:auto;font-weight:700;color:var(--muted)}
.sb-txt span.warn{color:#e08a1e}.sb-txt span.full{color:var(--red)}
.sb-meter.big .sb-track{height:10px}
.sb-meter.big .sb-txt{font-size:13px;margin-top:8px}

/* people + roles */
.ad-user{display:flex;align-items:center;gap:10px;text-align:left}
.ad-user .n{font:500 13px var(--font);color:var(--text)}
.ad-user .e{font:400 12px var(--font);color:var(--muted)}
.ad-role{display:inline-block;padding:2px 10px;border-radius:12px;font:600 11px var(--font)}
.ad-role.Manager{background:#e6f9f3;color:#00a374}
.ad-role.Employee{background:#eef3ff;color:#4a6fd8}
.mut{color:var(--muted);font-weight:400}
.ad-more{width:32px;height:32px;border-radius:50%;color:var(--muted);display:inline-flex;align-items:center;justify-content:center}
.ad-more:hover{background:#f0f0f0}
.ad-more .ic{width:22px;height:22px}
.pop .mi.ad-danger{color:var(--red)}
.pop .mi.ad-danger .ic{color:var(--red)}
.ad-btn-danger{background:var(--red)!important}
.ad-p{margin:0 0 14px;font:400 14px/21px var(--font);color:var(--text-2)}
.ad-hint{margin-top:6px;font:400 12px/17px var(--font);color:var(--muted)}
.ad-sec{margin:18px 0 12px;padding-top:14px;border-top:1px solid #eee;font:700 13px var(--font);color:var(--text-2)}
.ad-err{margin-bottom:14px;padding:9px 12px;border-radius:4px;background:#fff0f0;color:var(--red);font:400 13px var(--font)}
.ad-err-inline{min-height:16px;margin:6px 0;font:400 12px var(--font);color:var(--red)}
.ad-pw,.ad-space{display:flex;gap:8px}
.ad-pw input{flex:1;font-family:Consolas,monospace!important}
.ad-space input{flex:1}.ad-space select{width:90px}
.ad-cred{position:relative;padding:14px 16px;border:1px dashed #b9e9d9;border-radius:6px;background:#f3fcf8}
.ad-cred .h{font:700 13px var(--font);color:var(--text-2);margin-bottom:10px}
.ad-cred .r{display:flex;gap:10px;align-items:center;margin:6px 0;font:400 13px var(--font);color:var(--muted)}
.ad-cred .r span{width:70px}
.ad-cred code{font:500 13px Consolas,monospace;color:var(--text);background:#fff;border:1px solid #e4e4e4;border-radius:4px;padding:3px 8px}
.ad-cred .ad-copy{position:absolute;right:12px;top:10px;height:28px;padding:0 12px}
.ad-cred p{margin:10px 0 0;font:400 12px var(--font);color:var(--muted)}

/* ---------- admin console (full screen) ---------- */
.ad{position:absolute;inset:0;display:flex;flex-direction:column;background:#f6f8fa;font-family:var(--font)}
.ad-top{height:56px;flex:none;display:flex;align-items:center;gap:12px;padding:0 28px;background:#fff;box-shadow:#e7e9eb 0 1px 0 0}
.ad-logo{display:flex}
.ad-pill{padding:3px 10px;border-radius:12px;background:var(--side-bg);color:#fff;font:700 11px var(--font);letter-spacing:.3px}
.ad-me{margin-left:auto;display:flex;flex-direction:column;align-items:flex-end;font:400 12px var(--font);color:var(--muted)}
.ad-me b{font:700 13px var(--font);color:var(--text)}
.ad-body{flex:1;overflow:auto;padding:24px 28px 40px}
.ad-msg,.og-msg{padding:60px 0;text-align:center;font:400 14px var(--font);color:var(--muted)}
.ad-msg a{color:var(--green)}
.ad-cards,.og-cards{display:grid;grid-template-columns:repeat(4,1fr);gap:16px;margin-bottom:22px}
.ad-card,.og-card{background:#fff;border:1px solid #eaeaea;border-radius:8px;padding:16px 18px;box-shadow:0 1px 3px rgba(0,0,0,.04)}
.ad-card span{display:block;font:400 12px var(--font);color:var(--muted)}
.ad-card b{display:block;margin-top:6px;font:700 24px var(--font-2);color:var(--text)}
.ad-ptb{padding:0;height:auto;margin-bottom:14px}
.ad-ptb .btn,.og-ptb .btn{height:32px}
.ad-ptb .btn .ic,.og-ptb .btn .ic{width:16px;height:16px}
.ad-tablewrap,.og-tablewrap{background:#fff;border:1px solid #eaeaea;border-radius:8px;overflow:auto}
.ad-dt,.og-dt{width:100%}
.ad-dt thead th,.og-dt thead th{text-align:left!important;padding:0 14px!important;border-right:0}
.ad-dt td,.og-dt td{text-align:left;padding:10px 14px;height:56px;font:400 13px var(--font)}
.ad-org{display:flex;align-items:center;gap:10px}
.ad-org b{font:700 13px var(--font);color:var(--text)}
.ad-mgrs div{font:500 13px var(--font);color:var(--text)}
.ad-mgrs span{display:block;font:400 11px var(--font);color:var(--muted)}
.ad-st{width:230px}
.ad-status{padding:3px 10px;border-radius:12px;font:600 11px var(--font)}
.ad-status.active{background:#e6f9f3;color:#00a374}
.ad-status.suspended{background:#fff0f0;color:var(--red)}
.ad-people{max-height:260px;overflow:auto;border:1px solid #eee;border-radius:6px}
.ad-prow{display:flex;align-items:center;gap:12px;padding:10px 12px;border-bottom:1px solid #f2f2f2}
.ad-prow:last-child{border:0}
.ad-prow .ad-user{flex:1}
.ad-prow .btn{height:28px;padding:0 10px;font-size:12px}
.ad-row3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:8px}
.ad-row3 input{height:34px;border:1px solid var(--border);border-radius:4px;padding:0 10px;font:400 13px var(--font);outline:0}
.ad-row3 input:focus{border-color:var(--green)}

/* ---------- organization settings (in app) ---------- */
.og{position:absolute;inset:0;overflow:auto;padding:0 28px 40px}
.og-ptb{padding:0;height:58px}
.og-sub{margin-left:10px;padding:2px 10px;border-radius:12px;background:#f1f1f1;font:600 11px var(--font);color:var(--muted)}
.og-cards{grid-template-columns:2fr 1fr 1fr}
.og-card .h{font:700 13px var(--font);color:var(--text-2);margin-bottom:12px}
.og-card .big{display:block;font:700 26px var(--font-2);color:var(--text)}
.og-card p{margin:8px 0 0;font:400 12px/17px var(--font);color:var(--muted)}
.og-card p .full{color:var(--red)}
.og-ws{max-width:420px}
.og-chip{display:inline-block;margin:2px 4px 2px 0;padding:2px 8px;border-radius:10px;background:#f1f3f5;font:500 11px var(--font);color:var(--text-2)}
.og-checks{display:grid;grid-template-columns:1fr 1fr;gap:6px 14px;max-height:160px;overflow:auto;padding:10px 12px;border:1px solid var(--border);border-radius:4px}
.og-checks label{display:flex;align-items:center;gap:8px;margin:0;font:400 13px var(--font);color:var(--text);cursor:pointer}

/* ---------- role-based visibility ---------- */
#app.role-employee .mgr-only{display:none!important}
#app.role-employee .ws-create{display:none!important}
.storage-full-bar{position:fixed;left:50%;top:48px;transform:translateX(-50%);z-index:60;padding:8px 16px;border-radius:6px;background:#fff0f0;border:1px solid #ffc9c9;color:var(--red);font:500 13px var(--font);box-shadow:0 2px 8px rgba(0,0,0,.08)}
.storage-full-bar a{margin-left:10px;color:var(--red);text-decoration:underline;cursor:pointer}

/* =========================================================
   Phones (max 767px) - admin console + organization page. Desktop rules above are unchanged.
   ========================================================= */
@media (max-width: 767px){
  /* shared people chip / dialogs */
  .ad-user{min-width:0}
  .ad-user>div{min-width:0}
  .ad-user .av{flex:none}
  .ad-user .n,.ad-user .e{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ad-more{width:40px;height:40px}
  .ad-pw input,.ad-space input{min-width:0}
  .ad-pw .btn{flex:none}
  .ad-cred{padding:12px}
  .ad-cred .h{padding-right:72px}
  .ad-cred .r{align-items:flex-start}
  .ad-cred .r span{flex:none;width:66px;padding-top:3px}
  .ad-cred code{min-width:0;overflow-wrap:anywhere}
  .ad-cred .ad-copy{height:32px}
  .ad-people{max-height:42vh}
  .ad-prow{flex-wrap:wrap;gap:8px 10px}
  .ad-prow .ad-user{flex:1 1 100%}
  .ad-prow .btn{margin-left:auto;height:36px}
  .ad-row3{grid-template-columns:1fr}
  .ad-row3 input{height:42px}

  /* ---------- super-admin console ---------- */
  .ad-top{height:calc(52px + env(safe-area-inset-top,0px));padding:env(safe-area-inset-top,0px) 12px 0;gap:8px}
  .ad-pill{flex:none;white-space:nowrap}
  .ad-me{min-width:0}
  .ad-me b{max-width:120px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ad-me span{display:none}
  .ad-out{flex:none;height:36px;padding:0 12px}
  .ad-body{padding:14px 12px calc(32px + env(safe-area-inset-bottom,0px))}
  .ad-msg,.og-msg{padding:48px 16px}
  .ad-cards{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;margin-bottom:16px}
  .ad-card,.og-card{padding:12px 14px}
  .ad-card b{font-size:20px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ad .ad-ptb{padding:0;margin-bottom:12px}
  .ad-ptb .ptb-right,.og-ptb .ptb-right{overflow:visible;flex-wrap:wrap}
  .ad-ptb .btn,.og-ptb .btn{height:40px;flex:none}
  .ad-dt th:first-child,.ad-dt td:first-child,
  .og-dt th:first-child,.og-dt td:first-child{position:sticky;left:0;box-shadow:1px 0 0 #ececec}
  .ad-dt td:first-child,.og-dt td:first-child{z-index:1;background:#fff;max-width:190px}
  .ad-dt th:first-child,.og-dt th:first-child{z-index:3}
  .ad-org .av{flex:none}
  .ad-org b{max-width:118px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .ad-st{width:180px}
  .ad-st .sb-meter{min-width:150px}

  /* ---------- organization page ---------- */
  .og{padding:0 12px calc(32px + env(safe-area-inset-bottom,0px))}
  .og .og-ptb{padding:8px 0;height:auto}
  .og-ptb h1{min-width:0;max-width:calc(100% - 100px);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  .og-sub{flex:none}
  .og-cards{grid-template-columns:1fr;gap:10px;margin-bottom:16px}
  .og-card .big{font-size:22px}
  .og-ws{min-width:170px;white-space:normal}
  .og-checks{grid-template-columns:1fr;gap:0;max-height:240px;padding:4px 12px}
  .og-checks label{min-height:40px}
  .og-checks label input{width:20px;height:20px;flex:none;margin:0;padding:0}
}
