:root {
  --bg: #0b1220;
  --bg-card: #151c2c;
  --bg-card-hover: #1e293b;
  --bg-input: #0f172a;
  --border: #334155;
  --accent: #818cf8;
  --accent-strong: #6366f1;
  --text: #f8fafc;
  --text-dim: #cbd5e1;
  --green: #34d399;
  --red: #f87171;
  --amber: #fbbf24;
  --blue: #38bdf8;
  --radius: 12px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }

.hidden { display: none !important; }

/* —— Login —— */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    radial-gradient(ellipse 80% 60% at 20% 0%, rgba(99, 102, 241, 0.18), transparent),
    radial-gradient(ellipse 60% 50% at 90% 100%, rgba(14, 165, 233, 0.1), transparent),
    var(--bg);
}

.login-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: var(--shadow);
}

.logo-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.logo-mark {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--accent);
  color: #0b1220;
  font-weight: 800;
  font-size: 20px;
  display: grid;
  place-items: center;
}

.logo-row h1 {
  font-size: 18px;
  font-weight: 700;
}

.logo-row p {
  font-size: 12px;
  color: var(--text-dim);
}

.field { margin-bottom: 14px; }

.field label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--blue);
  margin-bottom: 6px;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--text);
  font-size: 15px;
}

.field input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 44px;
  padding: 0 20px;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.15s, transform 0.1s;
}

.btn:active { transform: scale(0.98); }

.btn-primary {
  width: 100%;
  background: var(--accent-strong);
  color: #fff;
}

.btn-primary:hover { background: #4f46e5; }

.btn-success { background: #10b981; color: #fff; }
.btn-success:hover { background: #059669; }

.btn-danger { background: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; }

.btn-ghost {
  background: transparent;
  color: var(--text-dim);
  border: 1px solid var(--border);
}

.btn-ghost:hover { background: var(--bg-card-hover); color: var(--text); }

.btn-sm { height: 36px; font-size: 13px; padding: 0 14px; }

.login-note {
  margin-top: 16px;
  font-size: 11px;
  color: var(--text-dim);
  text-align: center;
}

/* —— App shell —— */
.app { min-height: 100vh; display: flex; flex-direction: column; }

.topbar {
  height: 58px;
  background: #0e1626;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 20px;
  position: sticky;
  top: 0;
  z-index: 10;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.topbar-left .logo-mark { width: 36px; height: 36px; font-size: 16px; }

.topbar-title { font-size: 15px; font-weight: 700; }
.topbar-sub { font-size: 11px; color: var(--text-dim); }

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid var(--border);
}

.badge-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--text-dim);
}

.badge-online { border-color: #065f46; background: #052e1f; color: var(--green); }
.badge-online .badge-dot { background: var(--green); box-shadow: 0 0 8px var(--green); }

.badge-offline { border-color: #7f1d1d; background: #3f0d0d; color: var(--red); }
.badge-offline .badge-dot { background: var(--red); }

.badge-wait { border-color: #92400e; background: #422006; color: var(--amber); }
.badge-wait .badge-dot { background: var(--amber); animation: pulse 1.5s infinite; }

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

.layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  flex: 1;
  min-height: 0;
}

@media (max-width: 768px) {
  .layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}

.sidebar {
  background: #0c1322;
  border-right: 1px solid var(--border);
  padding: 16px 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--text-dim);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 4px;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.nav-item:hover { background: var(--bg-card-hover); color: var(--text); }

.nav-item.active {
  background: rgba(99, 102, 241, 0.15);
  color: var(--accent);
  border: 1px solid rgba(129, 140, 248, 0.35);
}

.main {
  padding: 20px 24px 32px;
  overflow-y: auto;
}

.page-title {
  font-size: 22px;
  font-weight: 800;
  margin-bottom: 4px;
}

.page-desc {
  font-size: 13px;
  color: var(--text-dim);
  margin-bottom: 20px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; }
}

.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 16px;
}

.card h2 {
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2::before {
  content: "";
  width: 3px;
  height: 14px;
  background: var(--accent);
  border-radius: 2px;
}

.stat-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 16px;
}

.stat {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}

.stat-label { font-size: 11px; color: var(--text-dim); margin-bottom: 4px; }
.stat-value { font-size: 24px; font-weight: 800; }

.mode-row {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.mode-btn {
  flex: 1;
  height: 42px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: var(--bg-input);
  color: var(--blue);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
}

.mode-btn.selected {
  background: #0ea5e9;
  border-color: #0ea5e9;
  color: #fff;
}

.mode-btn.selected.guncel {
  background: #10b981;
  border-color: #10b981;
}

.action-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.progress-block { margin-top: 16px; }

.progress-meta {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  margin-bottom: 8px;
}

.progress-meta strong { color: var(--accent); }

.progress-bar {
  height: 10px;
  background: #1e293b;
  border-radius: 999px;
  overflow: hidden;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent-strong), var(--accent));
  border-radius: 999px;
  transition: width 0.4s ease;
}

.progress-eta {
  margin-top: 8px;
  font-size: 12px;
  color: var(--green);
  font-weight: 600;
}

.hint {
  font-size: 12px;
  color: var(--text-dim);
  margin-top: 10px;
  padding: 10px 12px;
  background: #1e293b;
  border-radius: 8px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th, td {
  padding: 10px 12px;
  text-align: left;
  border-bottom: 1px solid var(--border);
}

th {
  color: var(--text-dim);
  font-weight: 700;
  font-size: 11px;
  text-transform: uppercase;
}

tr:hover td { background: rgba(30, 41, 59, 0.5); }

.tag {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
}

.tag-done { background: #052e1f; color: var(--green); }
.tag-run { background: #0c2340; color: var(--blue); }
.tag-wait { background: #422006; color: var(--amber); }

.footer-bar {
  padding: 12px 24px;
  border-top: 1px solid var(--border);
  font-size: 11px;
  color: var(--text-dim);
  display: flex;
  justify-content: space-between;
}

.demo-banner {
  background: rgba(251, 191, 36, 0.12);
  border-bottom: 1px solid rgba(251, 191, 36, 0.35);
  color: var(--amber);
  text-align: center;
  padding: 8px 16px;
  font-size: 12px;
  font-weight: 600;
}
