:root {
  --bg: #f3f4f6;
  --navy: #12162b;
  --navy-highlight: #17395e;
  --navy-highlight-border: #2f6fb0;
  --text-dark: #111827;
  --text-gray: #6b7280;
  --text-light-gray: #9ca3af;
  --label-gray: #8b90a8;
  --blue-link: #2563eb;
  --violet: #7c3aed;
  --green: #22c55e;
  --red-bg: #fee2e2;
  --red-text: #dc2626;
  --border-light: #e5e7eb;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(90deg, #12131f 0%, #1b1330 100%);
  padding: 16px 32px;
  color: #fff;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.brand {
  font-size: 18px;
  font-weight: 700;
}

.badge {
  background: var(--violet);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: 999px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: #cbd0e0;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 6px var(--green);
  display: inline-block;
}

.controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 24px 32px 0;
}

.controls label {
  font-size: 14px;
  color: var(--text-gray);
}

.controls select {
  font-size: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  border: 1px solid var(--border-light);
  background: #fff;
  color: var(--text-dark);
}

.mock-notice {
  font-size: 12px;
  color: #b45309;
  background: #fffbeb;
  border: 1px solid #fde68a;
  padding: 4px 10px;
  border-radius: 999px;
}

main {
  padding: 24px 32px 48px;
  max-width: 1280px;
  margin: 0 auto;
}

h1 {
  font-size: 26px;
  font-weight: 700;
  margin: 8px 0 2px;
  color: var(--text-dark);
}

.subtitle {
  margin: 0 0 20px;
  color: var(--text-gray);
  font-size: 14px;
}

.stat-cards {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.card {
  background: var(--navy);
  border-radius: 12px;
  padding: 20px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}

.card.highlight {
  background: var(--navy-highlight);
  box-shadow: 0 0 0 2px var(--navy-highlight-border) inset;
}

.card-label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--label-gray);
  margin-bottom: 10px;
}

.card-value {
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
}

.table-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 20px 24px;
}

.table-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  padding-bottom: 14px;
  margin-bottom: 4px;
  border-bottom: 1px solid var(--border-light);
}

.table-card-header .hint {
  font-weight: 400;
  font-size: 13px;
  color: var(--text-light-gray);
}

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

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

thead th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-light-gray);
  padding: 10px 8px;
  border-bottom: 1px solid var(--border-light);
}

th.num, td.num { text-align: right; }

tbody tr {
  cursor: pointer;
  border-bottom: 1px solid var(--border-light);
}

tbody tr:hover { background: #f9fafb; }

tbody td {
  padding: 12px 8px;
  color: var(--text-dark);
  font-variant-numeric: tabular-nums;
}

.client-cell {
  display: flex;
  align-items: center;
  gap: 8px;
}

.client-link {
  color: var(--blue-link);
  text-decoration: none;
  font-weight: 500;
}

.client-link:hover { text-decoration: underline; }

.saldo-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: var(--red-bg);
  color: var(--red-text);
  font-size: 12px;
  font-weight: 600;
  padding: 2px 9px;
  border-radius: 999px;
  white-space: nowrap;
}

.saldo-badge::before {
  content: "⏱";
  font-size: 11px;
}

tfoot td {
  font-weight: 700;
  padding: 12px 8px;
  border-top: 2px solid var(--text-dark);
}

.single-client-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
  padding: 24px;
  margin-bottom: 24px;
  max-width: 320px;
}

.saldo-block .card-label { color: var(--text-gray); }
.saldo-block .card-value { color: var(--text-dark); font-size: 28px; margin-bottom: 8px; }

.footer-note {
  text-align: center;
  color: var(--text-light-gray);
  font-size: 13px;
  font-style: italic;
  margin-top: 32px;
}

@media (max-width: 900px) {
  .stat-cards { grid-template-columns: repeat(2, 1fr); }
}
