/* ── Reset & Base ───────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body { font-family: system-ui, -apple-system, sans-serif; background: #f0f4f8; color: #2d3748; line-height: 1.5; }
a { color: #2c5f8a; text-decoration: none; }
a:hover { text-decoration: underline; }

/* ── Login ──────────────────────────────────────────────────── */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; padding: 20px; }
.login-card { background: #fff; border-radius: 12px; box-shadow: 0 4px 24px rgba(0,0,0,.1); padding: 40px; width: 100%; max-width: 420px; }
.login-logo { text-align: center; margin-bottom: 28px; }
.login-logo h1 { font-size: 2rem; color: #1a3c5e; font-weight: 700; letter-spacing: .05em; }
.login-logo p  { color: #718096; font-size: .9rem; margin-top: 4px; }
.login-footer  { text-align: center; margin-top: 20px; font-size: .88rem; color: #718096; }

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

.sidebar {
  width: 240px; flex-shrink: 0;
  background: #1a3c5e; color: #cdd8e6;
  display: flex; flex-direction: column;
  position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto;
}
.sidebar-brand { padding: 24px 20px 16px; border-bottom: 1px solid rgba(255,255,255,.1); }
.sidebar-brand h2 { font-size: .95rem; color: #fff; line-height: 1.3; }
.sidebar-brand small { font-size: .75rem; color: #8aa6c0; }

.sidebar-nav { flex: 1; padding: 12px 0; }
.sidebar-nav a {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px; color: #cdd8e6; font-size: .9rem;
  transition: background .15s;
}
.sidebar-nav a:hover, .sidebar-nav a.active {
  background: rgba(255,255,255,.1); color: #fff; text-decoration: none;
}
.sidebar-nav .nav-section {
  padding: 12px 20px 4px; font-size: .7rem; text-transform: uppercase;
  letter-spacing: .08em; color: #5d8aad; cursor: default;
}

.sidebar-footer { padding: 16px 20px; border-top: 1px solid rgba(255,255,255,.1); }
.sidebar-footer a { font-size: .85rem; color: #8aa6c0; }

.main-content { margin-left: 240px; flex: 1; display: flex; flex-direction: column; min-height: 100vh; }

.topbar {
  background: #fff; border-bottom: 1px solid #e2e8f0;
  padding: 14px 28px; display: flex; align-items: center;
  justify-content: space-between; position: sticky; top: 0; z-index: 10;
}
.topbar h1 { font-size: 1.1rem; font-weight: 600; color: #1a3c5e; }
.topbar-user { font-size: .88rem; color: #718096; }

.page-body { padding: 28px; flex: 1; }

/* ── Cards ──────────────────────────────────────────────────── */
.card { background: #fff; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.07); padding: 24px; margin-bottom: 24px; }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.card-header h2 { font-size: 1rem; font-weight: 600; color: #1a3c5e; }

/* ── Stat cards ─────────────────────────────────────────────── */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card { background: #fff; border-radius: 10px; box-shadow: 0 1px 6px rgba(0,0,0,.07); padding: 20px; }
.stat-card .stat-label { font-size: .8rem; color: #718096; text-transform: uppercase; letter-spacing: .06em; }
.stat-card .stat-value { font-size: 2rem; font-weight: 700; color: #1a3c5e; margin-top: 4px; }

/* ── Tables ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .9rem; }
th { text-align: left; padding: 10px 14px; background: #f7fafc; color: #4a5568; font-weight: 600; font-size: .8rem; text-transform: uppercase; letter-spacing: .05em; border-bottom: 2px solid #e2e8f0; }
td { padding: 11px 14px; border-bottom: 1px solid #edf2f7; vertical-align: middle; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: #f7fafc; }

/* ── Forms ──────────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .85rem; font-weight: 500; color: #4a5568; margin-bottom: 5px; }
input[type=text], input[type=email], input[type=password], input[type=date],
input[type=number], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid #cbd5e0; border-radius: 6px;
  font-size: .95rem; font-family: inherit; color: #2d3748; background: #fff;
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none; border-color: #2c5f8a; box-shadow: 0 0 0 3px rgba(44,95,138,.12);
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }

/* ── Buttons ────────────────────────────────────────────────── */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 9px 18px; border: none; border-radius: 6px; font-size: .9rem; font-weight: 500; cursor: pointer; transition: background .15s, opacity .15s; text-decoration: none; }
.btn:hover { opacity: .88; text-decoration: none; }
.btn-primary  { background: #2c5f8a; color: #fff; }
.btn-danger   { background: #e53e3e; color: #fff; }
.btn-success  { background: #38a169; color: #fff; }
.btn-secondary{ background: #edf2f7; color: #4a5568; }
.btn-sm       { padding: 5px 12px; font-size: .82rem; }
.btn-full     { width: 100%; justify-content: center; padding: 11px; }

/* ── Alerts ─────────────────────────────────────────────────── */
.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 16px; font-size: .9rem; }
.alert-error   { background: #fff5f5; border: 1px solid #feb2b2; color: #c53030; }
.alert-success { background: #f0fff4; border: 1px solid #9ae6b4; color: #276749; }
.alert-warn    { background: #fffbeb; border: 1px solid #fbd38d; color: #744210; }
.alert-info    { background: #ebf8ff; border: 1px solid #90cdf4; color: #2b6cb0; }

/* ── Task status badges ─────────────────────────────────────── */
.badge { display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 20px; font-size: .78rem; font-weight: 600; }
.badge-done    { background: #c6f6d5; color: #276749; }
.badge-overdue { background: #fed7d7; color: #9b2c2c; }
.badge-urgent  { background: #feebc8; color: #744210; }
.badge-warning { background: #fefcbf; color: #744210; }
.badge-normal  { background: #e2e8f0; color: #4a5568; }

/* Task completion indicator (the oval) */
.task-status { display: inline-flex; align-items: center; padding: 3px 12px; border-radius: 20px; font-size: .78rem; font-weight: 600; min-width: 70px; justify-content: center; }
.task-status.done    { background: #38a169; color: #fff; }
.task-status.pending { background: #e2e8f0; color: #718096; }
.task-status.overdue { background: #e53e3e; color: #fff; }
.task-status.urgent  { background: #ed8936; color: #fff; }
.task-status.warning { background: #ecc94b; color: #744210; }

/* ── Section headers in task list ───────────────────────────── */
.section-header td {
  background: #edf2f7; font-weight: 700; font-size: .82rem;
  text-transform: uppercase; letter-spacing: .07em; color: #2c5f8a;
  padding: 8px 14px;
}

/* ── Misc ───────────────────────────────────────────────────── */
.page-actions { display: flex; gap: 10px; margin-bottom: 20px; align-items: center; justify-content: flex-end; }
.text-muted { color: #718096; font-size: .88rem; }
.mt-0 { margin-top: 0; }
.mb-0 { margin-bottom: 0; }

@media (max-width: 768px) {
  .sidebar { width: 200px; }
  .main-content { margin-left: 200px; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
}
