/* Place logo.png in this folder (copy from project root if available) */

:root {
  --red:      #FF3B3B;
  --red-dark: #B71C1C;
  --bg:       #121212;
  --bg-card:  #2A2A2A;
  --bg-head:  #1A1A1A;
  --text:     #F5F5F5;
  --muted:    #888;
  --border:   #3A3A3A;
  --sidebar:  240px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  display: flex;
  min-height: 100vh;
  font-size: 14px;
}

/* ── Sidebar ─────────────────────────────────────────────────────────────── */

#sidebar {
  width: var(--sidebar);
  min-height: 100vh;
  background: var(--bg-card);
  position: fixed;
  top: 0; left: 0;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--border);
  z-index: 10;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  border-bottom: 1px solid var(--border);
}

.sidebar-logo img {
  width: 30px; height: 30px;
  border-radius: 50%;
  object-fit: cover;
}

.sidebar-logo span {
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--red);
  letter-spacing: 1px;
}

.sidebar-nav { flex: 1; padding: 8px 0; }

.sidebar-nav a {
  display: block;
  padding: 10px 20px;
  color: var(--text);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s;
}

.sidebar-nav a:hover { background: rgba(255,59,59,0.07); }

.sidebar-nav a.active {
  border-left-color: var(--red);
  background: rgba(255,59,59,0.12);
  color: #fff;
}

.sidebar-bottom {
  padding: 8px 0;
  border-top: 1px solid var(--border);
}

.sidebar-bottom a {
  display: block;
  padding: 10px 20px;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.12s;
}

.sidebar-bottom a:hover { color: var(--red); }

/* ── Main content ────────────────────────────────────────────────────────── */

.content {
  margin-left: var(--sidebar);
  flex: 1;
  padding: 32px;
  min-width: 0;
}

.page-title {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 24px;
}

/* ── Cards ───────────────────────────────────────────────────────────────── */

.cards-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.card {
  background: var(--bg-card);
  border-radius: 8px;
  padding: 20px;
  flex: 1;
  min-width: 240px;
}

.card-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 14px;
}

.card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.card-row:last-child { border-bottom: none; }
.card-row label { color: #aaa; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */

button {
  cursor: pointer;
  font-family: 'Inter', sans-serif;
  font-size: 0.82rem;
  font-weight: 500;
  border: none;
  border-radius: 6px;
  padding: 6px 13px;
  transition: background 0.12s;
}

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); }

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-ghost:hover { background: rgba(255,255,255,0.05); }

.btn-ghost:disabled { opacity: 0.4; cursor: default; }

/* ── Tables ──────────────────────────────────────────────────────────────── */

.table-wrap {
  background: var(--bg-card);
  border-radius: 8px;
  overflow-x: auto;
  margin-bottom: 12px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

thead th {
  background: var(--bg-head);
  padding: 11px 14px;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  white-space: nowrap;
}

tbody tr {
  border-top: 1px solid var(--border);
  cursor: pointer;
  transition: background 0.1s;
}

tbody tr:hover { background: rgba(255,255,255,0.04); }

tbody td {
  padding: 10px 14px;
  white-space: nowrap;
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── Badges ──────────────────────────────────────────────────────────────── */

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-red   { background: rgba(255,59,59,0.18);  color: #FF6B6B; }
.badge-green { background: rgba(46,160,67,0.18);  color: #56d364; }
.badge-gray  { background: rgba(255,255,255,0.1); color: #aaa;    }

/* ── Filters ─────────────────────────────────────────────────────────────── */

.filters {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 14px;
}

.filters input,
.filters select {
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: var(--red);
}

/* ── Pagination ──────────────────────────────────────────────────────────── */

.pagination {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
  font-size: 0.85rem;
  color: var(--muted);
}

/* ── Config form ─────────────────────────────────────────────────────────── */

.form-section { margin-bottom: 28px; }

.form-section-title {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 10px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
}

.form-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.form-row:last-child { border-bottom: none; }

.form-row label {
  min-width: 200px;
  font-size: 0.875rem;
  color: #ccc;
}

.form-row input[type="text"] {
  flex: 1;
  background: var(--bg-head);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 10px;
  font-family: 'Inter', sans-serif;
  font-size: 0.85rem;
}

.form-row input[type="text"]:focus {
  outline: none;
  border-color: var(--red);
}

.form-row input[type="checkbox"] {
  width: 15px; height: 15px;
  accent-color: var(--red);
  cursor: pointer;
}

.feedback {
  font-size: 0.78rem;
  min-width: 64px;
}
.feedback.ok  { color: #56d364; }
.feedback.err { color: #FF6B6B; }

/* ── Drawer ──────────────────────────────────────────────────────────────── */

.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.52);
  z-index: 200;
  display: flex;
  justify-content: flex-end;
}

.drawer-overlay.hidden { display: none; }

.drawer {
  width: 440px;
  max-width: 100vw;
  background: var(--bg-card);
  height: 100%;
  display: flex;
  flex-direction: column;
  border-left: 1px solid var(--border);
  animation: slideIn 0.18s ease;
}

@keyframes slideIn {
  from { transform: translateX(40px); opacity: 0; }
  to   { transform: translateX(0);    opacity: 1; }
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.drawer-header h3 { font-size: 0.95rem; font-weight: 600; }

.drawer-close {
  background: none;
  border: none;
  color: var(--muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
}
.drawer-close:hover { color: var(--text); }

.drawer-body {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.drawer-field { margin-bottom: 13px; }

.drawer-label {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin-bottom: 3px;
}

.drawer-value {
  font-size: 0.875rem;
  word-break: break-all;
}

.drawer-section {
  font-size: 0.68rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--muted);
  margin: 18px 0 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--border);
}

.drawer-log {
  font-size: 0.8rem;
  padding: 6px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
  color: #ccc;
}
.drawer-log:last-child { border-bottom: none; }

.drawer-kv {
  display: flex;
  gap: 8px;
  font-size: 0.82rem;
  padding: 4px 0;
  border-bottom: 1px solid rgba(255,255,255,0.04);
}
.drawer-kv:last-child { border-bottom: none; }
.drawer-kv-key { color: var(--muted); min-width: 120px; }

/* ── Error / loading ─────────────────────────────────────────────────────── */

.error-msg {
  background: rgba(255,59,59,0.1);
  border: 1px solid rgba(255,59,59,0.4);
  border-radius: 6px;
  padding: 12px 16px;
  color: #FF6B6B;
  font-size: 0.875rem;
  margin-bottom: 16px;
}

.loading {
  color: var(--muted);
  font-size: 0.875rem;
  padding: 24px 0;
}

/* ── Metrics ─────────────────────────────────────────────────────────────── */

.metric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 10px;
  margin: 8px 0 16px;
}

.metric-item {
  background: var(--bg-head);
  border-radius: 6px;
  padding: 12px;
}

.metric-item-label {
  font-size: 0.68rem;
  color: var(--muted);
  margin-bottom: 4px;
}

.metric-item-value {
  font-size: 1.05rem;
  font-weight: 600;
}

.cmd-list, .sanction-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 6px 0;
}

.cmd-chip {
  background: var(--bg-head);
  border-radius: 4px;
  padding: 3px 8px;
  font-size: 0.78rem;
}
