/* MUKESH.OS — home.css
 * Shell layout: topbar + sidebar + main, application grid, command palette,
 * notifications panel, profile menu, updates and settings views. */

.os-body { overflow-x: hidden; }

.os {
  display: grid;
  grid-template: var(--topbar-h) 1fr / var(--sidebar-w) 1fr;
  grid-template-areas: "top top" "side main";
  min-height: 100vh;
}

/* ==================== topbar ==================== */
.topbar {
  grid-area: top;
  display: flex; align-items: center; gap: 16px;
  padding: 0 16px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30;
}
.topbar-brand { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-brand .brand-tile { width: 34px; height: 34px; border-radius: 9px; font-size: 11px; }
.brand-name { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name strong { font: 600 14px var(--font-display); letter-spacing: -.01em; }
.brand-name .eyebrow { font-size: 9.5px; }

.topbar-search {
  flex: 1 1 auto; max-width: 520px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line-strong); border-radius: 10px;
  background: var(--canvas); color: var(--muted);
  transition: border-color var(--t-fast), box-shadow var(--t-fast), background var(--t-fast);
}
.topbar-search:hover { border-color: var(--muted); background: var(--surface); }
.topbar-search .ts-icon svg { width: 16px; height: 16px; }
.topbar-search .ts-label { flex: 1; text-align: left; font-size: 13px; }
.topbar-actions { display: flex; align-items: center; gap: 6px; }

.profile-btn { border-radius: 50%; }
.avatar {
  display: grid; place-items: center;
  width: 32px; height: 32px; border-radius: 50%;
  background: var(--accent); color: var(--accent-ink);
  font: 600 13px var(--font-ui);
}
.avatar.big { width: 40px; height: 40px; font-size: 15px; }

/* ==================== sidebar ==================== */
.sidebar {
  grid-area: side;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 12px 10px;
  background: var(--surface);
  border-right: 1px solid var(--line);
  position: sticky; top: var(--topbar-h);
  height: calc(100vh - var(--topbar-h));
  overflow-y: auto;
}
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav-item {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 9px 12px;
  border-radius: var(--r-sm);
  color: var(--muted); font-weight: 500; font-size: 13.5px;
  transition: background var(--t-fast), color var(--t-fast);
  position: relative;
}
.nav-item:hover { background: var(--surface-2); color: var(--ink); }
.nav-item.active { background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.nav-item.active::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.nav-ic { width: 18px; height: 18px; flex: 0 0 auto; }

/* ==================== main ==================== */
.main { grid-area: main; padding: 28px 32px 48px; min-width: 0; outline: none; }

.view-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.view-title { font: 300 30px/1.15 var(--font-display); letter-spacing: -.02em; margin: 6px 0 4px; }
.view-sub { color: var(--muted); font-size: 13.5px; }
.view-filter input {
  width: 240px; padding: 9px 12px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--surface);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.view-filter input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); outline: none; }

/* ---- home: executive hero (compact) ----
 * MUKESH.OS · tagline · welcome — cards begin directly below.        */
.home-hero { margin-bottom: 16px; }
.home-hero .hh-title {
  font: 600 21px/1.15 var(--font-display);
  letter-spacing: .055em; text-transform: uppercase; margin: 0;
}
.home-hero .hh-tagline {
  font: 600 10.5px var(--font-ui);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); margin: 4px 0 0;
}
.home-hero .hh-welcome {
  font: 500 13.5px/1.4 var(--font-ui);
  color: var(--muted); margin: 8px 0 0;
}

