/* ─────────────────────────────────────────────────────────
   Tinc Hub — Stylesheet v2
   Dark theme, modern, responsive
───────────────────────────────────────────────────────── */

:root {
  --bg:        #f8fafc;
  --bg-alt:    #ffffff;
  --card-bg:   #ffffff;
  --surface:   #ffffff;
  --surface2:  #f1f5f9;
  --surface3:  #f8fafc;
  --border:    #e2e8f0;
  --border-color: #e2e8f0;
  --text:      #0f172a;
  --text-main: #0f172a;
  --text-muted: #64748b;
  --muted:     #64748b;
  --accent:    #2563eb;
  --accent2:   #4f46e5;
  --green:     #10b981;
  --yellow:    #f59e0b;
  --red:       #ef4444;
  --orange:    #f97316;
  --radius:    8px;
  --radius-sm: 5px;
  --shadow:    0 1px 3px rgba(0,0,0,0.04);
  --transition:all 0.15s ease;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  font-size: 13px;
  line-height: 1.4;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  background: var(--surface3);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 1px 5px;
  font-size: 0.88em;
  font-family: 'Cascadia Code', 'Fira Code', monospace;
}

/* ── Pi-hole / CasaOS Professional App Layout ───────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
  width: 100%;
  background: var(--bg);
}

/* Sidebar — Açık Kurumsal Slate Standart */
.sidebar {
  width: 220px;
  min-width: 220px;
  background: var(--surface, #ffffff);
  color: #475569;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  z-index: 300;
  border-right: 1px solid var(--border, #e2e8f0);
  user-select: none;
  transition: transform 0.25s ease;
}

.sidebar-header {
  height: 52px;
  padding: 0 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border, #e2e8f0);
  background: #ffffff;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #0f172a;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sidebar-logo:hover { text-decoration: none; color: #0284c7; }
.sidebar-logo strong { color: #0284c7; }

.sidebar-logo-icon {
  font-size: 1.25rem;
  color: #0284c7;
  display: inline-flex;
  align-items: center;
}

.sidebar-badge {
  font-size: 0.62rem;
  font-weight: 700;
  background: #f0f9ff;
  color: #0284c7;
  border: 1px solid #bae6fd;
  padding: 1px 5px;
  border-radius: 4px;
}

.sidebar-close-btn {
  display: none;
  background: transparent;
  border: none;
  color: #64748b;
  font-size: 1.3rem;
  cursor: pointer;
  padding: 0 4px;
}

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 12px 10px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.sidebar-section-title {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: #94a3b8;
  padding: 14px 10px 4px 10px;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 6px;
  color: #475569;
  font-size: 0.82rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.15s ease;
}

.sidebar-link .icon {
  font-size: 0.95rem;
  width: 22px;
  min-width: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.sidebar-app-icon {
  height: 16px;
  width: auto;
  max-width: 22px;
  object-fit: contain;
  vertical-align: middle;
  display: block;
}

.sidebar-link:hover {
  background: #f1f5f9;
  color: #0f172a;
  text-decoration: none;
}

.sidebar-link.active {
  background: #f0f9ff;
  color: #0284c7;
  font-weight: 600;
  box-shadow: inset 3px 0 0 #0284c7;
}

.sidebar-link.tincops-link {
  background: #f8fafc;
  color: #0f172a;
  border: 1px solid #e2e8f0;
  margin-top: 4px;
}
.sidebar-link.tincops-link:hover {
  background: #f1f5f9;
  color: #0284c7;
  border-color: #cbd5e1;
}

.sidebar-footer {
  height: 46px;
  padding: 0 14px;
  border-top: 1px solid var(--border, #e2e8f0);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.75rem;
  color: #64748b;
  background: #ffffff;
}

.sidebar-host-status {
  display: flex;
  align-items: center;
  gap: 6px;
  font-family: monospace;
  color: #475569;
  font-size: 0.75rem;
}

.status-dot-sm {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #0284c7;
  display: inline-block;
}

.sidebar-logout {
  color: #64748b;
  text-decoration: none;
  font-size: 0.85rem;
  padding: 2px 6px;
  border-radius: 4px;
}
.sidebar-logout:hover {
  background: #fee2e2;
  color: #dc2626;
}

/* Main Content Area */
.main-wrapper {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 52px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 200;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-toggle-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  font-size: 1.1rem;
  padding: 3px 8px;
  cursor: pointer;
}

.topbar-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-time {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.main-content {
  flex: 1;
  padding: 18px 20px;
  width: 100%;
}

.app-footer {
  padding: 10px 20px;
  border-top: 1px solid var(--border);
  font-size: 0.72rem;
  color: var(--muted);
  background: var(--surface);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* ── System Bar ─────────────────────────────────────────── */
.sysbar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 24px;
  display: flex;
  gap: 32px;
  align-items: center;
  flex-wrap: wrap;
}
.sysbar-item { display: flex; flex-direction: column; gap: 4px; min-width: 140px; }
.sysbar-label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--muted);
}
.sysbar-value { font-size: 0.9rem; font-weight: 600; }
.bar {
  height: 5px;
  background: var(--surface2);
  border-radius: 3px;
  overflow: hidden;
  width: 120px;
}
.bar-fill {
  height: 100%;
  border-radius: 3px;
  transition: width 0.5s ease;
}
.bar-green  { background: var(--green); }
.bar-yellow { background: var(--yellow); }
.bar-red    { background: var(--red); }

/* ── Section ────────────────────────────────────────────── */
.section { margin-bottom: 28px; }
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}
h2 {
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.badge {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2px 9px;
  font-size: 0.7rem;
  font-weight: 400;
  text-transform: none;
  letter-spacing: 0;
  color: var(--muted);
}

/* ── App Grid (Dikey Liste) ───────────────────────────────────────────── */
.app-grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* ── App Card (Dikey Liste için Yatay Düzen) ───────────────────────────────────────────── */
.app-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow);
  transition: var(--transition);
  cursor: pointer;
  position: relative;
  overflow: hidden;
}
.app-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 4px;
}
.app-card.healthy::before { background: var(--green); }
.app-card.dead::before    { background: var(--red); }
.app-card.unknown::before { background: var(--muted); }

.app-card:hover {
  border-color: var(--accent);
  transform: translateX(4px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.card-main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex: 1;
}

.card-icon { font-size: 1.8rem; line-height: 1; }
.card-title { display: flex; flex-direction: column; }
.card-name { font-weight: 600; font-size: 1.05rem; }
.card-desc { font-size: 0.8rem; color: var(--muted); max-width: 400px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.card-meta-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 0.75rem;
  color: var(--muted);
  min-width: 200px;
}
.card-meta-info strong { color: var(--text); font-weight: 500; }

.card-actions {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Tooltip (Buton hover) */
.btn[title]:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(-5px);
  background: #333;
  color: #fff;
  padding: 4px 8px;
  border-radius: 4px;
  font-size: 11px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
.btn { position: relative; }

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
}
.card-icon { font-size: 1.4rem; line-height: 1; }
.card-title { flex: 1; }
.card-name { font-weight: 600; font-size: 0.95rem; }
.card-cat  { font-size: 0.72rem; color: var(--muted); }

.status-badge {
  font-size: 0.68rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 10px;
  white-space: nowrap;
}
.status-badge.healthy { background: rgba(46,204,113,.15); color: var(--green); }
.status-badge.dead    { background: rgba(231,76,60,.15);  color: var(--red); }
.status-badge.unknown { background: rgba(122,122,154,.15);color: var(--muted); }

.card-meta {
  display: flex;
  gap: 12px;
  font-size: 0.75rem;
  color: var(--muted);
  flex-wrap: wrap;
}
.card-meta span { display: flex; align-items: center; gap: 3px; }

.card-actions {
  display: flex;
  gap: 6px;
  border-top: 1px solid var(--border);
  padding-top: 10px;
  flex-wrap: wrap;
}

/* Pin button (top-right corner) */
.pin-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--muted);
  padding: 2px;
  transition: var(--transition);
  z-index: 2;
}
.pin-btn:hover { color: var(--yellow); }
.pin-btn.pinned { color: var(--yellow); }

/* ── Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 11px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface2);
  color: var(--text);
  font-size: 0.78rem;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { border-color: var(--accent); color: var(--accent); text-decoration: none; }
.btn-primary   { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-primary:hover { opacity: 0.85; color: #fff; }
.btn-danger    { border-color: var(--red); color: var(--red); }
.btn-danger:hover { background: rgba(231,76,60,.1); }
.btn-success   { border-color: var(--green); color: var(--green); }
.btn-icon      { padding: 5px 8px; }
.btn-sm        { padding: 3px 8px; font-size: 0.72rem; }

/* ── Login ──────────────────────────────────────────────── */
.login-wrap {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 60px);
}
.login-box {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 40px;
  width: 360px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.login-logo {
  text-align: center;
  font-size: 1.2rem;
}
.login-logo .logo-icon { font-size: 2rem; display: block; margin-bottom: 8px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-size: 0.8rem; color: var(--muted); }
.form-group input, .form-group select, .form-group textarea {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 9px 12px;
  font-size: 0.88rem;
  width: 100%;
  transition: var(--transition);
}
.form-group input:focus, .form-group select:focus, .form-group textarea:focus {
  outline: none;
  border-color: var(--accent);
}
.error-msg {
  background: rgba(231,76,60,.12);
  border: 1px solid rgba(231,76,60,.3);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  color: var(--red);
  font-size: 0.82rem;
}

/* ── Tables ─────────────────────────────────────────────── */
.table-wrap {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.83rem;
}
th {
  background: var(--surface2);
  padding: 10px 14px;
  text-align: left;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--muted);
  border-bottom: 1px solid var(--border);
}
td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--surface2); }

