/* ==========================================================
   SDF Staff Admin Panel — stylesheet
   Colors live in :root as variables — change these 4 to
   restyle the whole app to match final branding.
   ========================================================== */

:root {
  --brand-primary: #7a1f2b;      /* deep maroon, from NGO/hospital reference */
  --brand-primary-dark: #5c1620;
  --brand-accent: #d9a441;       /* warm gold accent */
  --brand-bg: #f5f6f8;

  --text-main: #24262b;
  --text-muted: #6b7280;
  --border-color: #e5e7eb;
  --white: #ffffff;

  --success: #1a7f4f;
  --success-bg: #e6f6ee;
  --warning: #a06400;
  --warning-bg: #fff4e0;
  --danger: #b3261e;
  --danger-bg: #fdecea;
  --info: #1d4e89;
  --info-bg: #e8f0fb;

  --radius: 10px;
  --sidebar-w: 250px;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  font-family: 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  background: var(--brand-bg);
  color: var(--text-main);
  font-size: 15px;
}
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0 0 .5em; }
table { border-collapse: collapse; width: 100%; }

/* ---------- App shell ---------- */
.app-shell { display: flex; min-height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  background: linear-gradient(180deg, var(--brand-primary), var(--brand-primary-dark));
  color: var(--white);
  position: fixed;
  top: 0; left: 0; bottom: 0;
  overflow-y: auto;
  z-index: 40;
  transition: transform .25s ease;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.brand-mark {
  background: var(--brand-accent);
  color: var(--brand-primary-dark);
  font-weight: 700;
  width: 36px; height: 36px;
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
}
.brand-text { font-weight: 600; font-size: 14px; line-height: 1.25; }

.sidebar-nav { padding: 14px 10px 30px; }
.nav-group-label {
  text-transform: uppercase;
  font-size: 11px;
  letter-spacing: .06em;
  color: rgba(255,255,255,.55);
  padding: 14px 12px 6px;
}
.nav-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  color: rgba(255,255,255,.88);
  font-size: 14px;
  margin: 2px 0;
}
.nav-link:hover { background: rgba(255,255,255,.10); }
.nav-link.active { background: var(--white); color: var(--brand-primary); font-weight: 600; }
.nav-ico { width: 18px; text-align: center; }

.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 30;
}

.main-col {
  margin-left: var(--sidebar-w);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.topbar {
  background: var(--white);
  border-bottom: 1px solid var(--border-color);
  padding: 14px 24px;
  display: flex; align-items: center; gap: 16px;
  position: sticky; top: 0; z-index: 20;
}
.page-title { font-size: 19px; font-weight: 600; flex: 1; margin: 0; }
.hamburger {
  display: none;
  flex-direction: column; justify-content: center; gap: 4px;
  width: 34px; height: 34px;
  background: none; border: none; cursor: pointer;
}
.hamburger span { display: block; height: 2px; background: var(--text-main); border-radius: 2px; }

.topbar-user { display: flex; align-items: center; gap: 12px; }
.user-chip { font-size: 13px; text-align: right; line-height: 1.3; }
.user-chip small { display: block; color: var(--text-muted); font-size: 11px; }

.content { padding: 24px; max-width: 1200px; width: 100%; margin: 0 auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
  background: var(--brand-primary);
  color: var(--white);
  font-size: 14px; font-weight: 600;
  cursor: pointer;
}
.btn:hover { background: var(--brand-primary-dark); }
.btn-outline { background: transparent; border-color: var(--border-color); color: var(--text-main); }
.btn-outline:hover { background: #f0f0f2; }
.btn-sm { padding: 6px 10px; font-size: 13px; }
.btn-success { background: var(--success); }
.btn-danger { background: var(--danger); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }

/* ---------- Cards / layout helpers ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 20px;
}
.card-title { font-size: 15px; font-weight: 600; margin-bottom: 14px; }
.grid { display: grid; gap: 18px; }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }

.stat-card { text-align: left; }
.stat-value { font-size: 26px; font-weight: 700; color: var(--brand-primary); }
.stat-label { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Forms ---------- */
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.form-row .hint { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
input[type=text], input[type=email], input[type=password], input[type=tel],
input[type=date], input[type=time], input[type=number], select, textarea {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  font-family: inherit;
  background: var(--white);
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(122,31,43,.12);
}
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }

/* ---------- Tables ---------- */
.table-wrap { overflow-x: auto; }
th, td { text-align: left; padding: 11px 12px; border-bottom: 1px solid var(--border-color); font-size: 13.5px; }
th { color: var(--text-muted); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; }
tr:last-child td { border-bottom: none; }
.table-empty { text-align: center; color: var(--text-muted); padding: 30px !important; }

/* ---------- Badges ---------- */
.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-success { background: var(--success-bg); color: var(--success); }
.badge-warning { background: var(--warning-bg); color: var(--warning); }
.badge-danger  { background: var(--danger-bg);  color: var(--danger); }
.badge-info    { background: var(--info-bg);    color: var(--info); }
.badge-muted   { background: #eee; color: var(--text-muted); }

/* ---------- Alerts ---------- */
.alert { padding: 12px 16px; border-radius: 8px; margin-bottom: 16px; font-size: 14px; }
.alert-success { background: var(--success-bg); color: var(--success); }
.alert-error   { background: var(--danger-bg); color: var(--danger); }
.alert-info    { background: var(--info-bg); color: var(--info); }

/* ---------- Auth pages (login/register) ---------- */
.auth-wrap {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-dark));
  padding: 20px;
}
.auth-card {
  background: var(--white);
  border-radius: 14px;
  padding: 34px 32px;
  width: 100%; max-width: 420px;
  box-shadow: 0 20px 50px rgba(0,0,0,.25);
}
.auth-brand { text-align: center; margin-bottom: 22px; }
.auth-brand .brand-mark { margin: 0 auto 10px; }
.auth-brand h2 { font-size: 17px; }
.auth-brand p { color: var(--text-muted); font-size: 13px; margin: 2px 0 0; }
.auth-foot { text-align: center; margin-top: 16px; font-size: 13px; color: var(--text-muted); }

/* ---------- Clock widget ---------- */
.clock-widget {
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 16px;
}
.clock-time { font-size: 32px; font-weight: 700; color: var(--brand-primary); }
.clock-status { font-size: 13px; color: var(--text-muted); margin-top: 2px; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-overlay.show { display: block; }
  .main-col { margin-left: 0; }
  .hamburger { display: flex; }
  .grid-4, .grid-3 { grid-template-columns: 1fr 1fr; }
  .content { padding: 16px; }
  .topbar { padding: 12px 16px; }
  .user-chip small { display: none; }
}

@media (max-width: 480px) {
  .grid-4, .grid-3 { grid-template-columns: 1fr; }
  .auth-card { padding: 26px 20px; }
}
