* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f172a;
  color: #e2e8f0;
  font-family: Arial, sans-serif;
}

body.has-sidebar {
  display: block;
}

.card {
  width: min(92vw, 420px);
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 24px;
}

h1 {
  margin: 0 0 8px;
  font-size: 1.4rem;
}

.subtitle {
  margin: 0 0 18px;
  color: #9ca3af;
}

.error {
  background: #7f1d1d;
  border: 1px solid #991b1b;
  color: #fecaca;
  border-radius: 6px;
  padding: 10px;
}

label {
  display: block;
  margin: 12px 0 6px;
  font-size: 0.95rem;
}

input {
  width: 100%;
  padding: 10px;
  border: 1px solid #374151;
  background: #0b1220;
  color: #f3f4f6;
  border-radius: 6px;
}

button {
  margin-top: 16px;
  width: 100%;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: #2563eb;
  color: #fff;
  cursor: pointer;
}

button.secondary {
  background: #475569;
}

.button-link {
  margin-top: 10px;
  width: 100%;
  display: block;
  text-align: center;
  border: 0;
  border-radius: 6px;
  padding: 10px 14px;
  background: #2563eb;
  color: #fff;
  text-decoration: none;
}

.secondary-link {
  background: #475569;
}

.status-pill {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 10px;
  border-radius: 999px;
  background: #14532d;
  color: #bbf7d0;
  font-size: 0.85rem;
}

.admin-layout {
  width: 100%;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 220px;
  height: 100vh;
  padding: 18px;
  border-right: 1px solid #1f2937;
  background: #0b1220;
}

.sidebar-nav {
  height: calc(100vh - 52px);
  display: flex;
  flex-direction: column;
}

.nav-main {
  display: block;
}

.nav-logout {
  margin-top: auto;
}

.sidebar-title {
  font-size: 1rem;
  margin: 0 0 14px;
  color: #94a3b8;
}

.nav-link {
  width: 100%;
  display: block;
  text-align: left;
  padding: 10px 12px;
  margin-bottom: 8px;
  border-radius: 6px;
  text-decoration: none;
  color: #cbd5e1;
}

.nav-link.active {
  background: #1e3a8a;
  color: #dbeafe;
}

.nav-button {
  margin-top: 0;
  cursor: pointer;
  font: inherit;
  margin-bottom: 0;
}

.admin-content {
  margin-left: 220px;
  padding: 24px;
}

.dashboard-topbar {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
}

.date-selector-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 12px;
  padding: 10px 12px;
  min-width: 240px;
}

.date-selector-row {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
}

.date-selector-label {
  margin: 0 0 8px;
  font-size: 0.8rem;
  color: #94a3b8;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.date-nav-btn {
  display: inline-block;
  width: 32px;
  height: 32px;
  line-height: 30px;
  text-align: center;
  border: 1px solid #334155;
  border-radius: 8px;
  color: #cbd5e1;
  text-decoration: none;
  background: #0b1220;
}

.date-nav-btn.disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.selected-date {
  padding: 7px 12px;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #0b1220;
  color: #e2e8f0;
  font-weight: 600;
  min-width: 120px;
  text-align: center;
}

.kpi-grid {
  display: grid;
  grid-template-columns: minmax(320px, 560px);
  gap: 16px;
  margin-top: 8px;
}

.kpi-card {
  background: #111827;
  border: 1px solid #1f2937;
  border-radius: 10px;
  padding: 18px;
}

.kpi-label {
  margin: 0;
  color: #9ca3af;
}

.kpi-title {
  margin: 0 0 6px;
  color: #cbd5e1;
  font-size: 1rem;
  font-weight: 600;
}

.kpi-value {
  margin: 8px 0 0;
  font-size: 3rem;
  font-weight: 700;
}

.kpi-value-small {
  margin: 8px 0 0;
  font-size: 1.6rem;
  font-weight: 600;
}

.kpi-subtext {
  margin: 8px 0 0;
  color: #94a3b8;
  font-size: 0.92rem;
}

.kpi-change {
  margin: 8px 0 0;
  font-weight: 700;
  font-size: 1rem;
}

.kpi-change-up {
  color: #22c55e;
}

.kpi-change-down {
  color: #ef4444;
}

.kpi-change-flat {
  color: #94a3b8;
}

.dashboard-section-title {
  margin: 20px 0 10px;
  font-size: 1rem;
  color: #cbd5e1;
}

.dashboard-table-wrap {
  max-width: 760px;
}

.filter-form {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
}

.filter-form input {
  flex: 1;
}

.filter-form button {
  width: auto;
  margin-top: 0;
}

.table-wrap {
  overflow: auto;
  max-height: calc(100vh - 210px);
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 640px;
}

th,
td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid #1f2937;
  font-size: 0.92rem;
}

th {
  background: #0b1220;
  color: #cbd5e1;
  position: sticky;
  top: 0;
  z-index: 2;
}

.sort-link {
  color: inherit;
  text-decoration: none;
  display: inline-block;
  width: 100%;
}
