/* Ouno Remote – panel styles. Colours come from brand/tokens.css. */
*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-app);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
body.auth-open { background:
  radial-gradient(900px 500px at 10% -10%, var(--accent-soft), transparent 60%),
  radial-gradient(700px 400px at 110% 110%, var(--accent-soft), transparent 60%),
  var(--bg); }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; line-height: 1.25; font-weight: 700; }
h1 { font-size: 24px; }
h2 { font-size: 18px; }
h3 { font-size: 15px; }
p { margin: 0; }
code, .mono { font-family: var(--font-mono); font-size: .92em; }
[hidden] { display: none !important; }
button { font: inherit; color: inherit; }
::selection { background: var(--accent-soft); }

.muted { color: var(--text-muted); }
.faint { color: var(--text-faint); font-size: 13px; }
.small { font-size: 13px; }
.center { text-align: center; }
.right { text-align: right; }
.nowrap { white-space: nowrap; }
.grow { flex: 1; min-width: 0; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.stack { display: grid; gap: 14px; }
.mt { margin-top: 14px; }
.mb { margin-bottom: 14px; }
.break { word-break: break-all; }

/* ---------------------------------------------------------------- Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 38px; padding: 0 16px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-raised); color: var(--text);
  font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap;
  transition: background .15s, border-color .15s, transform .12s, box-shadow .15s;
}
.btn:hover { background: var(--bg-card); border-color: var(--text-faint); text-decoration: none; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-contrast); box-shadow: 0 6px 18px var(--accent-soft); }
.btn.primary:hover { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn.primary:active { background: var(--ouno-red-deep); }
.btn.ghost { background: transparent; }
.btn.danger { background: transparent; border-color: var(--danger); color: var(--danger); }
.btn.danger:hover { background: rgba(239, 68, 68, .1); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13px; border-radius: 8px; }
.btn.lg { height: 46px; font-size: 15px; border-radius: 12px; }
.btn.full { width: 100%; }
.btn.icon { width: 38px; padding: 0; }
.btn.icon.sm { width: 32px; }
.btn svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.btn.loading { position: relative; color: transparent !important; pointer-events: none; }
.btn.loading::after { content: ""; position: absolute; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-color: var(--text) transparent var(--text) transparent; animation: spin .8s linear infinite; }
.btn.primary.loading::after { border-color: #fff transparent #fff transparent; }
@keyframes spin { to { transform: rotate(360deg); } }

.icon-btn {
  display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 10px;
  border: 1px solid transparent; background: transparent; color: var(--text-muted); cursor: pointer; position: relative;
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--bg-raised); color: var(--text); }
.icon-btn svg { width: 19px; height: 19px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

/* ------------------------------------------------------------------ Forms */
.field { display: grid; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 13px; font-weight: 600; color: var(--text-muted); }
.field small { color: var(--text-faint); font-size: 12.5px; }
.field .hint { font-size: 12.5px; color: var(--text-faint); }
input, select, textarea {
  width: 100%; height: 40px; padding: 0 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  font: inherit; font-size: 14.5px; outline: none;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 110px; padding: 10px 12px; resize: vertical; line-height: 1.5; }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
input::placeholder, textarea::placeholder { color: var(--text-faint); }
input[type="checkbox"] { width: 18px; height: 18px; accent-color: var(--accent); margin: 0; }
select { appearance: none; -webkit-appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--text-muted) 50%), linear-gradient(135deg, var(--text-muted) 50%, transparent 50%); background-position: calc(100% - 18px) 17px, calc(100% - 13px) 17px; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 32px; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 16px; }
.check { display: flex; align-items: center; gap: 10px; padding: 10px 0; cursor: pointer; }
.check input { flex-shrink: 0; }
.check .check-text { display: grid; }
.check .check-text small { color: var(--text-faint); }
.switch { position: relative; display: inline-block; width: 40px; height: 22px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; position: absolute; }
.switch span { position: absolute; inset: 0; border-radius: 22px; background: var(--border); transition: background .15s; }
.switch span::after { content: ""; position: absolute; top: 3px; left: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .15s; }
.switch input:checked + span { background: var(--accent); }
.switch input:checked + span::after { transform: translateX(18px); }
.switch input:focus-visible + span { box-shadow: 0 0 0 3px var(--accent-soft); }
.input-row { display: flex; gap: 8px; }
.input-row input { flex: 1; }