/* ── Category Filters ───────────────────────────────────── */
.cat-filters {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.cat-chip {
  padding: 5px 14px;
  border-radius: 20px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.8rem;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}
.cat-chip:hover { border-color: var(--accent); color: var(--text); text-decoration: none; }
.cat-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 18px;
}
.breadcrumb a { color: var(--accent); }
.breadcrumb span { margin: 0 6px; }

/* ── App Hero ───────────────────────────────────────────── */
.app-hero {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 20px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 20px;
}
.app-hero.healthy { border-left: 4px solid var(--green); }
.app-hero.dead    { border-left: 4px solid var(--red); }
.app-hero.unknown { border-left: 4px solid var(--muted); }

.hero-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}
.hero-icon { font-size: 2rem; }
.hero-name { font-size: 1.4rem; font-weight: 700; }

.hero-meta {
  display: flex;
  gap: 16px;
  font-size: 0.78rem;
  color: var(--muted);
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.hero-actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* ── Log Terminal ───────────────────────────────────────── */
.log-terminal {
  background: #0a0a10;
  border: 1px solid #1a1a2a;
  border-radius: var(--radius);
  font-family: 'Cascadia Code', 'Fira Code', 'Courier New', monospace;
  font-size: 0.78rem;
  line-height: 1.5;
  overflow-y: auto;
  max-height: 70vh;
  padding: 12px;
}
.log-line { color: #a0f0a0; word-break: break-all; }
.log-line.error   { color: #f07070; }
.log-line.system  { color: #7070f0; font-style: italic; }
.log-line.warning { color: #f0c060; }

.log-controls {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.log-status {
  font-size: 0.75rem;
  color: var(--muted);
  margin-left: auto;
}
.indicator {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--muted);
}
.indicator.live { background: var(--green); animation: pulse 1.5s infinite; }
.indicator.error { background: var(--red); }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.3; }
}

/* ── Modal ──────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.hidden { display: none; }
.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  width: 100%;
  max-width: 560px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 40px rgba(0,0,0,0.7);
}
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.modal-title { font-size: 1rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 1.4rem;
  line-height: 1;
  padding: 0 4px;
}
.modal-close:hover { color: var(--text); }
.modal-body { display: flex; flex-direction: column; gap: 14px; }
.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ── Form Row (2 columns) ───────────────────────────────── */
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}
.form-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
}
.form-check input[type=checkbox] { width: 16px; height: 16px; cursor: pointer; }

/* ── Inline health indicator ────────────────────────────── */
.dot-live {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  margin-right: 4px;
}
.dot-live.ok  { background: var(--green); }
.dot-live.bad { background: var(--red); }
.dot-live.unk { background: var(--muted); }

/* ── Empty / Info ───────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 48px 20px;
  color: var(--muted);
  grid-column: 1/-1;
}
.empty-state .empty-icon { font-size: 3rem; margin-bottom: 12px; }

.info-box {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  font-size: 0.82rem;
  color: var(--muted);
}
.info-box.warn { border-color: var(--yellow); }

/* ── Settings ───────────────────────────────────────────── */
.settings-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.settings-section h3 {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border);
}
.danger-zone { border-color: rgba(231,76,60,.3); }
.danger-zone h3 { color: var(--red); }

