:root {
  --indigo: #4F46E5;
  --indigo-dark: #4338CA;
  --indigo-light: #EEF2FF;
  --green: #16A34A;
  --purple: #7C3AED;
  --orange: #EA580C;
  --red: #DC2626;
  --bg: #F5F6FA;
  --card: #FFFFFF;
  --border: #E5E7EB;
  --text: #111827;
  --text-dim: #6B7280;
  --text-faint: #9CA3AF;
  --radius: 12px;
  --shadow: 0 1px 2px rgba(16,24,40,0.05), 0 1px 3px rgba(16,24,40,0.04);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: 260px;
  flex-shrink: 0;
  background: var(--card);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 4px 8px 20px; }
.brand-crest { width: 32px; height: 32px; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-name { font-weight: 700; font-size: 14px; letter-spacing: 0.02em; }
.brand-sub { font-size: 11px; color: var(--text-dim); }

.nav { display: flex; flex-direction: column; gap: 2px; }

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--text-dim);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: background 0.15s, color 0.15s;
}
.nav-item svg { width: 20px; height: 20px; flex-shrink: 0; }
.nav-item span { display: flex; flex-direction: column; line-height: 1.3; }
.nav-item small { font-size: 11px; font-weight: 400; color: var(--text-faint); }
.nav-item:hover { background: var(--indigo-light); color: var(--indigo); }
.nav-item.active { background: var(--indigo-light); color: var(--indigo); font-weight: 600; }

.help-box {
  margin-top: auto;
  background: var(--indigo-light);
  border-radius: var(--radius);
  padding: 16px;
  font-size: 13px;
}
.help-box strong { display: block; margin-bottom: 4px; font-size: 14px; }
.help-box p { margin: 0 0 12px; color: var(--text-dim); }
.help-hours { display: flex; flex-direction: column; gap: 2px; margin-bottom: 14px; color: var(--text-dim); font-size: 12px; }

/* MAIN */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

.topbar {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 28px;
  background: var(--card);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 10;
}
.topbar h1 { font-size: 18px; margin: 0; white-space: nowrap; }

.icon-btn {
  background: none; border: none; cursor: pointer; color: var(--text-dim);
  width: 36px; height: 36px; display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
}
.icon-btn:hover { background: var(--bg); }
.icon-btn svg { width: 20px; height: 20px; }

.search {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 8px 12px;
  max-width: 420px;
  margin-left: 8px;
}
.search svg { width: 18px; height: 18px; color: var(--text-faint); flex-shrink: 0; }
.search input { border: none; background: none; outline: none; font-size: 14px; width: 100%; }

.badge-wrap { position: relative; }
.badge {
  position: absolute; top: 4px; right: 4px;
  background: var(--red); color: white; font-size: 10px; font-weight: 700;
  min-width: 16px; height: 16px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center; padding: 0 3px;
}

.user-chip { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 4px 6px; border-radius: 8px; }
.user-chip:hover { background: var(--bg); }
.avatar {
  width: 32px; height: 32px; border-radius: 50%; background: var(--indigo);
  color: white; display: flex; align-items: center; justify-content: center; font-weight: 600; font-size: 13px;
}
.user-text { display: flex; flex-direction: column; line-height: 1.2; font-size: 12px; white-space: nowrap; }
.user-text strong { font-size: 13px; }
.chevron { width: 16px; height: 16px; color: var(--text-faint); }

.content { padding: 24px 28px 48px; max-width: 1400px; width: 100%; margin: 0 auto; }