/* ------------------------------------------------------------------- Auth */
.auth { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.auth-card {
  width: 100%; max-width: 420px; padding: 32px 28px; border-radius: var(--radius-lg);
  background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow);
}
.auth-brand { display: flex; align-items: center; gap: 12px; margin-bottom: 22px; }
.auth-brand img { width: 44px; height: 44px; border-radius: 12px; }
.auth-brand .name { font-size: 20px; font-weight: 700; letter-spacing: -.02em; }
.auth-brand .sub { font-size: 13px; color: var(--text-muted); }
.auth-card h1 { font-size: 22px; margin-bottom: 4px; }
.auth-card .lead { color: var(--text-muted); margin-bottom: 20px; font-size: 14px; }
.auth-links { margin-top: 16px; text-align: center; font-size: 13.5px; color: var(--text-muted); }
.auth-links a { font-weight: 600; }
.auth-foot { margin-top: 26px; text-align: center; font-size: 12px; color: var(--text-faint); }

.alert { padding: 11px 14px; border-radius: 10px; font-size: 13.5px; margin-bottom: 14px; border: 1px solid transparent; }
.alert.error { background: rgba(239, 68, 68, .1); border-color: rgba(239, 68, 68, .35); color: var(--danger); }
.alert.success { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .35); color: var(--success); }
.alert.info { background: rgba(59, 130, 246, .1); border-color: rgba(59, 130, 246, .35); color: var(--info); }
.alert.warning { background: rgba(245, 165, 36, .12); border-color: rgba(245, 165, 36, .4); color: var(--warning); }

/* ------------------------------------------------------------------ Shell */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 252px; flex-shrink: 0; position: sticky; top: 0; height: 100vh; overflow-y: auto;
  padding: 18px 14px; background: var(--bg-soft); border-right: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 6px; z-index: 30;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 14px; }
