:root {
  --bg: #0b1020;
  --panel: #121a2f;
  --panel-2: #0f172a;
  --border: rgba(255,255,255,0.08);
  --text: #f8fafc;
  --muted: #94a3b8;
  --accent: #f5bf23;
  --danger: #ef4444;
  --success: #22c55e;
  --input: #0a1224;
  --shadow: 0 18px 60px rgba(0,0,0,.35);
  --radius: 18px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  font-family: Tahoma, Arial, sans-serif;
  background:
    radial-gradient(circle at top right, rgba(245,191,35,.12), transparent 25%),
    linear-gradient(180deg, #050814 0%, #0b1020 100%);
  color: var(--text);
  min-height: 100vh;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.card {
  width: 100%;
  max-width: 1180px;
  background: rgba(18,26,47,.9);
  border: 1px solid var(--border);
  border-radius: 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.login-layout {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  min-height: 720px;
}

.hero {
  background:
    linear-gradient(145deg, rgba(245,191,35,.12), rgba(255,255,255,0) 35%),
    linear-gradient(180deg, #111827, #0f172a);
  padding: 42px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-left: 1px solid var(--border);
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(245,191,35,.1);
  color: var(--accent);
  border: 1px solid rgba(245,191,35,.22);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 13px;
  width: fit-content;
}

.hero h1 {
  font-size: 42px;
  line-height: 1.2;
  margin: 18px 0 14px;
}

.hero p,
.panel-subtitle,
.intro-text,
.note,
.flash,
.head-sub,
.error-cell {
  line-height: 1.8;
}

.hero p,
.panel-subtitle,
.intro-text,
.head-sub,
.muted {
  color: var(--muted);
}

.hero p { font-size: 15px; max-width: 540px; }

.hero-grid {
  margin-top: 28px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.hero-stat,
.metric {
  background: rgba(255,255,255,.03);
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 16px;
}

.hero-stat strong,
.metric strong {
  display: block;
  font-size: 28px;
  margin-bottom: 6px;
}

.hero-stat span,
.metric span {
  color: var(--muted);
  font-size: 13px;
}

.hero-footer {
  margin-top: 30px;
  padding-top: 22px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 13px;
}

.login-panel {
  padding: 42px;
  background: linear-gradient(180deg, #0c1427, #0a1121);
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-box {
  width: 100%;
  max-width: 430px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 26px;
}

.logo-mark {
  width: 48px;
  height: 48px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), #ffd86a);
  color: #111;
  font-weight: 800;
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(245,191,35,.22);
}

.logo-text h2,
.panel-title,
.section-title,
.topbar-left h3 {
  margin: 0;
}

.logo-text p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.panel-title {
  font-size: 28px;
  margin-bottom: 10px;
}

.panel-subtitle {
  margin: 0 0 28px;
  font-size: 14px;
}

.field { margin-bottom: 16px; }
.field label {
  display: block;
  margin-bottom: 8px;
  color: #d7e0ef;
  font-size: 14px;
}

.field input,
.field select,
.field textarea,
button {
  font-family: inherit;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 14px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.08);
  background: var(--input);
  color: var(--text);
  outline: none;
  transition: .2s ease;
  font-size: 14px;
}

.field textarea {
  min-height: 100px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: rgba(245,191,35,.55);
  box-shadow: 0 0 0 4px rgba(245,191,35,.09);
}

.actions,
.topbar-right,
.row-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

button {
  border: none;
  cursor: pointer;
  border-radius: 14px;
  padding: 14px 18px;
  font-size: 14px;
  font-weight: 700;
  transition: .2s ease;
}

.btn-primary {
  background: var(--accent);
  color: #111;
  min-width: 150px;
}
.btn-primary:hover { transform: translateY(-1px); }

.btn-secondary,
.mini-btn {
  background: rgba(255,255,255,.04);
  color: var(--text);
  border: 1px solid var(--border);
}

.flash {
  padding: 12px 14px;
  border-radius: 14px;
  margin-bottom: 16px;
  font-size: 13px;
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(255,255,255,.04);
}
.flash.success {
  color: #bbf7d0;
  border-color: rgba(34,197,94,.24);
  background: rgba(34,197,94,.1);
}
.flash.error {
  color: #fecaca;
  border-color: rgba(239,68,68,.24);
  background: rgba(239,68,68,.1);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 28px;
  border-bottom: 1px solid var(--border);
  background: rgba(8,14,28,.65);
  position: sticky;
  top: 0;
  backdrop-filter: blur(10px);
  z-index: 20;
}
.topbar-left p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  padding: 24px;
}

.sidebar,
.panel {
  background: rgba(15,23,42,.82);
  border: 1px solid var(--border);
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.sidebar {
  padding: 18px;
  height: fit-content;
  position: sticky;
  top: 96px;
}
.panel { padding: 18px; }
.section-title { font-size: 18px; margin-bottom: 14px; }
.cards {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 18px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.table-title { margin-bottom: 6px; }

.table-wrap {
  overflow: auto;
  border-radius: 20px;
  border: 1px solid var(--border);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 1160px;
  background: rgba(255,255,255,.02);
}

th, td {
  padding: 14px 12px;
  text-align: right;
  border-bottom: 1px solid rgba(255,255,255,.06);
  vertical-align: top;
  font-size: 13px;
}

th {
  color: #dbe7ff;
  background: #0d162a;
  position: sticky;
  top: 0;
  z-index: 1;
}

td code {
  direction: ltr;
  display: inline-block;
  text-align: left;
  color: #c7d8f9;
  background: rgba(255,255,255,.04);
  padding: 4px 8px;
  border-radius: 10px;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 82px;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
}
.status-ok {
  color: #bbf7d0;
  background: rgba(34,197,94,.12);
  border-color: rgba(34,197,94,.18);
}
.status-fail {
  color: #fecaca;
  background: rgba(239,68,68,.12);
  border-color: rgba(239,68,68,.18);
}
.status-idle {
  color: #fde68a;
  background: rgba(245,191,35,.12);
  border-color: rgba(245,191,35,.18);
}

.mini-btn {
  padding: 9px 12px;
  border-radius: 12px;
  font-size: 12px;
}
.mini-btn.delete {
  color: #fecaca;
  border-color: rgba(239,68,68,.2);
  background: rgba(239,68,68,.08);
}

.note {
  margin-top: 14px;
  padding: 14px 16px;
  border-radius: 16px;
  background: rgba(245,191,35,.08);
  border: 1px solid rgba(245,191,35,.14);
  color: #fde68a;
  font-size: 13px;
}

.empty-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
  line-height: 1.9;
  border: 1px dashed rgba(255,255,255,.1);
  border-radius: 18px;
}

.error-cell {
  max-width: 320px;
  word-break: break-word;
  color: #fca5a5;
}

@media (max-width: 1100px) {
  .login-layout,
  .layout {
    grid-template-columns: 1fr;
  }
  .hero { border-left: 0; border-bottom: 1px solid var(--border); }
  .sidebar { position: static; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 700px) {
  .app-shell,
  .layout,
  .topbar,
  .hero,
  .login-panel { padding: 16px; }
  .card { border-radius: 20px; }
  .hero h1 { font-size: 30px; }
  .cards { grid-template-columns: 1fr; }
  .actions,
  .topbar-right,
  .row-actions { flex-direction: column; }
  .btn-primary,
  .btn-secondary,
  .mini-btn { width: 100%; }
}