.banner {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  background: #FFFBEB;
  border: 1px solid #FDE68A;
  color: #92400E;
  border-radius: var(--radius);
  padding: 14px 16px;
  margin-bottom: 24px;
}
.banner svg { width: 22px; height: 22px; flex-shrink: 0; margin-top: 1px; }
.banner strong { display: block; margin-bottom: 2px; font-size: 14px; }
.banner p { margin: 0; font-size: 13px; opacity: 0.9; }
.banner-close { margin-left: auto; background: none; border: none; font-size: 18px; cursor: pointer; color: #92400E; line-height: 1; }

.welcome { margin-bottom: 20px; }
.welcome h2 { margin: 0 0 4px; font-size: 22px; }
.welcome p { margin: 0; color: var(--text-dim); font-size: 14px; }

.quick-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}
.action-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
  text-decoration: none;
  color: var(--text);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s, box-shadow 0.15s;
}
.action-card:hover { transform: translateY(-2px); box-shadow: 0 4px 12px rgba(16,24,40,0.08); }
.action-icon {
  width: 40px; height: 40px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center; margin-bottom: 12px;
}
.action-icon svg { width: 22px; height: 22px; }
.action-icon.blue { background: #EEF2FF; color: var(--indigo); }
.action-icon.green { background: #ECFDF5; color: var(--green); }
.action-icon.purple { background: #F5F3FF; color: var(--purple); }
.action-icon.orange { background: #FFF7ED; color: var(--orange); }
.action-card strong { font-size: 15px; margin-bottom: 4px; }
.action-card p { font-size: 12.5px; color: var(--text-dim); margin: 0 0 14px; flex: 1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border: none; border-radius: 8px; padding: 9px 14px; font-size: 13px; font-weight: 600;
  cursor: pointer; text-decoration: none; color: white;
}
.btn-primary { background: var(--indigo); }
.btn-primary:hover { background: var(--indigo-dark); }
.btn-green { background: var(--green); }
.btn-purple { background: var(--purple); }
.btn-orange { background: var(--orange); }
.btn-block { width: 100%; }

.grid-2 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 16px;
  margin-bottom: 16px;
}

.panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.panel-head h3 { margin: 0; font-size: 15px; }
.panel-head .dim { font-weight: 400; color: var(--text-faint); font-size: 12.5px; }
.panel-head a { font-size: 12.5px; color: var(--indigo); text-decoration: none; font-weight: 600; }
.panel-head a:hover { text-decoration: underline; }

.stat-row { display: flex; gap: 24px; margin-bottom: 16px; }
.stat { display: flex; flex-direction: column; }
.stat-value { font-size: 26px; font-weight: 700; }
.stat-value.warn { color: var(--orange); }
.stat-value.ok { color: var(--green); }
.stat-label { font-size: 12px; color: var(--text-dim); }

.service-list, .stat-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.service-list li, .stat-list li { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; }
.stat-list li b { font-weight: 600; }
.tag { font-size: 12px; font-weight: 600; padding: 3px 8px; border-radius: 20px; background: var(--bg); color: var(--text-dim); }
.tag.up { background: #ECFDF5; color: var(--green); }
.tag.down { background: #FEF2F2; color: var(--red); }

.alert-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.alert-list li { display: flex; align-items: center; gap: 8px; font-size: 13.5px; }
.alert-list li b { margin-left: auto; font-weight: 700; }
.dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.dot.red { background: var(--red); }
.dot.orange { background: var(--orange); }
.dot.green { background: var(--green); }
.dot.blue { background: #2563EB; }

.pingvin-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; }
.pingvin-col strong { display: block; font-size: 13.5px; margin-bottom: 4px; }
.dim-sm { font-size: 12px; color: var(--text-dim); margin: 0 0 10px; }
.dropzone {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  border: 1.5px dashed var(--border); border-radius: 10px; padding: 20px 10px; margin-bottom: 12px;
  cursor: pointer; color: var(--text-dim); text-align: center; font-size: 12.5px;
}
.dropzone svg { width: 22px; height: 22px; color: var(--text-faint); }
.dropzone small { color: var(--text-faint); font-size: 11px; }
.dropzone:hover { border-color: var(--indigo); background: var(--indigo-light); }

.code-row { display: flex; gap: 8px; margin-top: 6px; }
.code-row input { flex: 1; border: 1px solid var(--border); border-radius: 8px; padding: 9px 12px; font-size: 13px; }

.rustdesk-info { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }
.rustdesk-info > div { display: flex; flex-direction: column; gap: 2px; position: relative; }
.rustdesk-info span { font-size: 12px; color: var(--text-dim); }
.rustdesk-info strong { font-size: 20px; letter-spacing: 0.03em; color: var(--indigo); }
.icon-btn-sm { position: absolute; right: 0; top: 18px; background: none; border: none; cursor: pointer; font-size: 15px; color: var(--text-dim); }

@media (max-width: 900px) {
  .sidebar { position: fixed; left: -280px; z-index: 20; transition: left 0.2s; box-shadow: 0 0 0 rgba(0,0,0,0); }
  .sidebar.open { left: 0; box-shadow: 4px 0 24px rgba(0,0,0,0.15); }
  .topbar h1 { font-size: 15px; }
  .search { display: none; }
  .pingvin-grid { grid-template-columns: 1fr; }
}
