/* HomeHub — premium, dependency-free arayüz teması */
:root {
  --bg: #070a11;
  --bg-soft: #0b0f19;
  --surface: #101624;
  --surface-soft: #0d1320;
  --surface-2: #151d2e;
  --surface-3: #1c2740;
  --border: rgba(148, 163, 184, 0.12);
  --border-strong: rgba(148, 163, 184, 0.24);
  --text: #e8eef9;
  --text-strong: #ffffff;
  --muted: #94a3b8;
  --faint: #64748b;
  --accent: #7290ff;
  --accent-2: #3ddbc0;
  --accent-ink: #ffffff;
  --accent-soft: rgba(114, 144, 255, 0.15);
  --accent-glow: rgba(114, 144, 255, 0.35);
  --danger: #ff6b81;
  --danger-soft: rgba(255, 107, 129, 0.13);
  --warning: #f7b955;
  --warning-soft: rgba(247, 185, 85, 0.13);
  --success: #3ddc97;
  --success-soft: rgba(61, 220, 151, 0.12);
  --info: #56b8ff;
  --info-soft: rgba(86, 184, 255, 0.12);
  --violet: #b18cff;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
  --shadow-soft: 0 12px 28px rgba(0, 0, 0, 0.18);
  --font: ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

[data-theme="light"] {
  --bg: #f4f6fb;
  --bg-soft: #eef2f9;
  --surface: #ffffff;
  --surface-soft: #fbfcff;
  --surface-2: #f1f5fc;
  --surface-3: #e4eaf5;
  --border: rgba(15, 23, 42, 0.09);
  --border-strong: rgba(15, 23, 42, 0.16);
  --text: #172033;
  --text-strong: #0b1220;
  --muted: #5d6b84;
  --faint: #8391a8;
  --accent: #4f6df5;
  --accent-2: #0fb9a0;
  --accent-soft: rgba(79, 109, 245, 0.1);
  --accent-glow: rgba(79, 109, 245, 0.22);
  --danger: #e2445c;
  --danger-soft: rgba(226, 68, 92, 0.09);
  --warning: #b8790c;
  --warning-soft: rgba(184, 121, 12, 0.1);
  --success: #0e9f6e;
  --success-soft: rgba(14, 159, 110, 0.1);
  --info: #1d7fd1;
  --info-soft: rgba(29, 127, 209, 0.09);
  --violet: #7c5cf0;
  --shadow: 0 22px 50px rgba(15, 23, 42, 0.08);
  --shadow-soft: 0 10px 24px rgba(15, 23, 42, 0.06);
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.app {
  background:
    radial-gradient(1100px 600px at 85% -10%, rgba(61, 219, 192, 0.05), transparent 60%),
    radial-gradient(900px 500px at 10% 0%, rgba(114, 144, 255, 0.07), transparent 55%),
    var(--bg);
}

::selection { background: var(--accent-glow); color: #fff; }

a { color: inherit; text-decoration: none; }
p { margin: 0 0 10px; }
h1, h2, h3, h4 { margin: 0; font-weight: 650; letter-spacing: -0.015em; }
img { max-width: 100%; }
hr { border: 0; border-top: 1px solid var(--border); margin: 18px 0; }

button, input, select, textarea, summary { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--surface-3); border-radius: 99px; border: 2px solid var(--bg); }
::-webkit-scrollbar-thumb:hover { background: var(--faint); }

.ambient {
  position: fixed;
  z-index: 0;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  filter: blur(100px);
  pointer-events: none;
  opacity: 0.16;
}
.ambient-a { top: -220px; right: -140px; background: radial-gradient(circle, var(--accent), transparent 65%); }
.ambient-b { bottom: -260px; left: 20%; background: radial-gradient(circle, var(--accent-2), transparent 65%); opacity: 0.1; }

/* Layout */
.layout { position: relative; z-index: 1; display: flex; min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 50;
  width: 254px;
  display: flex;
  flex-direction: column;
  padding: 20px 14px 16px;
  background: linear-gradient(180deg, rgba(14, 20, 34, 0.97), rgba(8, 12, 21, 0.99));
  border-right: 1px solid var(--border);
  backdrop-filter: blur(20px);
}
[data-theme="light"] .sidebar {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(246, 248, 253, 0.99));
}

.brand { display: flex; align-items: center; gap: 12px; padding: 4px 8px 22px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 13px;
  display: grid; place-items: center; color: #fff;
  background: linear-gradient(135deg, #7a95ff, #3ddbc0);
  box-shadow: 0 10px 24px rgba(90, 120, 255, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}
.brand-mark .icon { width: 22px; height: 22px; stroke-width: 1.9; }
.brand-text { display: flex; flex-direction: column; line-height: 1.25; }
.brand-text strong { font-size: 16px; letter-spacing: -0.02em; color: var(--text-strong); }
.brand-text small { font-size: 10px; color: var(--faint); letter-spacing: 0.06em; text-transform: uppercase; margin-top: 3px; }

.nav { flex: 1; overflow-y: auto; padding: 0 2px 12px; }
.nav-section { margin-bottom: 20px; }
.nav-label {
  margin: 0 10px 8px; font-size: 9.5px; font-weight: 700; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--faint);
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 11px; margin-bottom: 2px; border-radius: 11px;
  font-size: 13px; font-weight: 500; color: var(--muted);
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
  border: 1px solid transparent;
}
.nav-link .icon { width: 17px; height: 17px; opacity: 0.85; }
.nav-link:hover { background: var(--surface-2); color: var(--text); }
.nav-link.active {
  background: linear-gradient(90deg, var(--accent-soft), rgba(114, 144, 255, 0.04));
  color: var(--text-strong); border-color: rgba(114, 144, 255, 0.18);
}
.nav-link.active .icon { color: var(--accent); opacity: 1; }
.nav-badge {
  margin-left: auto; min-width: 18px; height: 18px; padding: 0 5px;
  display: grid; place-items: center; border-radius: 99px;
  background: var(--accent); color: #fff; font-size: 10px; font-weight: 700;
}
.sidebar-footer { border-top: 1px solid var(--border); padding: 14px 6px 2px; }
.server-pill { display: flex; align-items: center; gap: 10px; padding: 8px 8px; border-radius: 11px; background: var(--surface-2); border: 1px solid var(--border); }
.server-pill strong { display: block; font-size: 11.5px; font-weight: 600; }
.server-pill small { display: block; font-size: 9.5px; color: var(--faint); }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 4px var(--success-soft); animation: pulse 2.4s infinite; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 3px var(--success-soft); } 50% { box-shadow: 0 0 0 6px transparent; } }
.sidebar-note { display: flex; align-items: center; gap: 6px; margin: 12px 8px 0; font-size: 9.5px; color: var(--faint); }
.sidebar-note .icon { width: 13px; height: 13px; }

