/* ==========================================================================
   ZerσSigma Admin surface

   Admin layout/chrome is isolated here. Health, warning, error, and freshness
   colors retain their semantic identities.
   ========================================================================== */

/* ---- Admin page ---- */
#app-shell .zs-admin{
  padding:20px 22px;
  max-width:1200px;
  margin:0 auto;
}
#app-shell .zs-admin-title{
  font-size:1.6rem; font-weight:800; letter-spacing:-.03em;
  color:var(--zs-text-primary);
  margin:0 0 18px 0;
}
#app-shell .zs-admin-title span{
  background:linear-gradient(90deg,var(--zs-brand-accent-hover),var(--zs-brand-accent-active));
  -webkit-background-clip:text;
  -webkit-text-fill-color:transparent;
}

#app-shell .zs-admin-card{
  background:var(--zs-gradient-panel);
  border:1px solid var(--zs-border-default);
  border-radius:var(--zs-radius-lg);
  padding:18px 20px;
  margin:0 0 14px 0;
  box-shadow:var(--zs-shadow-1);
}
#app-shell .zs-admin-card-title{
  font-size:.92rem; font-weight:800; letter-spacing:.2px;
  color:var(--zs-text-primary);
  margin:0 0 12px 0;
}
#app-shell .zs-admin-card-subtitle{
  font-size:.82rem; font-weight:700;
  color:var(--zs-text-muted);
  margin:14px 0 8px 0;
}

/* Status pills */
#app-shell .zs-admin-pills{ display:flex; flex-wrap:wrap; gap:6px; margin-bottom:8px; }
#app-shell .zs-admin-pill{
  display:inline-block;
  padding:4px 12px;
  border-radius:20px;
  font-size:11px; font-weight:700;
  letter-spacing:.3px;
  border:1px solid transparent;
}
#app-shell .zs-admin-pill--ok{   background:rgba(25,245,178,.14); color:var(--zs-sem-success); border-color:rgba(25,245,178,.25); }
#app-shell .zs-admin-pill--down{ background:rgba(255,60,60,.14); color:var(--zs-sem-error); border-color:rgba(255,60,60,.25); }
#app-shell .zs-admin-pill--warn{ background:rgba(200,161,75,.14); color:var(--zs-sem-warning); border-color:rgba(200,161,75,.25); }
#app-shell .zs-admin-pill--unknown{ background:rgba(142,155,173,.10); color:var(--zs-sem-unknown); border-color:rgba(142,155,173,.18); }

/* Notes / warnings */
#app-shell .zs-admin-note{
  font-size:11px; padding:6px 10px; border-radius:8px;
  margin:6px 0; line-height:1.45;
}
#app-shell .zs-admin-note--warn{  background:rgba(200,161,75,.10); color:var(--zs-sem-warning); border:1px solid rgba(200,161,75,.20); }
#app-shell .zs-admin-note--error{ background:rgba(255,60,60,.08); color:var(--zs-sem-error); border:1px solid rgba(255,60,60,.18); }
#app-shell .zs-admin-note--ok{ background:rgba(25,245,178,.08); color:var(--zs-sem-success); border:1px solid rgba(25,245,178,.20); }
#app-shell .zs-admin-note--info{ background:rgba(45,108,255,.08); color:var(--zs-sem-info); border:1px solid rgba(45,108,255,.18); }

/* Buttons: pill-shaped, consistent */
#app-shell .zs-admin-btn{
  display:inline-flex; align-items:center; justify-content:center;
  height:34px; padding:0 18px;
  border:none; border-radius:14px;
  font-size:.78rem; font-weight:700; letter-spacing:.2px;
  cursor:pointer; transition:filter .12s,box-shadow .12s;
  white-space:nowrap;
}
#app-shell .zs-admin-btn:active{ filter:brightness(.88); transform:translateY(1px); }
#app-shell .zs-admin-btn:focus-visible{ outline:none; box-shadow:0 0 0 2px var(--zs-focus-ring); }
#app-shell .zs-admin-btn--accent{
  background:linear-gradient(180deg,var(--zs-brand-accent-hover),var(--zs-brand-accent));
  color:var(--zs-canvas);
  box-shadow:var(--zs-glow-subtle);
}
#app-shell .zs-admin-btn--blue{
  background:linear-gradient(180deg,var(--zs-brand-accent),var(--zs-brand-accent-active));
  color:var(--zs-canvas);
  box-shadow:var(--zs-glow-subtle);
}
#app-shell .zs-admin-btn--danger{
  background:linear-gradient(180deg,#c62828 0%,#8e1e1e 100%);
  color:#fff;
  box-shadow:0 6px 20px rgba(198,40,40,.18);
}
#app-shell .zs-admin-btn--danger:focus-visible{ box-shadow:0 0 0 2px rgba(255,60,60,.35); }