/* ==================== application grid ==================== */
.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(236px, 1fr));
  gap: 14px;
}
.app-card {
  position: relative;
  display: flex; flex-direction: column;
  padding: 18px 18px 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--shadow-1);
  cursor: pointer;
  transition: transform var(--t-fast), box-shadow var(--t-fast), border-color var(--t-fast);
}
.app-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-2);
}
.app-ic {
  width: 42px; height: 42px; border-radius: 11px;
  display: grid; place-items: center;
  background: var(--accent-soft); color: var(--accent);
  margin-bottom: 14px;
}
.app-ic svg { width: 22px; height: 22px; }
.app-name { font: 600 14.5px/1.3 var(--font-ui); margin-bottom: 4px; padding-right: 26px; }
.app-desc {
  color: var(--muted); font-size: 12.5px; line-height: 1.45;
  flex: 1 1 auto; margin-bottom: 14px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.app-foot { display: flex; align-items: center; justify-content: space-between; }
.open-btn { padding: 6px 12px; font-size: 12.5px; }
.open-ic { width: 13px; height: 13px; }

.fav-btn {
  position: absolute; top: 12px; right: 12px;
  width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center;
  color: var(--muted); opacity: 0;
  transition: opacity var(--t-fast), color var(--t-fast), background var(--t-fast);
}
.app-card:hover .fav-btn, .fav-btn:focus-visible, .fav-btn.on { opacity: 1; }
.fav-btn:hover { background: var(--surface-2); color: var(--ink); }
.fav-btn svg { width: 16px; height: 16px; }
.fav-btn.on { color: var(--gold); }
.fav-btn.on svg { fill: var(--gold); stroke: var(--gold); }

/* empty state */
.empty { text-align: center; padding: 72px 16px; color: var(--muted); }
.empty-icon { width: 52px; height: 52px; margin: 0 auto 16px; border-radius: 14px;
  display: grid; place-items: center; background: var(--surface-2); }
.empty-icon svg { width: 24px; height: 24px; }
.empty h2 { font: 600 16px var(--font-ui); color: var(--ink); margin-bottom: 4px; }

/* ==================== updates ==================== */
.updates { display: flex; flex-direction: column; gap: 14px; max-width: 720px; }
.upd {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 18px 20px;
}
.upd header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 10px; }
.upd header strong { font: 600 15px var(--font-ui); }
.upd ul { display: flex; flex-direction: column; gap: 8px; }
.upd li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; color: var(--ink); }
.upd-check { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: var(--ok); }

/* ==================== settings ==================== */
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 14px; max-width: 980px; }
.set-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-1); padding: 18px 20px;
}
.set-card h2 { font: 600 14.5px var(--font-ui); margin-bottom: 4px; }
.set-card > p { color: var(--muted); font-size: 12.5px; margin-bottom: 14px; }
.set-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px;
}
.set-row select {
  padding: 7px 10px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--surface);
}
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.seg-btn { padding: 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-strong); }
.seg-btn.active { background: var(--accent); color: var(--accent-ink); }

.switch { position: relative; display: inline-block; width: 38px; height: 22px; cursor: pointer; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i {
  position: absolute; inset: 0; border-radius: 999px;
  background: var(--line-strong); transition: background var(--t-fast);
}
.switch i::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 16px; height: 16px; border-radius: 50%;
  background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25);
  transition: transform var(--t-fast);
}
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }
.switch input:focus-visible + i { outline: 2px solid var(--accent); outline-offset: 2px; }

/* ==================== notifications panel ==================== */
.scrim { position: fixed; inset: 0; z-index: 40; background: transparent; }
.panel {
  position: fixed; z-index: 41; top: calc(var(--topbar-h) + 8px); right: 12px;
  width: min(360px, calc(100vw - 24px));
  max-height: calc(100vh - var(--topbar-h) - 24px);
  display: flex; flex-direction: column;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
  animation: drop var(--t-med) both;
}
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.panel-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px 10px; border-bottom: 1px solid var(--line);
}
.panel-head h2 { font: 600 14.5px var(--font-ui); }
.notes { overflow-y: auto; padding: 6px 8px; }
.note { display: flex; gap: 12px; padding: 12px 10px; border-radius: var(--r-sm); }
.note:hover { background: var(--surface-2); }
.note.read { opacity: .6; }
.note-ic {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent);
}
.note-ic svg { width: 16px; height: 16px; }
.note strong { font-size: 13px; }
.note p { color: var(--muted); font-size: 12.5px; margin: 2px 0 4px; }
.note-at { font: 500 10.5px var(--font-mono); color: var(--muted); }
.panel-foot { padding: 10px 16px 14px; border-top: 1px solid var(--line); }