.sidebar-scrim { display: none; }

.main { flex: 1; min-width: 0; margin-left: 254px; display: flex; flex-direction: column; }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 14px;
  height: 70px; padding: 0 30px;
  background: rgba(7, 10, 17, 0.72);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(18px);
}
[data-theme="light"] .topbar { background: rgba(244, 246, 251, 0.82); }
.topbar-title h1 { font-size: 17px; font-weight: 650; letter-spacing: -0.02em; }
.topbar-title .sub { display: block; font-size: 11px; color: var(--muted); margin-top: 2px; }
.topbar-actions { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.clock { font-size: 11.5px; color: var(--muted); font-variant-numeric: tabular-nums; padding: 0 8px; white-space: nowrap; }
.nav-toggle { display: none; }

.content { flex: 1; width: 100%; max-width: 1500px; margin: 0 auto; padding: 26px 30px 64px; }

/* Icon buttons and popovers */
.icon-btn {
  position: relative; width: 38px; height: 38px; border-radius: 11px;
  display: grid; place-items: center; border: 1px solid transparent;
  background: transparent; color: var(--muted);
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}
.icon-btn:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.icon-btn .icon { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }

.popover { position: relative; }
.popover > summary { list-style: none; cursor: pointer; }
.popover > summary::-webkit-details-marker { display: none; }
.popover[open] > summary.icon-btn { background: var(--surface-2); color: var(--text); }
.popover-panel {
  position: absolute; right: 0; top: calc(100% + 10px); z-index: 70;
  width: 340px; padding: 14px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 16px; box-shadow: var(--shadow);
  animation: popIn 0.16s ease;
}
@keyframes popIn { from { opacity: 0; transform: translateY(-4px) scale(0.99); } to { opacity: 1; transform: none; } }
.popover-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; font-size: 12px; }
.popover-head strong { font-size: 12.5px; }
.popover-empty { padding: 18px 8px; text-align: center; color: var(--faint); font-size: 12px; margin: 0; }
.count-badge {
  position: absolute; top: -1px; right: -1px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 99px; background: var(--danger); color: #fff;
  font-size: 9.5px; font-weight: 700; display: grid; place-items: center;
  border: 2px solid var(--bg);
}
.avatar {
  width: 38px; height: 38px; border-radius: 50%;
  display: grid; place-items: center; cursor: pointer;
  font-size: 13px; font-weight: 700; color: #fff; list-style: none;
  background: linear-gradient(135deg, #7290ff, #3ddbc0);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12), 0 6px 16px rgba(90, 120, 255, 0.28);
}
.avatar::-webkit-details-marker { display: none; }
.user-panel { width: 238px; padding: 8px; }
.user-meta { padding: 10px 12px 12px; border-bottom: 1px solid var(--border); margin-bottom: 6px; }
.user-meta strong { display: block; font-size: 13px; }
.user-meta small { font-size: 10.5px; color: var(--faint); }
.menu-item {
  display: flex; align-items: center; gap: 9px; width: 100%;
  padding: 9px 10px; border-radius: 9px; border: 0; background: transparent;
  color: var(--muted); font-size: 12.5px; text-align: left;
}
.menu-item:hover { background: var(--surface-2); color: var(--text); }
.menu-item.danger { color: var(--danger); }
.menu-item .icon { width: 16px; height: 16px; }

.mini-list { list-style: none; margin: 0; padding: 0; }
.mini-item { display: flex; gap: 10px; padding: 9px 4px; border-top: 1px solid var(--border); }
.mini-item:first-child { border-top: 0; }
.mini-item .mini-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); margin-top: 6px; flex: 0 0 auto; opacity: 0.5; }
.mini-item.unread .mini-dot { opacity: 1; }
.mini-item a { display: block; font-size: 12px; line-height: 1.4; color: var(--text); }
.mini-item a:hover { color: var(--accent); }
.mini-item small { font-size: 10px; color: var(--faint); }
.kind-docker { background: var(--info); }
.kind-system { background: var(--warning); }
.kind-task { background: var(--success); }
.kind-rss { background: var(--violet); }

/* Cards and grids */
.card {
  position: relative;
  background: linear-gradient(180deg, var(--surface), var(--surface-soft));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
.card-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 17px 20px 13px; }
.card-title { display: flex; align-items: center; gap: 8px; font-size: 13.5px; font-weight: 600; margin: 0; }
.card-title .icon { width: 17px; height: 17px; color: var(--accent); }
.card-sub { margin: 4px 0 0; font-size: 11px; color: var(--muted); }
.card-body { padding: 0 20px 20px; }
.card-body.flush { padding: 0; }
.card-link { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; color: var(--muted); white-space: nowrap; }
.card-link:hover { color: var(--accent); }
.card-link .icon { width: 13px; height: 13px; }