/* Checklists inside admin */
#app-shell .zs-admin-checklist label{
  display:inline-flex; align-items:center; gap:8px;
  color:var(--zs-text-secondary); font-size:12px; font-weight:600;
  margin-right:16px;
}
#app-shell .zs-admin-checklist input{ accent-color:var(--zs-brand-accent); transform:scale(1.1); }

/* Dropdown controls */
#app-shell .zs-admin-controls{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  margin-bottom:10px;
}
#app-shell .zs-admin-dd{ min-width:140px; }
#app-shell .zs-admin-dd .Select-control,
#app-shell .zs-admin-dd .Select-menu-outer{
  background:var(--zs-surface-overlay) !important;
  color:var(--zs-text-primary) !important;
  border:1px solid var(--zs-border-default) !important;
  border-radius:var(--zs-radius-sm) !important;
  min-height:34px !important;
}
#app-shell .zs-admin-dd .Select-placeholder,
#app-shell .zs-admin-dd .Select-value-label{
  color:var(--zs-text-primary) !important;
  font-size:12px !important; font-weight:600 !important;
}
#app-shell .zs-admin-dd .Select-input > input{ color:var(--zs-text-primary) !important; }

#app-shell .zs-admin-input{
  background:var(--zs-control-bg) !important;
  color:var(--zs-text-primary) !important;
  border:1px solid var(--zs-border-default) !important;
  border-radius:var(--zs-radius-sm) !important;
  height:34px !important; width:90px !important;
  padding:0 10px !important; font-size:12px !important; font-weight:600 !important;
}
#app-shell .zs-admin-input:focus{ border-color:var(--zs-border-strong) !important; outline:none !important; box-shadow:0 0 0 2px var(--zs-brand-accent-wash) !important; }

/* Code / JSON / result surfaces */
#app-shell .zs-admin-pre{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:11px; line-height:1.5;
  color:var(--zs-text-muted);
  background:var(--zs-canvas-elevated);
  border:1px solid var(--zs-border-default);
  border-radius:12px;
  padding:12px 14px;
  max-height:260px;
  overflow:auto;
  margin:8px 0 0 0;
}
#app-shell .zs-admin-result{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:11px; line-height:1.5;
  color:var(--zs-text-primary);
  background:var(--zs-surface-translucent);
  border:1px solid var(--zs-border-default);
  border-radius:12px;
  padding:12px 14px;
  margin:14px 0 0 0;
  white-space:pre-wrap;
  min-height:24px;
}
#app-shell .zs-admin-logs{
  font-family:ui-monospace,SFMono-Regular,Menlo,monospace;
  font-size:11px; line-height:1.5;
  color:var(--zs-sem-success);
  background:var(--zs-canvas-elevated);
  border:1px solid var(--zs-border-default);
  border-radius:12px;
  padding:12px 14px;
  max-height:420px;
  overflow:auto;
  margin:8px 0 0 0;
  white-space:pre-wrap;
}
#app-shell .zs-admin-hr{
  border:none;
  border-top:1px solid var(--zs-divider);
  margin:16px 0;
}
#app-shell .zs-admin-muted{
  font-size:11px; color:var(--zs-text-muted); margin:0;
}

/* ---- Admin sub-tabs ---- */
#app-shell .zs-admin-sub-tabs{
  border-bottom:1px solid var(--zs-divider) !important;
  margin-bottom:0 !important;
}
#app-shell .zs-admin-sub-tabs .tab-container{
  display:flex !important; gap:0 !important;
}
#app-shell .zs-admin-sub-tab{
  background:transparent !important;
  border:none !important;
  border-bottom:2px solid transparent !important;
  color:var(--zs-text-muted) !important;
  font-size:13px !important; font-weight:700 !important;
  padding:10px 18px !important;
  cursor:pointer !important;
  transition:color .15s, border-color .15s !important;
}
#app-shell .zs-admin-sub-tab:hover{
  color:var(--zs-text-primary) !important;
}
#app-shell .zs-admin-sub-tab--active{
  color:var(--zs-brand-accent-hover) !important;
  border-bottom:2px solid var(--zs-brand-accent) !important;
  background:transparent !important;
}

