/* ===== Base / Reset ===== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  background: #f5f7fb;
  color: #1f2937;
  line-height: 1.4;
}

/* ===== Header & Footer ===== */
header, footer {
  background: #003366;
  color: #fff;
  text-align: center;
  padding: 12px 10px;
}
header h1 { margin: 0; font-size: 1.25rem; }
footer { font-size: .9rem; }

/* ===== Shell / Cards ===== */
main { padding: 16px; }
.container-box {
  max-width: 1120px;
  margin: 16px auto;
  background: #fff;
  border-radius: 12px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  overflow-x: auto; /* key for table responsiveness without changing PHP */
}

/* ===== Forms ===== */
form { display: grid; grid-template-columns: 1fr; gap: 10px; }
form label { font-weight: 600; }
input[type="text"],
input[type="password"],
input[type="number"],
input[type="date"],
input[type="month"],
select,
textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  background: #fff;
  font-size: 0.95rem;
}
button,
.print-button,
.excel-button {
  appearance: none;
  border: 0;
  border-radius: 8px;
  padding: 10px 14px;
  background: #003366;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
  width: fit-content;
}
button:hover,
.print-button:hover,
.excel-button:hover { background: #0052a3; }

/* Login box */
.login-box {
  max-width: 420px;
  margin: 40px auto;
  background: #fff;
  padding: 22px;
  border-radius: 12px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  text-align: center;
}
.login-box input, .login-box button { width: 100%; }

/* Dashboard buttons list */
.nav-menu {
  list-style: none; padding: 0; margin: 0;
  display: grid; gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.nav-menu a {
  display: block; text-decoration: none; text-align: center;
  padding: 12px; border-radius: 10px; font-weight: 600;
  background: #003366; color: #fff;
  box-shadow: 0 3px 8px rgba(0,0,0,.08);
}
.nav-menu a:hover { background: #0052a3; }

/* ===== Tables ===== */
table {
  border-collapse: collapse;
  width: 100%;
  min-width: 720px; /* ensures horizontal scroll on phones for wide tables */
  background: #fff;
}
th, td {
  border: 1px solid #e5e7eb;
  padding: 8px 10px;
  text-align: center;
  vertical-align: middle;
  white-space: nowrap;
}
thead th {
  background: #f3f4f6;
  font-weight: 700;
}

/* Color codes for attendance letters */
.P { color: #15803d !important; font-weight: 700; }     /* green text */
.A, .R { color: #dc2626 !important; font-weight: 700; } /* red text */
.D { color: #b45309 !important; font-weight: 700; }     /* yellow-ish (goldenrod) text */
.RD { color: #b45309 !important; font-weight: 700; }     /* yellow-ish (goldenrod) text */
.H { background: #fb923c !important; color: #111827 !important; font-weight: 700; } /* orange bg only */

/* Messages */
.success { color: #15803d; font-weight: 700; }
.error { color: #dc2626; font-weight: 700; }

/* ===== Responsive ===== */
@media (max-width: 1024px) {
  .container-box { padding: 14px; }
  table { min-width: 640px; }
}

@media (max-width: 768px) {
  header h1 { font-size: 1.1rem; }
  .container-box { border-radius: 10px; }
  table { min-width: 560px; }
  button, .print-button, .excel-button { width: 100%; }
}

@media (max-width: 480px) {
  main { padding: 10px; }
  .login-box { margin: 20px auto; }
  table { min-width: 480px; }
}

/* Print cleanup for report */
@media print {
  .report-controls, .nav-menu, a[href], button { display: none !important; }
  .container-box { box-shadow: none; padding: 0; }
}
