/* ===== Auth screen ===== */
.auth-screen {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: linear-gradient(180deg, var(--ink) 0%, var(--ink-2) 100%);
}
.auth-card { width: 100%; max-width: 380px; }
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-logo { font-size: 34px; margin-bottom: 6px; }
.auth-brand h1 { font-size: 22px; margin-bottom: 6px; }

/* ===== App shell ===== */
.app-shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 220px;
  flex-shrink: 0;
  background: var(--ink);
  color: #fff;
  display: flex;
  flex-direction: column;
  padding: 20px 14px;
  position: sticky;
  top: 0;
  height: 100vh;
}
.sidebar-brand { font-family: var(--font-display); font-weight: 700; font-size: 16px; padding: 8px 10px 22px; }
.sidebar-brand span { font-weight: 400; opacity: 0.6; }
.sidebar-nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.side-link {
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 14px;
  color: rgba(255,255,255,0.65);
  cursor: pointer;
}
.side-link.active, .side-link:hover { color: #fff; background: rgba(255,255,255,0.08); }
.sidebar-footer { display: flex; flex-direction: column; gap: 8px; padding-top: 14px; border-top: 1px solid rgba(255,255,255,0.1); }
.sidebar-footer .muted { color: rgba(255,255,255,0.55); font-size: 13px; }
.sidebar-footer .btn-outline { border-color: rgba(255,255,255,0.25); color: #fff; }
.sidebar-footer .btn-outline:hover { border-color: #fff; }

.main-content { flex: 1; padding: 28px 32px 60px; max-width: 1180px; }
.main-content h2 { font-size: 22px; margin-bottom: 18px; }
.view.hidden { display: none; }

/* ===== Stat cards ===== */
.stat-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}
.stat-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
.stat-card .stat-value { font-family: var(--font-display); font-size: 24px; font-weight: 700; }
.stat-card .stat-label { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.dash-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 900px) { .dash-grid { grid-template-columns: 1fr; } }

.cat-bar-row { margin-bottom: 12px; }
.cat-bar-label { display: flex; justify-content: space-between; font-size: 13px; margin-bottom: 4px; }
.cat-bar-track { height: 8px; background: var(--paper); border-radius: 999px; overflow: hidden; }
.cat-bar-fill { height: 100%; background: var(--amber); border-radius: 999px; }

.recent-row { display: flex; justify-content: space-between; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.recent-row:last-child { border-bottom: none; }

/* ===== Filters ===== */
.filter-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.filter-row select, .filter-row input {
  padding: 9px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  background: #fff;
}
.filter-row input { flex: 1; min-width: 200px; }

/* ===== Tables ===== */
.table-card { overflow-x: auto; }
table { min-width: 700px; }
.action-btns { display: flex; gap: 6px; flex-wrap: wrap; }

/* ===== Categories management ===== */
.categories-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.cat-manage-card { padding: 16px; }
.cat-manage-card h4 { font-size: 15px; margin-bottom: 10px; }
.cat-manage-card .field { margin-bottom: 10px; }
.cat-manage-card .field label { font-size: 11.5px; }
.cat-manage-card .field input { padding: 8px 10px; font-size: 13px; }
.cat-toggle-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; }

/* ===== Modal (shared) ===== */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(20,33,61,0.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100;
  padding: 20px;
}
.modal { width: 100%; max-width: 560px; max-height: 85vh; display: flex; flex-direction: column; }
.modal-header { display: flex; justify-content: space-between; align-items: center; padding: 16px 20px; border-bottom: 1px solid var(--border); }
.modal-body { padding: 20px; overflow-y: auto; }
.history-item { display: flex; gap: 10px; padding: 8px 0; font-size: 13.5px; }
.history-item .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); margin-top: 5px; flex-shrink: 0; }
.icon-btn { background: none; border: none; font-size: 18px; padding: 6px; border-radius: var(--radius-sm); }
.icon-btn:hover { background: var(--paper); }

@media (max-width: 800px) {
  .app-shell { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; align-items: center; overflow-x: auto; }
  .sidebar-nav { flex-direction: row; }
  .sidebar-footer { flex-direction: row; align-items: center; border-top: none; padding-top: 0; }
  .main-content { padding: 20px; }
}
