/* kbox-firmware-registry admin arayuzu - koyu slate endustriyel tema
   Harici CDN kullanilmaz, tum stil bu dosyadadir. */

:root {
  --bg-950: #0b1220;
  --bg-900: #0f172a; /* slate-900 */
  --bg-800: #1e293b; /* slate-800 */
  --bg-700: #334155; /* slate-700 */
  --border: #334155;
  --text-primary: #e2e8f0; /* slate-200 */
  --text-muted: #94a3b8; /* slate-400 */
  --emerald: #10b981;
  --emerald-dark: #059669;
  --red: #ef4444;
  --red-dark: #dc2626;
  --amber: #f59e0b;
  --blue: #38bdf8;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-900);
  color: var(--text-primary);
  font-family: "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
}

a {
  color: var(--blue);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

.app-shell {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---- Top bar ---- */
.topbar {
  background: var(--bg-800);
  border-bottom: 1px solid var(--border);
  padding: 0.75rem 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}
.topbar .brand {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}
.topbar .brand .accent {
  color: var(--emerald);
}
.topbar nav {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}
.topbar nav a {
  color: var(--text-muted);
  padding: 0.35rem 0.6rem;
  border-radius: 4px;
}
.topbar nav a:hover,
.topbar nav a.active {
  color: var(--text-primary);
  background: var(--bg-700);
  text-decoration: none;
}
.topbar .user-info {
  color: var(--text-muted);
  font-size: 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* ---- Layout ---- */
.content {
  flex: 1;
  padding: 1.5rem;
  max-width: 1200px;
  width: 100%;
  margin: 0 auto;
}

.page-title {
  font-size: 1.4rem;
  font-weight: 600;
  margin: 0 0 1rem 0;
  color: var(--text-primary);
}
.page-subtitle {
  color: var(--text-muted);
  margin: -0.5rem 0 1.25rem 0;
}

/* ---- Panels / cards ---- */
.panel {
  background: var(--bg-800);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1.25rem;
  margin-bottom: 1.25rem;
}
.panel-title {
  font-weight: 600;
  margin: 0 0 0.9rem 0;
  font-size: 1rem;
  color: var(--text-primary);
}

.grid {
  display: grid;
  gap: 1rem;
}
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 800px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

/* ---- Stat tiles ---- */
.stat-tile {
  background: var(--bg-900);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 1rem;
}
.stat-tile .value {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--emerald);
}
.stat-tile .label {
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

/* ---- Forms ---- */
.form-group {
  margin-bottom: 1rem;
}
.form-group label {
  display: block;
  margin-bottom: 0.3rem;
  color: var(--text-muted);
  font-size: 0.85rem;
}
input[type="text"],
input[type="password"],
input[type="search"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  background: var(--bg-900);
  border: 1px solid var(--border);
  color: var(--text-primary);
  padding: 0.55rem 0.7rem;
  border-radius: 6px;
  font-size: 0.9rem;
  font-family: inherit;
}
textarea {
  min-height: 90px;
  font-family: "SFMono-Regular", Consolas, monospace;
  resize: vertical;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--emerald);
}
input[type="file"] {
  color: var(--text-muted);
}
.help-text {
  color: var(--text-muted);
  font-size: 0.78rem;
  margin-top: 0.25rem;
}
.field-error {
  color: var(--red);
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* ---- Buttons ---- */
.btn {
  display: inline-block;
  border: 1px solid var(--border);
  background: var(--bg-700);
  color: var(--text-primary);
  padding: 0.5rem 1rem;
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.88rem;
  font-family: inherit;
}
.btn:hover {
  background: #475569;
  text-decoration: none;
}
.btn-primary {
  background: var(--emerald-dark);
  border-color: var(--emerald-dark);
  color: white;
}
.btn-primary:hover {
  background: var(--emerald);
}
.btn-danger {
  background: var(--red-dark);
  border-color: var(--red-dark);
  color: white;
}
.btn-danger:hover {
  background: var(--red);
}
.btn-sm {
  padding: 0.3rem 0.6rem;
  font-size: 0.78rem;
}
.btn-row {
  display: flex;
  gap: 0.6rem;
  flex-wrap: wrap;
}

/* ---- Tables ---- */
table {
  width: 100%;
  border-collapse: collapse;
}
th, td {
  text-align: left;
  padding: 0.55rem 0.7rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.86rem;
}
th {
  color: var(--text-muted);
  text-transform: uppercase;
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  font-weight: 600;
}
tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

/* ---- Badges ---- */
.badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-pending { background: rgba(245, 158, 11, 0.15); color: var(--amber); }
.badge-approved { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.badge-retired { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.badge-passed { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.badge-failed { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge-aborted { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.badge-admin { background: rgba(56, 189, 248, 0.15); color: var(--blue); }
.badge-tester { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.badge-active { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.badge-inactive { background: rgba(148, 163, 184, 0.15); color: var(--text-muted); }
.badge-production { background: rgba(56, 189, 248, 0.15); color: var(--blue); }
.badge-flasher { background: rgba(167, 139, 250, 0.15); color: #a78bfa; }
.badge-success { background: rgba(16, 185, 129, 0.15); color: var(--emerald); }
.badge-rejected { background: rgba(239, 68, 68, 0.15); color: var(--red); }
.badge-test { background: rgba(244, 114, 182, 0.15); color: #f472b6; }

/* ---- Alerts ---- */
.alert {
  padding: 0.75rem 1rem;
  border-radius: 6px;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  border: 1px solid transparent;
}
.alert-error {
  background: rgba(239, 68, 68, 0.1);
  border-color: rgba(239, 68, 68, 0.4);
  color: #fca5a5;
}
.alert-success {
  background: rgba(16, 185, 129, 0.1);
  border-color: rgba(16, 185, 129, 0.4);
  color: #6ee7b7;
}
.alert ul {
  margin: 0.4rem 0 0 1.1rem;
  padding: 0;
}

/* ---- Login page ---- */
.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, var(--bg-800), var(--bg-950));
}
.login-box {
  background: var(--bg-800);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  width: 100%;
  max-width: 360px;
}
.login-box .brand {
  text-align: center;
  font-weight: 700;
  font-size: 1.2rem;
  margin-bottom: 1.5rem;
}
.login-box .brand .accent { color: var(--emerald); }
.login-box .btn { width: 100%; }

/* ---- Misc ---- */
.muted { color: var(--text-muted); }
.mono { font-family: "SFMono-Regular", Consolas, monospace; }
.text-right { text-align: right; }
code {
  background: var(--bg-900);
  padding: 0.1rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85em;
}
.pagination {
  display: flex;
  gap: 0.4rem;
  margin-top: 1rem;
}
.filters {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 1.25rem;
}
.filters .form-group {
  margin-bottom: 0;
  min-width: 160px;
}
.footer-note {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.75rem;
  padding: 1rem;
}