.brand img { width: 34px; height: 34px; border-radius: 10px; }
.brand .brand-name { font-weight: 700; font-size: 16px; letter-spacing: -.02em; line-height: 1.1; }
.brand .brand-name b { color: var(--accent); }
.brand .brand-sub { font-size: 11.5px; color: var(--text-faint); }
.nav-group { padding: 12px 10px 6px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--text-faint); }
.nav-item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 10px;
  border: 0; background: transparent; color: var(--text-muted); font-weight: 600; font-size: 14px; cursor: pointer; text-align: left;
  transition: background .12s, color .12s;
}
.nav-item:hover { background: var(--bg-raised); color: var(--text); text-decoration: none; }
.nav-item.active { background: var(--accent-soft); color: var(--accent); }
.nav-item svg { width: 18px; height: 18px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.nav-badge { margin-left: auto; min-width: 20px; height: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: grid; place-items: center; }
.sidebar-footer { margin-top: auto; padding: 12px 8px 0; }
.server-pill { display: flex; align-items: center; gap: 8px; padding: 8px 12px; border-radius: 10px; background: var(--bg-card); border: 1px solid var(--border); font-size: 13px; color: var(--text-muted); }
.server-pill .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--text-faint); }
.server-pill .dot.on { background: var(--success); box-shadow: 0 0 0 3px rgba(34, 197, 94, .2); }
.server-pill .ver { margin-left: auto; font-size: 11.5px; color: var(--text-faint); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  position: sticky; top: 12px; z-index: 20; margin: 12px 20px 0;
  display: flex; align-items: center; gap: 12px; padding: 8px 12px 8px 16px; border-radius: var(--radius-lg);
  background: color-mix(in srgb, var(--bg-card) 82%, transparent); border: 1px solid var(--border);
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
}
.topbar .crumbs { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1; }
.topbar .title { font-weight: 700; font-size: 16px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.topbar-actions { display: flex; align-items: center; gap: 4px; }
.menu-btn { display: none; }

.workspace-chip {
  display: inline-flex; align-items: center; gap: 8px; height: 32px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--bg-raised); color: var(--text); font-weight: 600; font-size: 13px; cursor: pointer; max-width: 240px;
}
.workspace-chip span.name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.workspace-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); flex-shrink: 0; }
.workspace-chip .caret { color: var(--text-faint); font-size: 11px; }
.live-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); margin: 0 8px; transition: background .2s, box-shadow .2s; }
.live-dot.on { background: var(--success); box-shadow: 0 0 0 4px rgba(34, 197, 94, .18); }
.bell-badge { position: absolute; top: 5px; right: 5px; min-width: 16px; height: 16px; padding: 0 4px; border-radius: 8px; background: var(--accent); color: #fff; font-size: 10px; font-weight: 700; display: grid; place-items: center; }
.avatar { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; background: linear-gradient(135deg, var(--ouno-red-strong), var(--ouno-red-deep)); color: #fff; font-weight: 700; font-size: 13px; letter-spacing: .02em; }
.profile-btn { border: 0; background: transparent; padding: 2px; border-radius: 50%; cursor: pointer; }

.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 8px); right: 0; min-width: 220px; padding: 6px; border-radius: 12px;
  background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow); z-index: 50;
}
.dropdown-menu.left { right: auto; left: 0; }
.menu-label { padding: 8px 10px 4px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--text-faint); }
.menu-item { display: flex; align-items: center; gap: 10px; width: 100%; padding: 9px 10px; border-radius: 8px; border: 0; background: transparent; color: var(--text); font-size: 14px; cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--bg-raised); text-decoration: none; }
.menu-item.active { color: var(--accent); font-weight: 600; }
.menu-item .sub { margin-left: auto; font-size: 12px; color: var(--text-faint); }
.menu-sep { height: 1px; background: var(--border); margin: 6px 4px; }
.menu-head { padding: 10px 10px 8px; }
.menu-head b { display: block; }
.menu-head span { font-size: 12.5px; color: var(--text-muted); }

/* ------------------------------------------------------------------- Page */
.page { padding: 20px 20px 48px; max-width: 1240px; width: 100%; }
.page-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 18px; }
.page-head p { color: var(--text-muted); margin-top: 4px; font-size: 14px; }
.page-actions { display: flex; gap: 8px; flex-wrap: wrap; }

