:root {
  --primary: #0d9488;
  --primary-2: #14b8a6;
  --bg: #0b0d14;
  --sidebar: #10131c;
  --card: #161a26;
  --border: rgba(255, 255, 255, 0.07);
  --text: #eef1f8;
  --muted: #8b95ad;
  --success: #4ade80;
  --warning: #fbbf24;
  --danger: #fb7185;
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: "DM Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(ellipse 70% 50% at 10% 100%, rgba(13, 148, 136, 0.12), transparent 55%),
    radial-gradient(ellipse 50% 40% at 90% 0%, rgba(20, 184, 166, 0.06), transparent 50%),
    var(--bg);
}

a { color: inherit; text-decoration: none; }
code, pre { font-family: "JetBrains Mono", Consolas, monospace; }
.muted { color: var(--muted); }

/* ── Login ── */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.login-card {
  width: 100%;
  max-width: 420px;
  padding: 36px;
  border-radius: 20px;
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  animation: rise 0.45s ease both;
}

@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: none; }
}

.login-card .tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--primary-2);
  background: rgba(13, 148, 136, 0.14);
  padding: 5px 12px;
  border-radius: 20px;
  margin-bottom: 14px;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 800;
  font-family: "Syne", "DM Sans", sans-serif;
}

.login-card .muted {
  font-size: 14px;
  line-height: 1.6;
  margin-bottom: 24px;
}

.notice {
  margin-bottom: 16px;
  padding: 12px 16px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(74, 222, 128, 0.12);
  color: #9af0b7;
  font-weight: 600;
  font-size: 13px;
}

.notice.error {
  background: rgba(251, 113, 133, 0.12);
  color: #ffacb8;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 16px;
}

.field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
}

.field input,
.field textarea,
.field select {
  width: 100%;
  padding: 12px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #0a0c12;
  color: var(--text);
  font: inherit;
}

.field textarea {
  resize: vertical;
  min-height: 120px;
  line-height: 1.6;
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 12px;
}

.field input:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.18);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 10px;
  padding: 11px 18px;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  font-family: inherit;
  transition: opacity 0.15s, transform 0.15s;
}

.btn:hover { opacity: 0.92; transform: translateY(-1px); }
.btn.primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
}
.btn.ghost {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid var(--border);
  color: var(--text);
}
.btn.danger {
  background: rgba(251, 113, 133, 0.18);
  color: #ffacb8;
  border: 1px solid rgba(251, 113, 133, 0.3);
}
.btn.sm { padding: 7px 12px; font-size: 12px; }

.login-card .btn.primary {
  width: 100%;
  padding: 13px;
  font-size: 14px;
}

/* ── Shell ── */
.shell { display: flex; min-height: 100vh; }

.sidebar {
  width: 260px;
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
}

.sb-brand {
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sb-brand h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 800;
  font-family: "Syne", "DM Sans", sans-serif;
}

.sb-brand span {
  font-size: 11px;
  color: var(--muted);
}

.sb-metrics {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 14px;
}

.sb-metric {
  background: rgba(255, 255, 255, 0.04);
  border-radius: 10px;
  padding: 10px;
  text-align: center;
}

.sb-metric .n {
  font-size: 20px;
  font-weight: 800;
  line-height: 1;
}

.sb-metric .l {
  font-size: 9px;
  color: var(--muted);
  text-transform: uppercase;
  margin-top: 4px;
  letter-spacing: 0.04em;
}

.sb-nav {
  flex: 1;
  padding: 8px 10px;
  overflow-y: auto;
}

.sb-group {
  font-size: 10px;
  font-weight: 700;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 12px 10px 6px;
}

.sb-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 2px;
  border-left: 3px solid transparent;
  transition: background 0.15s, color 0.15s;
}

.sb-link i {
  width: 16px;
  text-align: center;
  font-size: 12px;
  opacity: 0.85;
}

.sb-link:hover,
.sb-link.active {
  background: rgba(13, 148, 136, 0.14);
  color: #fff;
}

.sb-link.active { border-left-color: var(--primary); }

.sb-link .dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-left: auto;
  flex-shrink: 0;
}

.dot-g { background: var(--success); }
.dot-y { background: var(--warning); }
.dot-r { background: var(--danger); }

.sb-foot {
  padding: 14px;
  border-top: 1px solid var(--border);
}

.sb-foot a {
  color: var(--muted);
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 8px;
}

.sb-foot a:hover { background: rgba(255, 255, 255, 0.05); color: #fff; }

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

.top {
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  background: rgba(16, 19, 28, 0.65);
  backdrop-filter: blur(8px);
}

.top h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
  font-family: "Syne", "DM Sans", sans-serif;
}

.top-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.top-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.menu-toggle { display: none; }

.content {
  padding: 24px;
  flex: 1;
  overflow-y: auto;
}

.sidebar-overlay { display: none; }

/* ── Cards / grid ── */
.svc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 14px;
}

.svc-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 18px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  transition: border-color 0.2s, transform 0.2s;
  animation: rise 0.4s ease both;
}

.svc-card:hover {
  border-color: rgba(13, 148, 136, 0.45);
  transform: translateY(-2px);
}

.svc-card .head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.svc-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(13, 148, 136, 0.14);
  color: var(--primary-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.svc-card h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.svc-card .sub {
  font-size: 11px;
  color: var(--muted);
  margin-top: 2px;
}

.status-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.st {
  font-size: 11px;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.st i { font-size: 7px; }
.st.ok { color: var(--success); }
.st.warn { color: var(--warning); }
.st.bad { color: var(--danger); }

.svc-card .foot {
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}

.card h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.card .sub {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 14px;
  line-height: 1.5;
}

.tabs {
  display: flex;
  gap: 6px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.tab {
  padding: 8px 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
}

.tab.active,
.tab:hover {
  background: rgba(13, 148, 136, 0.16);
  color: #fff;
  border-color: rgba(13, 148, 136, 0.35);
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

.summary-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}

.summary-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px 16px;
}

.metric-label {
  display: block;
  font-size: 10px;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 6px;
}

.summary-value {
  font-size: 22px;
  font-weight: 800;
  line-height: 1;
}

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 12px;
}

th, td {
  padding: 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

th {
  color: var(--muted);
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.mono {
  font-family: "JetBrains Mono", Consolas, monospace;
  font-size: 11px;
}

.truncate {
  max-width: 280px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.help {
  background: rgba(13, 148, 136, 0.08);
  border: 1px solid rgba(13, 148, 136, 0.2);
  border-radius: 10px;
  padding: 12px 14px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.7;
  margin-bottom: 14px;
}

.help strong { color: var(--primary-2); }

.product-item {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 10px;
}

.form-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.empty {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 900px) {
  .menu-toggle { display: inline-flex; }

  .sidebar {
    position: fixed;
    left: 0;
    top: 0;
    z-index: 100;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
  }

  .sidebar.open { transform: translateX(0); }

  .sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 99;
  }

  .sidebar-overlay.show { display: block; }

  .content { padding: 16px; }
}