.grid { display: grid; gap: 18px; }
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.auto { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.stack { display: flex; flex-direction: column; gap: 18px; }
.row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.spacer { flex: 1; }
.muted { color: var(--muted); }
.faint { color: var(--faint); }
.mono { font-family: var(--mono); font-size: 0.92em; }
.nowrap { white-space: nowrap; }
.mt-0 { margin-top: 0; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 14px; }
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 14px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Welcome */
.welcome {
  position: relative; overflow: hidden;
  display: grid; grid-template-columns: 1.5fr auto; gap: 24px; align-items: center;
  padding: 26px 28px; border-radius: 22px;
  background:
    radial-gradient(700px 300px at 100% 0%, rgba(61, 219, 192, 0.12), transparent 60%),
    radial-gradient(600px 260px at 0% 100%, rgba(114, 144, 255, 0.14), transparent 60%),
    linear-gradient(135deg, #141d31, #0c1220);
  border: 1px solid rgba(120, 145, 200, 0.2);
  box-shadow: var(--shadow);
}
[data-theme="light"] .welcome {
  background:
    radial-gradient(700px 300px at 100% 0%, rgba(15, 185, 160, 0.1), transparent 60%),
    radial-gradient(600px 260px at 0% 100%, rgba(79, 109, 245, 0.12), transparent 60%),
    linear-gradient(135deg, #ffffff, #f1f5fd);
}
.welcome::after {
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0.35;
  background-image: linear-gradient(rgba(148, 163, 184, 0.06) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.06) 1px, transparent 1px);
  background-size: 34px 34px;
  mask-image: radial-gradient(600px 260px at 70% 20%, #000, transparent 75%);
}
.welcome > * { position: relative; z-index: 1; }
.welcome .eyebrow { margin-bottom: 8px; }
.welcome h2 { font-size: clamp(22px, 2.6vw, 30px); letter-spacing: -0.03em; margin-bottom: 8px; color: var(--text-strong); }
.welcome p.lead { max-width: 640px; font-size: 13px; color: var(--muted); margin: 0; }
.welcome-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.quick-actions { display: grid; grid-template-columns: repeat(2, 128px); gap: 9px; }
.quick-btn {
  display: flex; align-items: center; gap: 9px; padding: 11px 12px;
  border-radius: 12px; border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(255, 255, 255, 0.04); color: var(--text);
  font-size: 11.5px; font-weight: 550; backdrop-filter: blur(8px);
  transition: transform 0.16s ease, background 0.16s ease, border-color 0.16s ease;
}
[data-theme="light"] .quick-btn { background: rgba(255, 255, 255, 0.7); }
.quick-btn:hover { transform: translateY(-1px); background: var(--accent-soft); border-color: rgba(114, 144, 255, 0.35); }
.quick-btn .icon { width: 16px; height: 16px; color: var(--accent); }

.eyebrow { font-size: 10px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--accent); }

.chip {
  display: inline-flex; align-items: center; gap: 6px;
  height: 27px; padding: 0 10px; border-radius: 99px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11px; color: var(--muted); white-space: nowrap;
}
.chip .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--success); }
.chip.online { color: var(--success); border-color: rgba(61, 220, 151, 0.25); }
.chip.offline { color: var(--danger); border-color: rgba(255, 107, 129, 0.25); }
.chip.offline .dot { background: var(--danger); }
.chip .icon { width: 13px; height: 13px; }