.card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.card.lg { border-radius: var(--radius-lg); padding: 22px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; flex-wrap: wrap; }
.card-head h2 { font-size: 16px; }
.card-head .sub { font-size: 13px; color: var(--text-muted); }
.card.flush { padding: 0; overflow: hidden; }
.card.flush .card-head { padding: 16px 18px 0; }
.grid { display: grid; gap: 14px; }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(340px, 1fr)); }
.grid.three { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 12px; margin-bottom: 18px; }
.stat { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; }
.stat .stat-icon { width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: linear-gradient(135deg, var(--ouno-red-strong), var(--ouno-red-deep)); color: #fff; flex-shrink: 0; box-shadow: 0 8px 18px var(--accent-soft); }
.stat .stat-icon svg { width: 20px; height: 20px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.stat .stat-icon.neutral { background: var(--bg-raised); color: var(--text-muted); box-shadow: none; }
.stat .stat-icon.success { background: linear-gradient(135deg, #34d399, #16a34a); }
.stat .stat-icon.info { background: linear-gradient(135deg, #60a5fa, #2563eb); }
.stat .stat-icon.warning { background: linear-gradient(135deg, #fbbf24, #d97706); }
.stat .value { font-size: 24px; font-weight: 700; letter-spacing: -.02em; line-height: 1.1; }
.stat .label { font-size: 12.5px; color: var(--text-muted); margin-top: 3px; }

.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); vertical-align: middle; }
th { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--text-faint); white-space: nowrap; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: color-mix(in srgb, var(--bg-raised) 55%, transparent); }
td .actions { display: flex; gap: 6px; justify-content: flex-end; }
td.actions-cell { text-align: right; white-space: nowrap; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12.5px; color: var(--text-faint); }
td.details-cell { max-width: 360px; }
.truncate { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 9px; border-radius: 999px; font-size: 12px; font-weight: 600; background: var(--bg-raised); color: var(--text-muted); border: 1px solid var(--border); white-space: nowrap; }
.badge.success { background: rgba(34, 197, 94, .12); color: var(--success); border-color: rgba(34, 197, 94, .3); }
.badge.danger { background: rgba(239, 68, 68, .12); color: var(--danger); border-color: rgba(239, 68, 68, .3); }
.badge.warning { background: rgba(245, 165, 36, .14); color: var(--warning); border-color: rgba(245, 165, 36, .35); }
.badge.info { background: rgba(59, 130, 246, .12); color: var(--info); border-color: rgba(59, 130, 246, .3); }
.badge.accent { background: var(--accent-soft); color: var(--accent); border-color: transparent; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--text-faint); flex-shrink: 0; }
.status-dot.on { background: var(--success); box-shadow: 0 0 0 3px rgba(34, 197, 94, .18); }
.status-dot.warn { background: var(--warning); }
.status-dot.off { background: var(--text-faint); }
.device-id { font-family: var(--font-mono); letter-spacing: .08em; font-weight: 600; }
.device-id.big { font-size: 26px; letter-spacing: .1em; }
.os-icon { display: inline-grid; place-items: center; width: 32px; height: 32px; border-radius: 9px; background: var(--bg-raised); color: var(--text-muted); flex-shrink: 0; }
.os-icon svg { width: 17px; height: 17px; stroke: currentColor; stroke-width: 2; fill: none; stroke-linecap: round; stroke-linejoin: round; }

.empty { padding: 40px 20px; text-align: center; color: var(--text-muted); }
.empty svg { width: 40px; height: 40px; stroke: var(--text-faint); stroke-width: 1.6; fill: none; stroke-linecap: round; stroke-linejoin: round; margin-bottom: 10px; }
.empty b { display: block; color: var(--text); margin-bottom: 4px; }
.loading { padding: 40px; display: grid; place-items: center; color: var(--text-faint); }
.spinner { width: 26px; height: 26px; border-radius: 50%; border: 3px solid var(--border); border-top-color: var(--accent); animation: spin .8s linear infinite; }
.skeleton { background: linear-gradient(90deg, var(--bg-raised) 25%, var(--bg-card) 50%, var(--bg-raised) 75%); background-size: 200% 100%; animation: shimmer 1.4s infinite; border-radius: 8px; height: 14px; }
@keyframes shimmer { to { background-position: -200% 0; } }

.feed { display: grid; gap: 0; max-height: 420px; overflow-y: auto; }
.feed-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 13.5px; }
.feed-item:last-child { border-bottom: 0; }
.feed-item .when { color: var(--text-faint); font-size: 12px; white-space: nowrap; font-family: var(--font-mono); }
.feed-item .ev { font-weight: 600; color: var(--accent); white-space: nowrap; }
.feed-item .txt { color: var(--text-muted); }

.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.toolbar input[type="search"] { max-width: 320px; }
.search { position: relative; flex: 1; max-width: 340px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 16px; height: 16px; stroke: var(--text-faint); stroke-width: 2; fill: none; }
.search input { padding-left: 36px; }

.pill-list { display: flex; flex-wrap: wrap; gap: 6px; }
.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 14px; }
.kv dt { color: var(--text-muted); }
.kv dd { margin: 0; word-break: break-word; }
.progress { height: 8px; border-radius: 4px; background: var(--bg-raised); overflow: hidden; }
.progress > span { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.bar-list { display: grid; gap: 8px; }
.bar-list .bar-row { display: grid; grid-template-columns: 120px 1fr 60px; gap: 10px; align-items: center; font-size: 13px; }
.bar-list .bar { height: 10px; border-radius: 5px; background: var(--bg-raised); overflow: hidden; }
.bar-list .bar > span { display: block; height: 100%; background: linear-gradient(90deg, var(--ouno-red-strong), var(--ouno-red-deep)); }
.qr-box { display: inline-block; padding: 12px; background: #fff; border-radius: 12px; line-height: 0; }
.qr-box svg { width: 200px; height: 200px; }
.secret-box { font-family: var(--font-mono); letter-spacing: .12em; font-size: 15px; padding: 10px 12px; background: var(--bg-raised); border-radius: 10px; word-break: break-all; }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--border); margin-bottom: 16px; overflow-x: auto; }
.tab { padding: 10px 14px; border: 0; background: transparent; color: var(--text-muted); font-weight: 600; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; white-space: nowrap; }
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.preview-frame { width: 100%; height: 520px; border: 1px solid var(--border); border-radius: 12px; background: #fff; }
.code-area { font-family: var(--font-mono); font-size: 12.5px; min-height: 320px; white-space: pre; }
.notif { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--border); }
.notif:last-child { border-bottom: 0; }
.notif.unread .n-title { color: var(--text); }
.notif .n-dot { width: 8px; height: 8px; border-radius: 50%; margin-top: 8px; background: transparent; flex-shrink: 0; }
.notif.unread .n-dot { background: var(--accent); }
.notif .n-title { font-weight: 600; color: var(--text-muted); }
.notif .n-body { font-size: 13.5px; color: var(--text-muted); }
.notif .n-time { font-size: 12px; color: var(--text-faint); }
.ann-item { padding: 14px 0; border-bottom: 1px solid var(--border); display: flex; gap: 14px; align-items: flex-start; }
.ann-item:last-child { border-bottom: 0; }
.ann-item .ann-body { white-space: pre-wrap; color: var(--text-muted); font-size: 14px; }

/* ----------------------------------------------------------------- Toasts */
#toasts { position: fixed; right: 16px; bottom: 16px; display: grid; gap: 8px; z-index: 200; max-width: min(380px, calc(100vw - 32px)); }
.toast { padding: 12px 16px; border-radius: 12px; background: var(--bg-card); border: 1px solid var(--border); box-shadow: var(--shadow); font-size: 14px; display: flex; gap: 10px; align-items: flex-start; animation: toast-in .25s ease; }
.toast .t-icon { width: 20px; height: 20px; border-radius: 50%; flex-shrink: 0; display: grid; place-items: center; font-size: 12px; font-weight: 700; color: #fff; background: var(--info); }
.toast.success .t-icon { background: var(--success); }
.toast.error .t-icon { background: var(--danger); }
.toast.warning .t-icon { background: var(--warning); }
@keyframes toast-in { from { transform: translateY(10px); opacity: 0; } }

/* ------------------------------------------------------------------ Modal */
.modal-backdrop { position: fixed; inset: 0; background: rgba(0, 0, 0, .55); backdrop-filter: blur(4px); display: grid; place-items: center; padding: 16px; z-index: 100; animation: fade .15s ease; }
@keyframes fade { from { opacity: 0; } }
.modal { width: 100%; max-width: 520px; max-height: calc(100vh - 32px); overflow: auto; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow); padding: 22px; }
.modal.wide { max-width: 860px; }
.modal h2 { margin-bottom: 6px; }
.modal .modal-text { color: var(--text-muted); font-size: 14px; margin-bottom: 18px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 8px; margin-top: 18px; }

/* --------------------------------------------------------------- Responsive */
.sidebar-backdrop { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, .5); z-index: 29; }
@media (max-width: 960px) {
  .sidebar { position: fixed; left: 0; top: 0; bottom: 0; transform: translateX(-100%); transition: transform .2s ease; box-shadow: var(--shadow); }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .sidebar-backdrop { display: block; }
  .menu-btn { display: inline-grid; }
  .topbar { margin: 10px 12px 0; top: 10px; }
  .page { padding: 16px 12px 40px; }
  .workspace-chip { max-width: 150px; }
}
@media (max-width: 600px) {
  .page-head { flex-direction: column; }
  .stat .value { font-size: 21px; }
  .topbar .title { font-size: 15px; }
  .live-dot { display: none; }
  .modal { padding: 18px; }
  .bar-list .bar-row { grid-template-columns: 90px 1fr 50px; }
  .kv { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
