:root {
  --bg: #f4f6f8;
  --card: #ffffff;
  --text: #1f2937;
  --muted: #6b7280;
  --primary: #2563eb;
  --border: #e5e7eb;
  --danger-bg: #fee2e2;
  --danger: #991b1b;
  --success-bg: #dcfce7;
  --success: #166534;
  --info-bg: #dbeafe;
  --info: #1d4ed8;
}

* { box-sizing: border-box; }

body {
  font-family: Arial, sans-serif;
  background: var(--bg);
  margin: 0;
  color: var(--text);
}

a {
  color: var(--primary);
  text-decoration: none;
  margin-left: 12px;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.card {
  width: min(440px, calc(100% - 24px));
  margin: 40px auto;
  background: var(--card);
  padding: 24px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.login-card { margin: 0; }

h1, h2 { margin-top: 0; }

.muted { color: var(--muted); }

label {
  display: block;
  font-weight: 600;
  margin-top: 12px;
  margin-bottom: 6px;
}

input, textarea, button {
  width: 100%;
  padding: 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  font-size: 15px;
}

textarea { min-height: 110px; resize: vertical; }

button {
  background: var(--primary);
  color: white;
  border: 0;
  cursor: pointer;
  font-weight: bold;
  margin-top: 12px;
}

.alert {
  padding: 12px;
  margin-top: 15px;
  border-radius: 8px;
}

.error { background: var(--danger-bg); color: var(--danger); }
.success { background: var(--success-bg); color: var(--success); }
.info { background: var(--info-bg); color: var(--info); }

.topbar {
  background: white;
  padding: 15px 25px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.06);
}

.container { padding: 25px; }

.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  background: white;
  border-collapse: collapse;
  margin-bottom: 30px;
  border-radius: 12px;
  overflow: hidden;
}

th, td {
  padding: 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  vertical-align: top;
}

th { background: #f1f5f9; }

.inline-form {
  display: flex;
  gap: 8px;
}

.inline-form input { min-width: 180px; }
.inline-form button { width: auto; margin-top: 0; }

.badge {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 999px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 13px;
}

@media (max-width: 700px) {
  .topbar { padding: 12px; }
  .container { padding: 12px; }
  .inline-form { flex-direction: column; }
  .inline-form button { width: 100%; }
}
.report-filter select {
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  min-width: 180px;
}
/* ================= REPORTS DESKTOP FIX ================= */

.reports-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 24px;
}

.reports-card {
  width: 100%;
  max-width: none;
  margin: 0 0 28px 0;
}

.report-filter {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  align-items: end;
}

.report-filter label {
  margin-top: 0;
}

.report-filter input,
.report-filter select {
  width: 100%;
  min-width: 0;
  height: 44px;
}

.report-filter button {
  height: 44px;
  margin-top: 0;
}

.report-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 32px;
}

.stat-card {
  background: white;
  border-radius: 14px;
  padding: 18px;
  box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.stat-title {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.stat-value {
  font-size: 30px;
  font-weight: 700;
}

.danger-stat .stat-value {
  color: #dc2626;
}

.charts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
}

.chart-card {
  width: 100%;
  max-width: none;
  margin: 0;
  min-height: 420px;
}

.chart-card canvas {
  width: 100% !important;
  height: 330px !important;
}

@media (max-width: 900px) {
  .report-filter {
    grid-template-columns: 1fr;
  }

  .report-stats {
    grid-template-columns: repeat(2, 1fr);
  }

  .charts-grid {
    grid-template-columns: 1fr;
  }
}