/* ── Toast notification ─────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 18px;
  font-size: 0.85rem;
  box-shadow: var(--shadow);
  z-index: 9999;
  opacity: 0;
  transition: opacity 0.3s;
  pointer-events: none;
  max-width: 320px;
}
#toast.show { opacity: 1; }
#toast.ok   { border-color: var(--green); }
#toast.err  { border-color: var(--red); }

/* ── Footer ─────────────────────────────────────────────── */
footer {
  border-top: 1px solid var(--border);
  padding: 14px 24px;
  display: flex;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--muted);
}

/* ── Responsive ─────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    left: -220px;
    top: 0;
    bottom: 0;
    z-index: 1000;
    box-shadow: 4px 0 24px rgba(0,0,0,0.4);
  }
  .sidebar.open {
    transform: translateX(220px);
  }
  .sidebar-close-btn {
    display: block;
  }
  .sidebar-toggle-btn {
    display: block;
  }
  .main-content {
    padding: 14px;
  }
  .pro-metrics-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .pro-top-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .pro-strip-right {
    width: 100%;
    justify-content: flex-end;
  }
}

@media (max-width: 600px) {
  .cat-filters {
    overflow-x: auto;
    flex-wrap: nowrap;
    padding-bottom: 6px;
    -webkit-overflow-scrolling: touch;
  }
  .cat-chip {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .casa-apps-grid {
    grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
    gap: 8px;
  }

  .modal-overlay {
    padding: 10px;
  }
  .modal {
    padding: 18px 16px;
    max-height: 94vh;
  }
}

@media (max-width: 480px) {
  .pro-metrics-grid {
    grid-template-columns: 1fr;
  }
  .casa-apps-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.btn-disabled {
    opacity: 0.4;
    cursor: not-allowed;
    filter: grayscale(100%);
}

/* Notification Center */
.notification-bell {
    position: relative;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px 10px;
}
.badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #ef4444;
    color: white;
    border-radius: 50%;
    font-size: 0.7rem;
    padding: 2px 6px;
    font-weight: bold;
}
.notif-panel {
    position: absolute;
    right: 20px;
    top: 60px;
    width: 380px;
    max-height: 500px;
    overflow-y: auto;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 1000;
}