/* ---- Admin KPI cards ---- */
#app-shell .zs-admin-kpi-row{ display:flex; gap:12px; flex-wrap:wrap; }
#app-shell .zs-admin-kpi{
  flex:1; min-width:110px;
  padding:14px 16px;
  background:var(--zs-gradient-panel);
  border:1px solid var(--zs-border-default);
  border-radius:12px;
  text-align:center;
}
#app-shell .zs-admin-kpi-value{ font-size:1.5rem; font-weight:800; color:var(--zs-text-primary); }
#app-shell .zs-admin-kpi-label{ font-size:.7rem; color:var(--zs-text-muted); margin-top:4px; letter-spacing:.3px; }
#app-shell .zs-admin-kpi--ok .zs-admin-kpi-value{ color:var(--zs-sem-success); }
#app-shell .zs-admin-kpi--warn .zs-admin-kpi-value{ color:var(--zs-sem-warning); }
#app-shell .zs-admin-kpi--danger .zs-admin-kpi-value{ color:var(--zs-sem-error); }

/* ---- Admin tables ---- */
#app-shell .zs-admin-table{
  width:100%;
  border-collapse:collapse;
  font-size:13px;
}
#app-shell .zs-admin-table th{
  text-align:left;
  font-size:12px; font-weight:700;
  color:var(--zs-text-muted);
  padding:8px 10px;
  border-bottom:1px solid var(--zs-divider);
}
#app-shell .zs-admin-table td{
  padding:7px 10px;
  border-bottom:1px solid var(--zs-divider);
  color:var(--zs-text-primary);
}
#app-shell .zs-admin-table tr:hover td{
  background:var(--zs-brand-accent-wash);
}

/* ---- Chips (inline status indicators) ---- */
#app-shell .zs-chip{
  display:inline-block;
  padding:3px 9px;
  border-radius:10px;
  font-size:11px; font-weight:700;
  letter-spacing:.3px;
  white-space:nowrap;
  vertical-align:middle;
  line-height:1.5;
}
#app-shell .zs-chip--green{  background:rgba(25,245,178,.14); color:var(--zs-sem-success); }
#app-shell .zs-chip--blue{   background:rgba(45,108,255,.14); color:var(--zs-sem-info); }
#app-shell .zs-chip--red{    background:rgba(255,60,60,.14); color:var(--zs-sem-error); }
#app-shell .zs-chip--purple{ background:rgba(180,80,255,.14); color:#c68dff; }
#app-shell .zs-chip--neutral{ background:rgba(142,155,173,.10); color:var(--zs-text-muted); }

/* ---- Users toolbar ---- */
#app-shell .zs-users-toolbar{
  display:flex; align-items:center; gap:10px; flex-wrap:wrap;
  padding:10px 0 12px 0;
}
#app-shell .zs-users-search-group{
  display:flex; align-items:center; gap:6px;
}
#app-shell .zs-users-search-input{
  padding:6px 12px;
  font-size:13px;
  background:var(--zs-control-bg);
  color:var(--zs-text-primary);
  border:1px solid var(--zs-border-default);
  border-radius:6px;
  min-width:220px;
}
#app-shell .zs-users-search-input:focus{
  border-color:var(--zs-border-strong);
  outline:none;
  box-shadow:0 0 0 2px var(--zs-brand-accent-wash);
}
#app-shell .zs-users-filter-group{
  display:flex; align-items:center; gap:6px;
}
#app-shell .zs-users-toolbar-right{
  margin-left:auto;
  display:flex; align-items:center; gap:10px;
}

/* ---- Users table (legible, still dense) ---- */
#app-shell .zs-users-table-wrap{
  max-height:62vh;
  overflow-y:auto;
  border:1px solid var(--zs-border-default);
  border-radius:10px;
  background:var(--zs-surface-translucent);
}
#app-shell .zs-users-table{
  font-size:14px !important;
}
#app-shell .zs-users-table th{
  position:sticky; top:0;
  background:var(--zs-surface-2);
  z-index:2;
  padding:11px 14px !important;
  font-size:12px !important;
  font-weight:800 !important;
  text-transform:uppercase;
  letter-spacing:.6px;
  color:var(--zs-text-secondary) !important;
  border-bottom:1px solid var(--zs-divider) !important;
}
#app-shell .zs-users-table td{
  padding:11px 14px !important;
  border-bottom:1px solid var(--zs-divider) !important;
  color:var(--zs-text-primary) !important;
}
#app-shell .zs-users-row{
  cursor:pointer;
  transition:background .1s;
}
#app-shell .zs-users-row:hover td{
  background:var(--zs-brand-accent-wash) !important;
}
#app-shell .zs-users-row:active td{
  background:var(--zs-brand-accent-wash-strong) !important;
}
#app-shell .zs-users-td-name{
  font-weight:700;
  max-width:220px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
