* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
}

.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 220px;
  background: linear-gradient(180deg, #0f172a, #1e293b);
  color: #fff;
  padding: 20px 16px;
}

.sidebar h1 {
  font-size: 22px;
  margin: 0 0 20px;
}

.nav-btn {
  width: 100%;
  margin: 6px 0;
  padding: 10px 12px;
  text-align: left;
  border: none;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  cursor: pointer;
}

.nav-btn.active,
.nav-btn:hover {
  background: #2563eb;
}

.main-content {
  flex: 1;
  padding: 24px;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.panel {
  display: none;
}

.panel.active {
  display: block;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.inline-actions,
.inline-fields {
  display: flex;
  align-items: center;
  gap: 8px;
}

.inline-fields label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}

.inline-fields input,
.inline-fields select {
  min-width: 120px;
}

button {
  border: none;
  background: #2563eb;
  color: white;
  padding: 9px 14px;
  border-radius: 8px;
  cursor: pointer;
}

button:hover {
  opacity: 0.92;
}

button.danger {
  background: #dc2626;
}

button.secondary {
  background: #64748b;
}

.stats-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 16px;
  margin-top: 16px;
}

.chart-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.chart-card h3 {
  margin-top: 0;
  font-size: 16px;
}

.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.stat-card p {
  margin: 0;
  color: #64748b;
  font-size: 13px;
}

.stat-card h3 {
  margin: 8px 0 0;
  font-size: 26px;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

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

th {
  background: #f8fafc;
}

.table-actions {
  display: flex;
  gap: 8px;
}

.table-pagination {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: #475569;
}

.pager-actions {
  display: flex;
  gap: 8px;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: flex;
  justify-content: center;
  align-items: center;
}

.modal.hidden {
  display: none;
}

.modal-content {
  width: min(640px, 95vw);
  background: #fff;
  border-radius: 12px;
  padding: 20px;
}

.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.form-grid.single-col {
  grid-template-columns: 1fr;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

input,
select,
textarea {
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 8px;
}

textarea {
  min-height: 140px;
  resize: vertical;
}

.form-actions {
  margin-top: 14px;
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.auth-card {
  max-width: 420px;
}

.hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 8px;
}