/* ─────────────────────────────────────────────────────────
   Pro Dashboard Components (Pi-hole / CasaOS Standard)
───────────────────────────────────────────────────────── */
.sidebar-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  z-index: 299;
}
.sidebar-backdrop.active { display: block; }

/* ── Pro Strip & Action Buttons ────────────────────────────── */
.pro-top-strip {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  gap: 12px;
}
.pro-strip-left {
  display: flex;
  align-items: center;
  gap: 8px;
}
.pro-host-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.76rem;
  color: var(--muted);
}
.pro-host-pill strong { color: var(--text); }
.pro-pill-sep { color: var(--border); }

.pro-strip-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-pro-subtle {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 4px 10px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}
.btn-pro-subtle:hover {
  background: var(--surface2);
  border-color: #cbd5e1;
}

.btn-pro-primary {
  background: #2563eb;
  border: 1px solid #2563eb;
  color: #fff;
  padding: 4px 12px;
  font-size: 0.78rem;
  font-weight: 600;
  border-radius: 6px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  transition: var(--transition);
}
.btn-pro-primary:hover {
  background: #1d4ed8;
  border-color: #1d4ed8;
}

/* ── Pro Compact Telemetry Strip (Pi-hole / Proxmox Style) ─── */
.pro-metrics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-bottom: 16px;
}

.pro-metric-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 9px 12px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  box-shadow: 0 1px 2px rgba(0,0,0,0.02);
  transition: var(--transition);
}
.pro-metric-card:hover {
  border-color: #cbd5e1;
}