/* Dashboard widgets */
.widgets { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.widget { grid-column: span 6; }
.widget-system, .widget-docker, .widget-internet { grid-column: span 4; }
.widget-notifications { grid-column: span 6; }
.widget-bookmarks { grid-column: span 6; }

.rings { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.metric { text-align: center; }
.ring {
  --pct: 0; --color: var(--accent);
  width: 64px; height: 64px; border-radius: 50%; margin: 0 auto;
  display: grid; place-items: center; position: relative;
  background: conic-gradient(var(--color) calc(var(--pct) * 1%), var(--surface-3) 0);
}
.ring::before { content: ""; position: absolute; inset: 5px; border-radius: 50%; background: var(--surface); }
.ring span { position: relative; z-index: 1; font-size: 13px; font-weight: 650; font-variant-numeric: tabular-nums; }
.metric-name { margin-top: 7px; font-size: 10px; color: var(--muted); }
.metric-sub { font-size: 9.5px; color: var(--faint); }

.stat-line { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; padding: 8px 0; border-top: 1px solid var(--border); font-size: 11.5px; }
.stat-line:first-child { border-top: 0; }
.stat-line .label { color: var(--muted); }
.stat-line .value { font-weight: 600; font-variant-numeric: tabular-nums; }
.progress { height: 7px; border-radius: 99px; background: var(--surface-3); overflow: hidden; margin-top: 6px; }
.progress > span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--accent), var(--accent-2)); }
.progress.warn > span { background: linear-gradient(90deg, var(--warning), var(--danger)); }
.progress > span.ram { background: linear-gradient(90deg, #b18cff, #7290ff); }
.progress > span.disk { background: linear-gradient(90deg, #3ddbc0, #56b8ff); }

.feed-list { list-style: none; margin: 0; padding: 0; }
.feed-item { display: flex; gap: 10px; padding: 10px 0; border-top: 1px solid var(--border); }
.feed-item:first-child { border-top: 0; padding-top: 2px; }
.feed-item:last-child { padding-bottom: 0; }
.feed-icon { width: 28px; height: 28px; flex: 0 0 auto; border-radius: 8px; display: grid; place-items: center; background: var(--surface-2); color: var(--accent); }
.feed-icon .icon { width: 14px; height: 14px; }
.feed-main { min-width: 0; flex: 1; }
.feed-title { display: block; font-size: 12px; font-weight: 500; line-height: 1.45; color: var(--text); overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.feed-title:hover { color: var(--accent); }
.feed-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 3px; font-size: 9.8px; color: var(--faint); }
.feed-meta .sep { opacity: 0.5; }

.docker-hero { display: flex; align-items: center; gap: 14px; margin-bottom: 12px; }
.docker-count { font-size: 30px; font-weight: 700; letter-spacing: -0.04em; line-height: 1; }
.docker-count small { font-size: 13px; font-weight: 500; color: var(--faint); letter-spacing: 0; }
.docker-count-label { font-size: 10.5px; color: var(--muted); margin-top: 5px; }
.warn-list { list-style: none; margin: 10px 0 0; padding: 0; }
.warn-item { display: flex; align-items: center; gap: 8px; padding: 7px 0; border-top: 1px solid var(--border); font-size: 11.5px; }
.warn-item .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--danger); }
.warn-item .name { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.internet-card { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; padding: 10px 0 6px; }
.net-orb { width: 74px; height: 74px; border-radius: 50%; display: grid; place-items: center; margin-bottom: 12px; background: var(--success-soft); color: var(--success); border: 1px solid rgba(61, 220, 151, 0.22); }
.net-orb.offline { background: var(--danger-soft); color: var(--danger); border-color: rgba(255, 107, 129, 0.25); }
.net-orb .icon { width: 30px; height: 30px; }
.net-status { font-size: 15px; font-weight: 650; }
.net-detail { font-size: 11px; color: var(--muted); margin-top: 3px; }

.task-mini { display: flex; align-items: flex-start; gap: 10px; padding: 8px 0; border-top: 1px solid var(--border); }
.task-mini:first-child { border-top: 0; }
.task-check-form { display: contents; }
.task-check {
  width: 19px; height: 19px; margin-top: 1px; flex: 0 0 auto;
  border-radius: 6px; border: 1.5px solid var(--border-strong);
  background: transparent; display: grid; place-items: center; color: transparent;
  transition: all 0.15s ease;
}
.task-check:hover { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
.task-check .icon { width: 12px; height: 12px; }
.task-mini.done .task-title { text-decoration: line-through; color: var(--faint); }
.task-title { font-size: 12px; line-height: 1.4; flex: 1; }
.task-meta { font-size: 9.8px; color: var(--faint); margin-top: 2px; }

.note-mini { padding: 10px 0; border-top: 1px solid var(--border); }
.note-mini:first-child { border-top: 0; padding-top: 2px; }
.note-mini a.title { font-size: 12px; font-weight: 550; }
.note-mini a.title:hover { color: var(--accent); }
.note-mini p { font-size: 10.5px; color: var(--muted); margin: 3px 0 0; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }

.quick-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.quick-link {
  display: flex; flex-direction: column; align-items: center; gap: 6px;
  padding: 11px 6px; border-radius: 12px; border: 1px solid var(--border);
  background: var(--surface-2); font-size: 10px; color: var(--muted);
  text-align: center; transition: border-color 0.15s ease, transform 0.15s ease;
}
.quick-link:hover { border-color: var(--border-strong); transform: translateY(-1px); color: var(--text); }
.quick-link img, .quick-letter { width: 28px; height: 28px; border-radius: 8px; object-fit: cover; background: var(--surface-3); }
.quick-letter { display: grid; place-items: center; font-size: 12px; font-weight: 700; color: var(--accent); }
.quick-link span { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Page building blocks */
.page-toolbar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.page-toolbar h2 { font-size: 18px; }
.page-toolbar .spacer { flex: 1; }
.filters { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-bottom: 16px; }
.filters .field { margin: 0; }
.filters input, .filters select { height: 36px; padding: 7px 11px; font-size: 12px; width: auto; min-width: 140px; }
.filters .search { min-width: 220px; }
.section-title { display: flex; align-items: center; gap: 8px; margin: 30px 0 14px; font-size: 14.5px; font-weight: 650; }
.section-title .icon { color: var(--accent); width: 17px; height: 17px; }
.section-title .count { font-size: 10px; color: var(--faint); font-weight: 500; }

.tabs { display: inline-flex; gap: 3px; padding: 4px; background: var(--surface-2); border: 1px solid var(--border); border-radius: 12px; }
.tab { padding: 7px 12px; border-radius: 8px; font-size: 11.5px; color: var(--muted); font-weight: 550; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { background: var(--surface); color: var(--text-strong); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18); }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 14px; border-radius: 11px;
  border: 1px solid var(--border-strong); background: var(--surface-2);
  color: var(--text); font-size: 12.5px; font-weight: 600; white-space: nowrap;
  transition: background 0.16s ease, border-color 0.16s ease, transform 0.16s ease, box-shadow 0.16s ease;
}
.btn:hover { background: var(--surface-3); border-color: var(--border-strong); }
.btn:active { transform: translateY(1px); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(135deg, #6f8dff, #4f6df5);
  border-color: rgba(114, 144, 255, 0.5); color: #fff;
  box-shadow: 0 8px 20px rgba(79, 109, 245, 0.28), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}
.btn-primary:hover { background: linear-gradient(135deg, #819bff, #5d7bff); border-color: rgba(150, 170, 255, 0.6); }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover { background: var(--surface-2); color: var(--text); }
.btn-danger { background: var(--danger-soft); border-color: rgba(255, 107, 129, 0.28); color: var(--danger); }
.btn-danger:hover { background: rgba(255, 107, 129, 0.2); }
.btn-success { background: var(--success-soft); border-color: rgba(61, 220, 151, 0.28); color: var(--success); }
.btn-sm { height: 30px; padding: 0 10px; font-size: 11px; border-radius: 9px; }
.btn-sm .icon { width: 14px; height: 14px; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: 10px; background: transparent; border-color: transparent; color: var(--muted); }
.btn-icon:hover { background: var(--surface-2); color: var(--text); border-color: var(--border); }
.btn-block { width: 100%; }
.btn-group { display: inline-flex; gap: 4px; }

.link { color: var(--accent); font-size: 11.5px; }
.link:hover { text-decoration: underline; }

/* Forms */
.stack-form { display: flex; flex-direction: column; gap: 1px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.field label { font-size: 11.5px; font-weight: 550; color: var(--muted); }
.field small { font-size: 10.5px; color: var(--faint); line-height: 1.45; }
input[type="text"], input[type="password"], input[type="url"], input[type="search"],
input[type="number"], input[type="datetime-local"], input[type="date"], select, textarea {
  width: 100%; padding: 10px 12px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--bg-soft); color: var(--text);
  font-size: 13px; outline: none;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}
input::placeholder, textarea::placeholder { color: var(--faint); }
input:focus, select:focus, textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); background: var(--surface); }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%), linear-gradient(135deg, var(--muted) 50%, transparent 50%); background-position: calc(100% - 16px) 55%, calc(100% - 11px) 55%; background-size: 5px 5px, 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
textarea { resize: vertical; min-height: 130px; line-height: 1.6; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-grid .full { grid-column: 1 / -1; }
.form-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.check { display: inline-flex; align-items: center; gap: 9px; padding: 7px 0; font-size: 12.5px; cursor: pointer; }
.check input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--accent); }
.check small { color: var(--faint); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 10px 0; border-top: 1px solid var(--border); }
.switch-row:first-child { border-top: 0; }
.switch-label strong { display: block; font-size: 12.5px; font-weight: 550; }
.switch-label small { font-size: 10.5px; color: var(--faint); }
.hint { font-size: 10.5px; color: var(--faint); margin-top: 4px; }

/* Badges, alerts, chips */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 8px; border-radius: 99px; border: 1px solid var(--border);
  background: var(--surface-2); color: var(--muted);
  font-size: 10px; font-weight: 600; white-space: nowrap;
}
.badge .dot { width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.badge.success, .state-running { color: var(--success); background: var(--success-soft); border-color: rgba(61, 220, 151, 0.22); }
.badge.warning, .state-restarting, .state-paused { color: var(--warning); background: var(--warning-soft); border-color: rgba(247, 185, 85, 0.24); }
.badge.danger, .state-exited, .state-dead { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 107, 129, 0.22); }
.badge.info, .state-created { color: var(--info); background: var(--info-soft); border-color: rgba(86, 184, 255, 0.22); }
.badge.violet { color: var(--violet); background: rgba(177, 140, 255, 0.12); border-color: rgba(177, 140, 255, 0.24); }
.priority-urgent { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 107, 129, 0.25); }
.priority-high { color: var(--warning); background: var(--warning-soft); border-color: rgba(247, 185, 85, 0.24); }
.priority-normal { color: var(--info); background: var(--info-soft); border-color: rgba(86, 184, 255, 0.22); }
.priority-low { color: var(--muted); }
.tag { display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 6px; background: var(--surface-2); border: 1px solid var(--border); font-size: 9.5px; color: var(--muted); }

.alert { display: flex; align-items: flex-start; gap: 9px; padding: 11px 13px; border-radius: 11px; border: 1px solid var(--border); background: var(--surface-2); font-size: 12px; margin-bottom: 16px; }
.alert .icon { width: 16px; height: 16px; margin-top: 1px; }
.alert.danger { color: var(--danger); background: var(--danger-soft); border-color: rgba(255, 107, 129, 0.25); }
.alert.warning { color: var(--warning); background: var(--warning-soft); border-color: rgba(247, 185, 85, 0.25); }
.alert.success { color: var(--success); background: var(--success-soft); border-color: rgba(61, 220, 151, 0.25); }
.alert.info { color: var(--info); background: var(--info-soft); border-color: rgba(86, 184, 255, 0.25); }

/* Tables */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 13px; background: var(--surface-soft); }
table.data { width: 100%; border-collapse: collapse; font-size: 12px; min-width: 660px; }
.data th {
  padding: 10px 13px; text-align: left; white-space: nowrap;
  font-size: 9.5px; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--faint); background: var(--surface-2); border-bottom: 1px solid var(--border);
}
.data td { padding: 11px 13px; border-bottom: 1px solid var(--border); vertical-align: middle; }
.data tbody tr:last-child td { border-bottom: 0; }
.data tbody tr:hover { background: rgba(114, 144, 255, 0.035); }
.data .name-cell { display: flex; align-items: center; gap: 8px; font-weight: 550; }
.data .sub { display: block; font-size: 9.5px; color: var(--faint); font-weight: 400; margin-top: 1px; }
.data .num { font-variant-numeric: tabular-nums; }
.data .actions { text-align: right; white-space: nowrap; }
.state-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--faint); flex: 0 0 auto; }
.state-dot.running { background: var(--success); box-shadow: 0 0 0 3px var(--success-soft); }
.state-dot.exited, .state-dot.dead { background: var(--danger); box-shadow: 0 0 0 3px var(--danger-soft); }
.state-dot.restarting { background: var(--warning); box-shadow: 0 0 0 3px var(--warning-soft); }