#app-shell .zs-users-td-email{
  max-width:300px;
  overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
  color:var(--zs-text-secondary) !important;
}
#app-shell .zs-users-td-mono{
  font-family:'Fira Mono','Courier New',monospace;
  font-size:13px !important;
  color:var(--zs-text-muted) !important;
  letter-spacing:.2px;
}
#app-shell .zs-users-td-created{
  color:var(--zs-text-muted) !important;
}
/* Recency tone hints on Last Login / Last Seen columns */
#app-shell .zs-users-td-ago{ font-weight:600; }
#app-shell .zs-users-td-ago--recent{ color:var(--zs-sem-success) !important; }
#app-shell .zs-users-td-ago--stale{ color:var(--zs-sem-stale) !important; }
#app-shell .zs-users-td-ago--never{ color:var(--zs-sem-error) !important; font-weight:700; }

/* Count pill near the Refresh button */
#app-shell .zs-admin-count-pill{
  display:inline-flex; align-items:center;
  height:24px; padding:0 12px;
  border-radius:999px;
  background:var(--zs-brand-accent-wash);
  border:1px solid var(--zs-border-default);
  color:var(--zs-brand-accent-hover);
  font-size:11.5px; font-weight:700;
  letter-spacing:.3px;
  white-space:nowrap;
}
#app-shell .zs-admin-count-pill:empty{ display:none; }

/* ---- Skeleton loader ---- */
#app-shell .zs-skel-wrap{ padding:4px 0; }
#app-shell .zs-skel-row{
  display:flex; gap:8px;
  padding:9px 10px;
  border-bottom:1px solid var(--zs-divider);
}
#app-shell .zs-skel-cell{
  height:16px;
  border-radius:4px;
  background:linear-gradient(90deg,rgba(142,155,173,.06) 25%,rgba(142,155,173,.14) 50%,rgba(142,155,173,.06) 75%);
  background-size:200% 100%;
  animation:zs-skel-pulse 1.4s ease-in-out infinite;
}
@keyframes zs-skel-pulse{
  0%{ background-position:200% 0; }
  100%{ background-position:-200% 0; }
}

/* ---- Detail panel ---- */
#app-shell .zs-detail-panel{
  margin-top:14px;
  border:1px solid var(--zs-border-default);
  border-radius:12px;
  background:var(--zs-gradient-panel);
  padding:14px 18px;
}
#app-shell .zs-detail-header{
  display:flex; justify-content:space-between; align-items:center;
  padding-bottom:10px;
  border-bottom:1px solid var(--zs-divider);
  margin-bottom:12px;
}
#app-shell .zs-detail-header-info{
  display:flex; align-items:center; flex-wrap:wrap; gap:4px;
}
#app-shell .zs-detail-section-title{
  font-size:12px; font-weight:800;
  color:var(--zs-text-muted);
  text-transform:uppercase;
  letter-spacing:.5px;
  margin-bottom:8px;
}
#app-shell .zs-detail-body{
  display:flex; gap:20px; flex-wrap:wrap;
}
#app-shell .zs-detail-col{ min-width:0; }
#app-shell .zs-detail-col--edit{ flex:1.2; min-width:260px; }
#app-shell .zs-detail-col--info{ flex:1; min-width:240px; }
#app-shell .zs-detail-edit-grid{
  display:grid; grid-template-columns:1fr 1fr; gap:8px;
}
#app-shell .zs-detail-edit-label{
  font-size:10px; font-weight:700;
  color:var(--zs-text-muted);
  text-transform:uppercase;
  letter-spacing:.3px;
  margin-bottom:2px; display:block;
}
#app-shell .zs-detail-save-row{
  display:flex; align-items:center; margin-top:10px;
}
#app-shell .zs-detail-info-table td{
  padding:3px 8px 3px 0 !important;
}
#app-shell .zs-detail-info-label{
  font-weight:700 !important;
  font-size:11px !important;
  color:var(--zs-text-muted) !important;
  text-transform:uppercase;
  letter-spacing:.3px;
  white-space:nowrap;
}
#app-shell .zs-detail-info-value{
  font-size:13px !important;
  font-family:'Fira Mono','Courier New',monospace;
}
#app-shell .zs-detail-bottom{
  display:flex; gap:20px; flex-wrap:wrap;
  margin-top:14px;
  padding-top:12px;
  border-top:1px solid var(--zs-divider);
}