.pro-metric-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.pro-metric-label {
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.pro-metric-val {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}
.pro-metric-val.mono {
  font-family: 'Cascadia Code', 'Fira Code', monospace;
  font-size: 0.82rem;
}

.pro-metric-track {
  height: 4px;
  background: var(--surface2);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}
.pro-metric-fill {
  height: 100%;
  width: 0%;
  border-radius: 2px;
  transition: width 0.4s ease;
}
.pro-metric-fill.cpu { background: #0284c7; }
.pro-metric-fill.ram { background: #475569; }
.pro-metric-fill.disk { background: #0284c7; }
.pro-metric-fill.net { background: #475569; }

.pro-metric-sub {
  font-size: 0.66rem;
  color: var(--muted);
  text-align: right;
  margin-top: 1px;
}

/* ── Section Headings & Badges ─────────────────────────────── */
.pro-section-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.pro-section-title {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.pro-section-count {
  font-size: 0.65rem;
  font-weight: 700;
  background: var(--surface2);
  color: var(--muted);
  padding: 1px 6px;
  border-radius: 8px;
}

/* ── Pro Compact CasaOS App Grid ───────────────────────────── */
/* ── Compact Enterprise App Grid & Row Items ───────────────── */
.compact-apps-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
  gap: 8px;
  margin-bottom: 14px;
}

.compact-app-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  transition: all 0.12s ease;
  cursor: pointer;
  user-select: none;
  min-height: 46px;
}
.compact-app-item:hover {
  background: #f8fafc;
  border-color: #cbd5e1;
  box-shadow: 0 1px 3px rgba(0,0,0,0.03);
}

.compact-app-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex: 1;
}

.compact-status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
.compact-status-dot.healthy {
  background: #0284c7;
}
.compact-status-dot.dead {
  background: #94a3b8;
}
.compact-status-dot.unknown {
  background: #cbd5e1;
}

.compact-app-icon {
  font-size: 1.25rem;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  background: var(--surface2);
  border-radius: 6px;
}

.compact-app-icon.has-svg {
  width: auto;
  min-width: 28px;
  max-width: 56px;
  height: 26px;
  padding: 2px 4px;
  background: #ffffff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 1px 2px rgba(0,0,0,0.03);
}

.compact-app-icon.has-svg img {
  height: 18px;
  width: auto;
  max-width: 50px;
  object-fit: contain;
  display: block;
}

.compact-app-details {
  display: flex;
  flex-direction: column;
  min-width: 0;
  gap: 1px;
}

.compact-app-name-row {
  display: flex;
  align-items: center;
  gap: 6px;
}

.compact-app-name {
  font-size: 0.83rem;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-app-tag {
  font-family: 'Cascadia Code', monospace;
  font-size: 0.67rem;
  color: #475569;
  background: #f1f5f9;
  padding: 0 4px;
  border-radius: 3px;
  border: 1px solid #e2e8f0;
}

.compact-app-sub {
  font-size: 0.69rem;
  color: var(--muted);
  display: flex;
  align-items: center;
  gap: 6px;
}

.compact-app-metric {
  color: var(--muted);
  font-weight: 500;
}

.compact-app-right {
  display: flex;
  align-items: center;
  gap: 5px;
  flex-shrink: 0;
}

.compact-action-btn {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 4px 9px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #334155;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.12s ease;
}
.compact-action-btn:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
  text-decoration: none;
}

.compact-menu-btn {
  background: transparent;
  border: none;
  font-size: 1rem;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  padding: 3px 6px;
  border-radius: 4px;
  line-height: 1;
}
.compact-menu-btn:hover {
  background: var(--surface2);
  color: var(--text);
}

.btn-section-add {
  margin-left: auto;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 8px;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
  transition: var(--transition);
}
.btn-section-add:hover {
  background: var(--surface2);
  color: var(--text);
  border-color: #cbd5e1;
}

.pro-autopilot-compact-bar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 7px 14px;
  margin-bottom: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.pro-autopilot-compact-info {
  display: flex;
  align-items: center;
  gap: 8px;
}
.btn-pro-xs {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 3px 8px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
}
.btn-pro-xs:hover {
  background: #e2e8f0;
}

/* Category Filter Bar (Compact Pills) */
.cat-filters {
  display: flex;
  gap: 5px;
  margin: 6px 0 12px 0;
  overflow-x: auto;
  padding-bottom: 2px;
}
.cat-chip {
  padding: 3px 9px;
  border-radius: 5px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--muted);
  font-size: 0.73rem;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  transition: var(--transition);
}
.cat-chip:hover {
  border-color: #94a3b8;
  color: var(--text);
  text-decoration: none;
}
.cat-chip.active {
  background: #0f172a;
  border-color: #0f172a;
  color: #ffffff;
}

/* CasaOS Dropdown Menu */
.casa-dropdown-menu {
  display: none;
  position: absolute;
  top: 28px;
  right: 4px;
  z-index: 100;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12);
  min-width: 160px;
  text-align: left;
  padding: 3px;
}
.casa-menu-header {
  padding: 5px 8px 3px 8px;
  font-size: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.casa-menu-item {
  display: flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 5px 8px;
  font-size: 0.76rem;
  color: var(--text);
  background: transparent;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
  text-decoration: none;
}
.casa-menu-item:hover {
  background: var(--surface2);
  color: var(--accent);
  text-decoration: none;
}
.casa-menu-item.danger { color: #ef4444; }
.casa-menu-item.danger:hover {
  background: #fee2e2;
  color: #b91c1c;
}
.casa-menu-item.disabled {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}
.casa-menu-divider {
  height: 1px;
  background: var(--border);
  margin: 3px 0;
}