/* Notes */
.note-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(255px, 1fr)); gap: 16px; }
.note-card { display: flex; flex-direction: column; min-height: 170px; padding: 17px 18px; transition: transform 0.16s ease, border-color 0.16s ease; }
.note-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.note-card .note-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.note-card h3 { font-size: 13.5px; font-weight: 600; line-height: 1.35; }
.note-card .excerpt { font-size: 11.5px; color: var(--muted); line-height: 1.55; flex: 1; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.note-card .note-foot { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 12px; }
.note-card .note-actions { display: flex; gap: 2px; }
.star-btn { border: 0; background: transparent; color: var(--faint); padding: 2px; display: grid; place-items: center; border-radius: 6px; }
.star-btn:hover { color: var(--warning); background: var(--surface-2); }
.star-btn.active { color: var(--warning); }
.star-btn.active .icon { fill: var(--warning); }
.star-btn .icon { width: 16px; height: 16px; }

/* Tasks / kanban */
.task-row { display: flex; align-items: flex-start; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--border); }
.task-row:first-child { border-top: 0; }
.task-row .task-main { flex: 1; min-width: 0; }
.task-row .task-name { font-size: 13px; font-weight: 550; }
.task-row.done .task-name { text-decoration: line-through; color: var(--faint); }
.task-row .task-desc { font-size: 11px; color: var(--muted); margin-top: 3px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.task-row .task-tags { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.task-row .task-actions { display: flex; align-items: center; gap: 3px; }
.kanban { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; align-items: start; }
.kanban-col { background: var(--surface-soft); border: 1px solid var(--border); border-radius: 15px; padding: 12px; }
.kanban-col-head { display: flex; align-items: center; justify-content: space-between; padding: 2px 4px 10px; font-size: 11.5px; font-weight: 650; }
.kanban-count { font-size: 10px; color: var(--faint); background: var(--surface-2); border-radius: 99px; padding: 1px 7px; }
.kanban-card { background: var(--surface); border: 1px solid var(--border); border-radius: 11px; padding: 11px 12px; margin-bottom: 8px; }
.kanban-card h4 { font-size: 12px; font-weight: 550; line-height: 1.4; margin-bottom: 6px; }
.kanban-card .row { gap: 6px; }
.kanban-card .task-actions { margin-top: 8px; padding-top: 8px; border-top: 1px solid var(--border); justify-content: space-between; }

/* RSS / bookmarks */
.rss-item { display: flex; gap: 12px; padding: 14px 16px; border-top: 1px solid var(--border); }
.rss-item:first-child { border-top: 0; }
.rss-item.unread { background: rgba(114, 144, 255, 0.035); }
.rss-item .rss-main { flex: 1; min-width: 0; }
.rss-item .rss-title { font-size: 13px; font-weight: 550; line-height: 1.4; }
.rss-item .rss-title:hover { color: var(--accent); }
.rss-item.read .rss-title { color: var(--muted); font-weight: 450; }
.rss-item .rss-summary { font-size: 11.5px; color: var(--muted); margin-top: 4px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rss-item .rss-meta { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-top: 7px; font-size: 9.8px; color: var(--faint); }
.rss-item .rss-actions { display: flex; align-items: flex-start; gap: 2px; }
.source-list { display: flex; flex-direction: column; gap: 8px; }
.source-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 11px; background: var(--surface-2); }
.source-item .name { font-size: 12px; font-weight: 550; }
.source-item .meta { font-size: 9.5px; color: var(--faint); }
.source-item .error { color: var(--danger); }
.source-item .spacer { flex: 1; }

.bookmark-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.bookmark-card { padding: 15px 16px; display: flex; flex-direction: column; gap: 8px; transition: transform 0.16s ease, border-color 0.16s ease; }
.bookmark-card:hover { transform: translateY(-2px); border-color: var(--border-strong); }
.bookmark-head { display: flex; align-items: center; gap: 10px; }
.bookmark-ico { width: 34px; height: 34px; border-radius: 9px; background: var(--surface-2); object-fit: cover; flex: 0 0 auto; border: 1px solid var(--border); }
.bookmark-head .title { font-size: 12.5px; font-weight: 600; line-height: 1.3; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.bookmark-card .desc { font-size: 11px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.bookmark-card .url { font-size: 9.5px; color: var(--faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bookmark-card .foot { display: flex; align-items: center; gap: 6px; margin-top: auto; }

/* Notifications */
.notif-list { display: flex; flex-direction: column; }
.notif-item { display: flex; gap: 12px; padding: 13px 16px; border-top: 1px solid var(--border); }
.notif-item:first-child { border-top: 0; }
.notif-item.unread { background: rgba(114, 144, 255, 0.04); }
.notif-kind { width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center; flex: 0 0 auto; background: var(--surface-2); color: var(--accent); }
.notif-kind.kind-docker { color: var(--info); background: var(--info-soft); }
.notif-kind.kind-system { color: var(--warning); background: var(--warning-soft); }
.notif-kind.kind-task { color: var(--success); background: var(--success-soft); }
.notif-kind.kind-rss { color: var(--violet); background: rgba(177, 140, 255, 0.12); }
.notif-kind .icon { width: 16px; height: 16px; }
.notif-main { flex: 1; min-width: 0; }
.notif-main .title { font-size: 12.5px; font-weight: 600; }
.notif-main .message { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.notif-main .meta { font-size: 9.5px; color: var(--faint); margin-top: 5px; display: flex; gap: 8px; align-items: center; }
.notif-actions { display: flex; gap: 2px; }

/* Webhooks / settings */
.token-box { display: flex; align-items: center; gap: 8px; background: var(--bg-soft); border: 1px solid var(--border); border-radius: 9px; padding: 8px 10px; font-family: var(--mono); font-size: 10.5px; overflow: hidden; }
.token-box span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; }
.log-box { background: #05070c; color: #c8d4e8; border: 1px solid var(--border); border-radius: 12px; padding: 14px; font-family: var(--mono); font-size: 11px; line-height: 1.55; max-height: 460px; overflow: auto; white-space: pre-wrap; word-break: break-word; }
[data-theme="light"] .log-box { background: #101522; }
.json-box { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 11px; padding: 13px; font-family: var(--mono); font-size: 11px; line-height: 1.55; max-height: 420px; overflow: auto; white-space: pre-wrap; word-break: break-word; }

.settings-grid { display: grid; grid-template-columns: 1.25fr 0.75fr; gap: 18px; align-items: start; }
.widget-order-list { display: flex; flex-direction: column; gap: 7px; }
.widget-order-row { display: flex; align-items: center; gap: 9px; padding: 9px 11px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface-2); }
.widget-order-row .drag { color: var(--faint); cursor: grab; }
.widget-order-row .name { flex: 1; font-size: 12px; }

/* Charts */
.chart-card { padding: 16px 18px 10px; }
.chart-card .chart-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 10px; }
.chart-card h3 { font-size: 12.5px; font-weight: 600; }
.chart-card h3 small { display: block; font-size: 9.5px; color: var(--faint); font-weight: 400; margin-top: 2px; }
.chart-wrap { position: relative; height: 240px; }
.chart-wrap.short { height: 190px; }
.chart-legend { display: flex; gap: 12px; font-size: 9.5px; color: var(--muted); }
.chart-legend i { display: inline-block; width: 7px; height: 7px; border-radius: 2px; margin-right: 4px; }

/* Empty state and errors */
.empty { padding: 34px 20px; text-align: center; }
.empty-icon { width: 42px; height: 42px; border-radius: 12px; background: var(--surface-2); border: 1px solid var(--border); color: var(--faint); display: grid; place-items: center; margin: 0 auto 10px; }
.empty-icon .icon { width: 19px; height: 19px; }
.empty-title { font-size: 12.5px; font-weight: 550; color: var(--muted); margin: 0; }
.empty-text { font-size: 10.5px; color: var(--faint); margin: 4px 0 0; }
.error-page { padding: 48px 24px; text-align: center; }
.error-code { display: block; font-size: 64px; font-weight: 800; letter-spacing: -0.05em; background: linear-gradient(135deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.error-page h2 { font-size: 18px; margin: 4px 0 8px; }
.error-page p { color: var(--muted); font-size: 12.5px; margin-bottom: 20px; }

/* Auth */
.auth-page { background: var(--bg); overflow-x: hidden; }
.auth-shell { position: relative; z-index: 1; display: grid; grid-template-columns: 1.12fr 0.88fr; min-height: 100vh; }
.auth-brand {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; padding: 34px 44px;
  background:
    radial-gradient(700px 500px at 15% 10%, rgba(114, 144, 255, 0.2), transparent 55%),
    radial-gradient(600px 500px at 90% 90%, rgba(61, 219, 192, 0.13), transparent 55%),
    linear-gradient(140deg, #0b1120, #070b13 70%);
  border-right: 1px solid var(--border);
}
.auth-brand::before {
  content: ""; position: absolute; inset: 0; opacity: 0.4;
  background-image: linear-gradient(rgba(148, 163, 184, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.055) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: radial-gradient(700px 500px at 30% 20%, #000, transparent 80%);
}
.auth-brand > * { position: relative; z-index: 1; }
.auth-brand .brand { padding-left: 0; }
[data-theme="light"] .auth-brand { background: radial-gradient(700px 500px at 15% 10%, rgba(79, 109, 245, 0.13), transparent 55%), radial-gradient(600px 500px at 90% 90%, rgba(15, 185, 160, 0.12), transparent 55%), linear-gradient(140deg, #ffffff, #eef2fa 70%); }
.auth-hero { margin: auto 0; max-width: 520px; }
.auth-hero h1 { font-size: clamp(30px, 3.7vw, 46px); line-height: 1.08; letter-spacing: -0.045em; margin: 14px 0 16px; color: var(--text-strong); }
.auth-lead { font-size: 13.5px; line-height: 1.7; color: var(--muted); max-width: 460px; }
.auth-points { list-style: none; margin: 26px 0 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.auth-points li { display: flex; align-items: center; gap: 9px; font-size: 11.5px; color: var(--muted); }
.auth-points .icon { width: 15px; height: 15px; color: var(--accent-2); }
.auth-foot { font-size: 10px; color: var(--faint); letter-spacing: 0.05em; }
.auth-form-side { display: grid; place-items: center; padding: 40px 24px; position: relative; }
.auth-theme { position: absolute; top: 22px; right: 22px; }
.auth-card { width: 100%; max-width: 390px; }
.auth-card h2 { font-size: 25px; letter-spacing: -0.03em; margin: 6px 0 8px; color: var(--text-strong); }
.auth-sub { font-size: 12px; color: var(--muted); margin-bottom: 24px; line-height: 1.6; }
.auth-meta { margin-top: 18px; font-size: 10px; color: var(--faint); display: flex; align-items: center; gap: 6px; line-height: 1.5; }
.auth-meta .icon { width: 13px; height: 13px; }
.auth-card .alert { font-size: 11.5px; }

/* Prose (markdown) */
.prose { font-size: 13px; line-height: 1.72; color: var(--text); word-wrap: break-word; }
.prose h1, .prose h2, .prose h3, .prose h4 { margin: 1.2em 0 0.5em; line-height: 1.3; }
.prose h1 { font-size: 22px; }
.prose h2 { font-size: 18px; }
.prose h3 { font-size: 15.5px; }
.prose p { margin: 0 0 0.85em; }
.prose ul, .prose ol { margin: 0 0 0.9em; padding-left: 1.3em; }
.prose li { margin-bottom: 0.25em; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }
.prose blockquote { margin: 0 0 0.9em; padding: 8px 14px; border-left: 3px solid var(--accent); background: var(--surface-2); border-radius: 0 8px 8px 0; color: var(--muted); }
.prose code { background: var(--surface-2); border: 1px solid var(--border); border-radius: 5px; padding: 1px 5px; font-family: var(--mono); font-size: 0.9em; }
.prose pre { background: var(--bg-soft); border: 1px solid var(--border); border-radius: 10px; padding: 12px 14px; overflow-x: auto; margin: 0 0 1em; }
.prose pre code { background: none; border: 0; padding: 0; }
.prose hr { margin: 1.3em 0; }
.prose img { border-radius: 10px; }

/* Toasts */
.toast-stack { position: fixed; right: 18px; bottom: 18px; z-index: 200; display: flex; flex-direction: column; gap: 8px; max-width: min(380px, calc(100vw - 36px)); }
.toast {
  display: flex; align-items: flex-start; gap: 9px; padding: 12px 15px;
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; box-shadow: var(--shadow); font-size: 12px;
  animation: toastIn 0.22s ease;
}
.toast .icon { width: 16px; height: 16px; margin-top: 1px; }
.toast.success .icon { color: var(--success); }
.toast.error .icon { color: var(--danger); }
.toast.leaving { animation: toastOut 0.2s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(6px); } }

.dialog {
  width: min(560px, calc(100vw - 32px)); padding: 0; border: 1px solid var(--border-strong);
  border-radius: 16px; background: var(--surface); color: var(--text); box-shadow: var(--shadow);
}
.dialog::backdrop { background: rgba(3, 6, 12, 0.65); backdrop-filter: blur(3px); }
.dialog-head { display: flex; align-items: center; justify-content: space-between; padding: 16px 18px; border-bottom: 1px solid var(--border); }
.dialog-body { padding: 18px; }

.htmx-request .btn, .htmx-request.btn { opacity: 0.65; pointer-events: none; }
.htmx-indicator { display: none; }
.htmx-request .htmx-indicator, .htmx-request.htmx-indicator { display: inline-flex; }

/* Utility and module refinements */
.icon-flip { transform: rotate(180deg); }
.count { font-size: 10px; color: var(--faint); font-weight: 500; }
.kv { display: grid; grid-template-columns: auto 1fr; gap: 7px 14px; margin: 0; font-size: 11.5px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; color: var(--text); text-align: right; }
.code-block {
  background: var(--bg-soft); border: 1px solid var(--border); border-radius: 11px;
  padding: 12px 13px; margin: 0 0 12px; font-family: var(--mono); font-size: 11px;
  line-height: 1.55; white-space: pre-wrap; word-break: break-word; overflow-x: auto;
  color: var(--text);
}
.label-sm {
  display: block; margin: 10px 0 5px; text-transform: uppercase;
  letter-spacing: 0.08em; font-size: 9px; font-weight: 700; color: var(--faint);
}
.mono-faint { color: var(--faint); display: inline-flex; }
details.card > summary { list-style: none; }
details.card > summary::-webkit-details-marker { display: none; }
details.card > summary:hover .card-title { color: var(--accent); }
.event-item { border-top: 1px solid var(--border); }
.event-item:first-child { border-top: 0; }
.event-item > summary { display: flex; align-items: center; gap: 8px; padding: 11px 16px; cursor: pointer; list-style: none; flex-wrap: wrap; }
.event-item > summary::-webkit-details-marker { display: none; }
.event-item > summary:hover { background: var(--surface-2); }
.event-item[open] > summary { background: var(--surface-2); }
.event-item[open] .mono-faint .icon { transform: rotate(180deg); }
.event-body { padding: 2px 16px 16px; }
.event-body .row { margin-bottom: 2px; }
.source-list + form { margin-top: 12px; }
.notif-main .title a:hover { color: var(--accent); }
.note-card .note-foot .faint { margin-left: auto; }

/* Responsive */
@media (max-width: 1280px) {
  .widget, .widget-notifications, .widget-bookmarks { grid-column: span 6; }
  .widget-system, .widget-docker, .widget-internet { grid-column: span 4; }
  .grid.four { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 1100px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.24s ease; box-shadow: none; }
  .nav-open .sidebar { transform: none; box-shadow: 30px 0 80px rgba(0, 0, 0, 0.45); }
  .nav-open .sidebar-scrim { display: block; position: fixed; inset: 0; z-index: 45; background: rgba(2, 5, 10, 0.6); backdrop-filter: blur(2px); }
  .main { margin-left: 0; }
  .nav-toggle { display: grid; }
  .clock { display: none; }
  .settings-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-form-side { min-height: 100vh; }
  .auth-form-side::before {
    content: ""; position: absolute; inset: 0; z-index: -1;
    background: radial-gradient(600px 400px at 50% -10%, rgba(114, 144, 255, 0.16), transparent 65%);
  }
  .widget-system, .widget-docker, .widget-internet { grid-column: span 12; }
  .grid.three { grid-template-columns: 1fr; }
  .kanban { grid-template-columns: 1fr; }
}
@media (max-width: 760px) {
  .content { padding: 18px 14px 54px; }
  .topbar { padding: 0 14px; height: 62px; }
  .topbar-title h1 { font-size: 15px; }
  .widget, .widget-notifications, .widget-bookmarks { grid-column: span 12; }
  .welcome { grid-template-columns: 1fr; padding: 21px 20px; }
  .quick-actions { grid-template-columns: repeat(2, 1fr); }
  .grid.two, .grid.four, .form-grid { grid-template-columns: 1fr; }
  .rings { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .quick-links { grid-template-columns: repeat(3, 1fr); }
  .tabs { overflow-x: auto; max-width: 100%; }
  .page-toolbar h2 { font-size: 16px; }
  .filters .search { min-width: 100%; }
  .popover-panel { position: fixed; right: 12px; left: 12px; top: 68px; width: auto; }
  .auth-form-side { padding: 60px 20px 30px; }
  .auth-card h2 { font-size: 22px; }
  .note-grid, .bookmark-grid { grid-template-columns: 1fr; }
  .toast-stack { right: 12px; left: 12px; bottom: 12px; max-width: none; }
  .chart-wrap { height: 210px; }
}
@media (max-width: 480px) {
  .quick-actions { grid-template-columns: 1fr; }
  .quick-links { grid-template-columns: repeat(2, 1fr); }
  .welcome-meta { gap: 6px; }
  .chip { font-size: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
}