/* ==================== profile menu ==================== */
.menu {
  position: fixed; z-index: 41; top: calc(var(--topbar-h) + 8px); right: 12px;
  width: 240px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-2);
  animation: drop var(--t-med) both;
}
.menu-id { display: flex; gap: 12px; align-items: center; padding: 10px 10px 12px;
  border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.menu-id strong { display: block; font-size: 13.5px; }
.menu-item {
  display: block; width: 100%; text-align: left;
  padding: 9px 10px; border-radius: var(--r-sm); font-size: 13.5px;
}
.menu-item:hover { background: var(--surface-2); }

/* ==================== command palette ==================== */
/* The HTML `hidden` attribute must always win over component `display`
 * rules below (e.g. .palette-wrap{display:flex}). Without this, a panel with
 * `hidden` still shows because an explicit `display` overrides the UA
 * default. This one line keeps every hidden panel/menu/palette closed. */
[hidden] { display: none !important; }

.palette-wrap {
  position: fixed; inset: 0; z-index: 60;
  background: var(--scrim);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 16px 16px;
  animation: fade var(--t-fast) both;
}
@keyframes fade { from { opacity: 0; } }
.palette {
  width: min(560px, 100%);
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-2);
  overflow: hidden;
  animation: pal var(--t-med) both;
}
@keyframes pal { from { opacity: 0; transform: translateY(-8px) scale(.985); } }
.palette-input {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 16px; border-bottom: 1px solid var(--line);
}
.pi-icon svg { width: 18px; height: 18px; color: var(--muted); }
#palette-input { flex: 1; border: 0; background: none; font-size: 15px; outline: none; }
.palette-list { max-height: 320px; overflow-y: auto; padding: 6px; }
.pal-item {
  display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "ic name go" "ic desc go";
  column-gap: 12px; align-items: center;
  padding: 10px 12px; border-radius: var(--r-sm); cursor: pointer;
}
.pal-item.active { background: var(--accent-soft); }
.pal-ic { grid-area: ic; width: 32px; height: 32px; border-radius: 9px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.pal-item.active .pal-ic { background: var(--surface); color: var(--accent); }
.pal-ic svg { width: 16px; height: 16px; }
.pal-name { grid-area: name; font-weight: 600; font-size: 13.5px; }
.pal-desc { grid-area: desc; color: var(--muted); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pal-go { grid-area: go; color: var(--muted); opacity: 0; }
.pal-item.active .pal-go { opacity: 1; color: var(--accent); }
.pal-go svg { width: 16px; height: 16px; }
.pal-none { padding: 22px 14px; text-align: center; color: var(--muted); font-size: 13px; }
.palette-foot {
  display: flex; gap: 18px; padding: 10px 16px;
  border-top: 1px solid var(--line);
  color: var(--muted); font-size: 11.5px;
}
.palette-foot span { display: inline-flex; align-items: center; gap: 7px; }

/* ==================== responsive ==================== */
@media (max-width: 900px) {
  .os { grid-template-columns: var(--sidebar-rail) 1fr; }
  .nav-label { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item.active::before { display: none; }
  .brand-name { display: none; }
  .main { padding: 22px 16px 40px; }
  .topbar-search .ts-label { display: none; }
  .topbar-search { flex: 0 0 auto; max-width: none; margin: 0 0 0 auto; }
}
@media (max-width: 560px) {
  .view-filter { width: 100%; }
  .view-filter input { width: 100%; }
  .app-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 420px) {
  .app-grid { grid-template-columns: 1fr; }
}

/* =========================================================================
 * v2 — sidebar collapse/resize, topbar extras, views, cards, panels
 * ========================================================================= */

/* ---- accessibility prefs ---- */
body.reduce-motion *, body.reduce-motion *::before, body.reduce-motion *::after {
  transition: none !important; animation: none !important;
}
body.large-text { font-size: 15.5px; }

/* ---- topbar: collapse button + workspace switch ---- */
#btn-collapse { margin-right: 4px; }
.brand-name { min-width: 0; }
.ws-switch {
  display: inline-flex; align-items: center; gap: 4px;
  font: 600 10.5px var(--font-ui); color: var(--muted);
  padding: 1px 4px; border-radius: 5px; margin-top: 1px;
}
.ws-switch:hover { color: var(--ink); background: var(--surface-2); }
.ws-caret svg { width: 13px; height: 13px; }

/* ---- sidebar search + resize ---- */
.sidebar { position: relative; }
.side-search {
  display: flex; align-items: center; gap: 8px;
  margin: 2px 6px 10px; padding: 7px 10px;
  border: 1px solid var(--line-strong); border-radius: var(--r-sm);
  background: var(--canvas);
}
.side-search .ss-icon svg { width: 15px; height: 15px; color: var(--muted); }
.side-search input { flex: 1; border: 0; background: none; outline: none; font-size: 13px; min-width: 0; }
.side-resize {
  position: absolute; top: 0; right: -3px; width: 6px; height: 100%;
  cursor: col-resize; z-index: 5;
}
.side-resize:hover { background: linear-gradient(90deg, transparent, var(--accent-soft)); }
body.resizing { cursor: col-resize; user-select: none; }

/* collapsed sidebar → icon rail */
body.side-collapsed { --sidebar-w: var(--sidebar-rail); }
body.side-collapsed .nav-label { display: none; }
body.side-collapsed .nav-item { justify-content: center; padding: 11px 0; }
body.side-collapsed .nav-item.active::before { display: none; }
body.side-collapsed .side-search input { display: none; }
body.side-collapsed .side-search { justify-content: center; padding: 7px 0; }
body.side-collapsed .side-resize { display: none; }

/* ---- generic OS card ---- */
.os-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-1);
}
.section-h { font: 600 12px var(--font-ui); text-transform: uppercase;
  letter-spacing: .06em; color: var(--muted); margin: 26px 0 12px; }
.section-h:first-child { margin-top: 0; }
.empty-card { padding: 22px; color: var(--muted); font-size: 13.5px; text-align: center; }
.muted-note { color: var(--muted); font-size: 12px; }
.mono { font-family: var(--font-mono); font-size: 12.5px; }

/* ---- Home dashboard grid ---- */
.home-grid { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 22px; align-items: start; }
.home-main { min-width: 0; }
.home-side { display: flex; flex-direction: column; gap: 14px; }
.side-card { padding: 15px 16px; }
.side-card.wide { grid-column: 1 / -1; }
.side-card h3 { display: flex; align-items: center; gap: 8px;
  font: 600 13px var(--font-ui); margin-bottom: 12px; }
.side-card h3 svg { width: 16px; height: 16px; color: var(--accent); }
.side-empty { color: var(--muted); font-size: 12.5px; }

.row-list { display: flex; flex-direction: column; gap: 2px; }
.row-item { display: flex; align-items: center; gap: 11px; padding: 9px 8px;
  border-radius: var(--r-sm); cursor: default; }
.row-item[data-open-app], .row-item[tabindex] { cursor: pointer; }
.row-item[data-open-app]:hover, .row-item[tabindex]:hover { background: var(--surface-2); }
.row-ic { flex: 0 0 auto; width: 30px; height: 30px; border-radius: 8px;
  display: grid; place-items: center; background: var(--surface-2); color: var(--ink); }
.row-ic svg, .row-ic img { width: 16px; height: 16px; }
.row-tx { flex: 1; min-width: 0; }
.row-tx strong { display: block; font-size: 13px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row-tx span { color: var(--muted); font-size: 11.5px; }
.row-go { width: 15px; height: 15px; color: var(--muted); opacity: .5; }

.qa-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.qa { display: flex; align-items: center; gap: 8px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: var(--r-sm); font-size: 12.5px;
  font-weight: 600; color: var(--ink); background: var(--surface);
  transition: background var(--t-fast), border-color var(--t-fast); }
.qa:hover { background: var(--surface-2); border-color: var(--line-strong); }
.qa svg { width: 16px; height: 16px; color: var(--accent); }

.ann { font-size: 12.5px; color: var(--ink); margin-bottom: 8px; }
.status-list { display: flex; flex-direction: column; gap: 8px; font-size: 12.5px; }
.status-list li { display: flex; align-items: center; gap: 8px; }
.storage { margin-top: 14px; }
.storage-top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.storage-bar { height: 7px; border-radius: 4px; background: var(--surface-2); overflow: hidden; }
.storage-bar i { display: block; height: 100%; border-radius: 4px;
  background: linear-gradient(90deg, var(--accent), color-mix(in srgb, var(--accent) 60%, #7A3CE8)); }

/* ---- status + role pills ---- */
.status-pill { font: 600 10.5px var(--font-ui); border-radius: 999px; padding: 2px 9px;
  background: var(--surface-2); color: var(--muted); }
.status-pill.on { background: color-mix(in srgb, var(--ok) 16%, transparent); color: var(--ok); }
.status-pill.off { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.status-pill.warn { background: color-mix(in srgb, var(--gold) 20%, transparent); color: #8a6d16; }
.role-badge { font: 600 10.5px var(--font-ui); border-radius: 999px; padding: 2px 9px;
  background: var(--surface-2); color: var(--muted); margin-left: 6px; }
.role-badge.admin { background: var(--accent-soft); color: var(--accent); }
.role-badge.mgr { background: color-mix(in srgb, var(--gold) 18%, transparent); color: #8a6d16; }
.lvl-badge { font: 600 9.5px var(--font-ui); border-radius: 5px; padding: 1px 6px;
  margin-left: 7px; vertical-align: middle; }
.lvl-badge.ro { background: color-mix(in srgb, var(--gold) 20%, transparent); color: #8a6d16; }
.lvl-badge.vo { background: var(--surface-2); color: var(--muted); }

/* ---- app-name inline badges ---- */
.app-name { display: flex; align-items: center; flex-wrap: wrap; gap: 2px; }

/* ---- pill tabs (Users) ---- */
.pill-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.pill { padding: 7px 14px; border: 1px solid var(--line-strong); border-radius: 999px;
  font-size: 12.5px; font-weight: 600; color: var(--muted); background: var(--surface);
  transition: all var(--t-fast); }
.pill:hover { color: var(--ink); border-color: var(--muted); }
.pill.active { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ---- tables ---- */
.table-card { padding: 4px 14px 8px; overflow-x: auto; }
.os-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.os-table th { text-align: left; font: 600 10.5px var(--font-ui); text-transform: uppercase;
  letter-spacing: .05em; color: var(--muted); padding: 11px 10px; border-bottom: 1px solid var(--line); }
.os-table td { padding: 11px 10px; border-bottom: 1px solid var(--line); vertical-align: middle; }
.os-table tr:last-child td { border-bottom: 0; }
.os-table .right { text-align: right; }
.am-app { display: flex; align-items: center; gap: 11px; }
.am-ic { flex: 0 0 auto; width: 34px; height: 34px; border-radius: 9px;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.am-ic svg, .am-ic img { width: 18px; height: 18px; }
.am-desc { display: block; color: var(--muted); font-size: 11.5px; max-width: 320px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.src-badge { font: 600 10px var(--font-mono); color: var(--muted);
  background: var(--surface-2); border-radius: 5px; padding: 2px 7px; }
.am-actions { white-space: nowrap; }
.row-btn { border: 1px solid var(--line-strong); background: var(--surface); border-radius: 7px;
  padding: 5px 10px; font-size: 11.5px; font-weight: 600; color: var(--muted); margin-left: 6px;
  transition: all var(--t-fast); }
.row-btn:hover:not([disabled]) { color: var(--ink); border-color: var(--muted); }
.row-btn.primary { color: var(--accent); border-color: color-mix(in srgb, var(--accent) 40%, var(--line-strong)); }
.row-btn.primary:hover:not([disabled]) { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.row-btn[disabled] { opacity: .45; }

/* ---- store / files grids ---- */
.store-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.store-card, .file-card { padding: 18px; }
.store-card h3, .file-card h3 { font: 600 14px var(--font-ui); margin: 12px 0 4px; }
.store-card p, .file-card p { color: var(--muted); font-size: 12.5px; min-height: 34px; margin-bottom: 14px; }
.store-card footer, .file-card footer { display: flex; align-items: center; justify-content: space-between; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.slim { padding: 6px 12px; font-size: 12.5px; }

/* ---- update center ---- */
.upd-hero { display: flex; gap: 40px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 8px; }
.upd-ver { font: 300 30px var(--font-display); margin: 4px 0 10px; }
.rel-card { padding: 18px 20px; margin-bottom: 14px; }
.rel-card header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.rel-card ul { display: flex; flex-direction: column; gap: 8px; }
.rel-card li { display: flex; gap: 10px; align-items: flex-start; font-size: 13.5px; }
.upd-check { width: 15px; height: 15px; flex: 0 0 auto; margin-top: 2px; color: var(--ok); }

/* ---- activity ---- */
.act-ic { display: inline-grid; place-items: center; width: 22px; height: 22px;
  border-radius: 6px; background: var(--surface-2); color: var(--muted);
  vertical-align: middle; margin-right: 8px; }
.act-ic svg { width: 13px; height: 13px; }

/* ---- settings ---- */
.settings { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 14px; }
.set-card { padding: 18px 20px; }
.set-card h2 { font: 600 14.5px var(--font-ui); margin-bottom: 4px; }
.set-card > p { color: var(--muted); font-size: 12.5px; margin-bottom: 12px; }
.set-row { display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 0; border-top: 1px solid var(--line); font-size: 13.5px; }
.set-row select { padding: 7px 10px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--surface); }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: var(--r-sm); overflow: hidden; }
.seg-btn { padding: 6px 14px; font-size: 12.5px; font-weight: 600; color: var(--muted); }
.seg-btn + .seg-btn { border-left: 1px solid var(--line-strong); }
.seg-btn.active { background: var(--accent); color: var(--accent-ink); }
.switch { position: relative; display: inline-block; width: 38px; height: 22px; flex: 0 0 auto; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch i { position: absolute; inset: 0; border-radius: 999px; background: var(--line-strong);
  transition: background var(--t-fast); cursor: pointer; }
.switch i::after { content: ''; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px;
  border-radius: 50%; background: #fff; box-shadow: 0 1px 2px rgba(0,0,0,.25); transition: transform var(--t-fast); }
.switch input:checked + i { background: var(--accent); }
.switch input:checked + i::after { transform: translateX(16px); }

/* ---- notification channel tabs + assistant ---- */
.note-tabs { display: flex; gap: 4px; padding: 8px 12px 0; }
.note-tab { padding: 6px 12px; font-size: 12px; font-weight: 600; color: var(--muted);
  border-radius: var(--r-sm); }
.note-tab:hover { background: var(--surface-2); color: var(--ink); }
.note-tab.active { background: var(--accent-soft); color: var(--accent); }
.assistant { display: flex; flex-direction: column; }
.asst-body { padding: 8px 16px 16px; flex: 1; overflow-y: auto; }
.asst-hero { width: 46px; height: 46px; border-radius: 12px; margin: 12px 0;
  display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); }
.asst-hero svg { width: 24px; height: 24px; }
.asst-lede { font-size: 13.5px; margin-bottom: 16px; }
.asst-provider { margin-bottom: 12px; }
.asst-note { font-size: 12px; color: var(--muted); }
.asst-input { display: flex; gap: 8px; padding: 12px 16px; border-top: 1px solid var(--line); }
.asst-input input { flex: 1; padding: 9px 12px; border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); background: var(--canvas); }

/* ---- workspace menu ---- */
.menu-meta { padding: 8px 10px 6px; font: 600 10.5px var(--font-ui);
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.ws-menu { width: 232px; }
.ws-item { display: flex; align-items: center; gap: 10px; }
.ws-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line-strong); flex: 0 0 auto; }
.ws-dot.on { background: var(--ok); }
.pal-group { padding: 8px 12px 4px; font: 600 10px var(--font-ui);
  text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }

/* ---- responsive ---- */
@media (max-width: 1040px) {
  .home-grid { grid-template-columns: 1fr; }
  .home-side { flex-direction: row; flex-wrap: wrap; }
  .home-side .side-card { flex: 1 1 260px; }
}
@media (max-width: 900px) {
  .os { grid-template-columns: var(--sidebar-rail) 1fr !important; }
  .nav-label { display: none; }
  .nav-item { justify-content: center; padding: 11px 0; }
  .nav-item.active::before { display: none; }
  .side-search input { display: none; }
  .side-search { justify-content: center; padding: 7px 0; }
  .side-resize { display: none; }
  .brand-name { display: none; }
  .topbar-search .ts-label { display: none; }
  .topbar-search { flex: 0 0 auto; max-width: none; margin: 0 0 0 auto; }
  .main { padding: 20px 16px 40px; }
}

/* App Manager table: slightly tighter action column */
.am-table td { vertical-align: middle; }

/* ---- User Management: modal, permissions, flash (reuses tokens) ---- */
.os-modal-wrap { position: fixed; inset: 0; z-index: 70; }
.os-scrim { position: absolute; inset: 0; background: var(--scrim);
  -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.os-modal { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%);
  width: min(420px, 94vw); max-height: 90vh; overflow-y: auto;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--r-md); box-shadow: var(--shadow-2); padding: 22px 22px 18px;
  display: flex; flex-direction: column; gap: 12px; }
.os-modal h2 { font: 600 18px var(--font-display); }
.os-modal .field { margin: 0; }
.dlg-btns { display: flex; justify-content: flex-end; gap: 10px; margin-top: 6px; }
.dlg-error { background: color-mix(in srgb, var(--danger) 12%, transparent);
  color: var(--danger); font-size: 12.5px; border-radius: var(--r-sm); padding: 8px 11px; }
.hint { color: var(--muted); font-weight: 400; }
.um-flash { margin-bottom: 14px; padding: 11px 14px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 500; }
.um-flash.ok { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.um-flash.err { background: color-mix(in srgb, var(--danger) 12%, transparent); color: var(--danger); }
.um-flash code { font-family: var(--font-mono); background: var(--surface-2);
  padding: 2px 8px; border-radius: 5px; user-select: all; }
.perm-list { display: flex; flex-direction: column; gap: 2px; max-height: 46vh; overflow-y: auto;
  border: 1px solid var(--line); border-radius: var(--r-sm); padding: 6px; }
.perm-row { display: flex; align-items: flex-start; gap: 10px; padding: 8px 8px; border-radius: 6px; cursor: pointer; }
.perm-row:hover { background: var(--surface-2); }
.perm-row input { margin-top: 3px; accent-color: var(--accent); }
.perm-row span { display: flex; flex-direction: column; }
.perm-row strong { font: 600 12.5px var(--font-mono); }
.perm-row em { font-style: normal; color: var(--muted); font-size: 11.5px; }
.row-btn.danger:hover:not([disabled]) { color: var(--danger); border-color: var(--danger); }
