/* TTC Community Service Portal — Global Styles */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+SC:wght@400;500;700&family=Libre+Baskerville:wght@400;700&family=DM+Sans:wght@400;500;600&display=swap');

:root {
  --navy:    #1a3a5c;
  --navy2:   #0f2540;
  --gold:    #c8a84b;
  --gold2:   #e8c96b;
  --bg:      #f7f5f0;
  --bg2:     #eeeae2;
  --card:    #ffffff;
  --text:    #1e1e1e;
  --muted:   #6b7280;
  --border:  #d9d4c8;
  --success: #16a34a;
  --danger:  #dc2626;
  --input-h: 48px;
  --radius:  12px;
  --shadow:  0 2px 16px rgba(0,0,0,0.08);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 16px; -webkit-text-size-adjust: 100%; }

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── Typography ───────────────────────────────── */
h1, h2, h3 {
  font-family: 'Libre Baskerville', serif;
  line-height: 1.3;
}
.cn { font-family: 'Noto Sans SC', sans-serif; }

/* ── Layout ───────────────────────────────────── */
.page-wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 16px 80px;
}

/* ── Header ───────────────────────────────────── */
.site-header {
  background: var(--navy);
  color: #fff;
  padding: 0 16px;
  position: sticky; top: 0; z-index: 100;
  box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}
.site-header .inner {
  max-width: 680px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
  gap: 12px;
}
.site-header .logo {
  display: flex; align-items: center; gap: 10px;
  font-family: 'Libre Baskerville', serif;
  font-size: 15px; font-weight: 700;
  color: #fff; text-decoration: none;
}
.site-header .logo-mark {
  width: 36px; height: 36px;
  background: var(--gold);
  border-radius: 8px;
  display: grid; place-items: center;
  font-size: 18px; font-weight: 900; color: var(--navy);
  flex-shrink: 0;
}
.nav-link {
  color: rgba(255,255,255,0.8);
  text-decoration: none; font-size: 14px;
  padding: 6px 12px; border-radius: 6px;
  transition: background .15s;
}
.nav-link:hover { background: rgba(255,255,255,0.1); color: #fff; }
.nav-link.danger { color: #fca5a5; }

/* ── Page title block ─────────────────────────── */
.page-hero {
  background: var(--navy);
  color: #fff;
  padding: 28px 16px 24px;
  margin-bottom: 24px;
}
.page-hero .inner { max-width: 680px; margin: 0 auto; }
.page-hero h1 { font-size: 20px; line-height: 1.4; }
.page-hero .sub {
  font-size: 13px; color: rgba(255,255,255,0.65); margin-top: 4px;
  font-family: 'Noto Sans SC', sans-serif;
}
.semester-badge {
  display: inline-block;
  background: var(--gold);
  color: var(--navy2);
  font-size: 12px; font-weight: 600;
  padding: 3px 10px; border-radius: 20px;
  margin-bottom: 10px;
}

/* ── Cards ────────────────────────────────────── */
.card {
  background: var(--card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 16px;
  border: 1px solid var(--border);
}
.card-title {
  font-size: 16px; font-weight: 600;
  color: var(--navy); margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid var(--gold);
  display: flex; align-items: center; gap: 8px;
}
.card-title .icon { font-size: 20px; }

/* ── Forms ────────────────────────────────────── */
.field { margin-bottom: 18px; }
.field label {
  display: block;
  font-size: 14px; font-weight: 600;
  margin-bottom: 6px; color: var(--navy);
}
.field .hint {
  font-size: 12px; color: var(--muted);
  font-family: 'Noto Sans SC', sans-serif;
  margin-bottom: 5px; display: block;
}
.field input[type="text"],
.field input[type="email"],
.field input[type="password"],
.field input[type="number"],
.field select,
.field textarea {
  width: 100%;
  height: var(--input-h);
  padding: 0 14px;
  border: 1.5px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}
.field textarea {
  height: auto; min-height: 100px;
  padding: 12px 14px; resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--navy);
  box-shadow: 0 0 0 3px rgba(26,58,92,.12);
}
.field select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.field .error-msg {
  color: var(--danger); font-size: 12px; margin-top: 4px;
}

/* ── Buttons ──────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 48px; padding: 0 24px;
  border: none; border-radius: 10px;
  font-size: 15px; font-weight: 600; font-family: inherit;
  cursor: pointer; text-decoration: none;
  transition: transform .12s, box-shadow .12s, background .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:active { transform: scale(.97); }
.btn-primary {
  background: var(--navy);
  color: #fff;
  box-shadow: 0 2px 8px rgba(26,58,92,.25);
}
.btn-primary:hover { background: var(--navy2); box-shadow: 0 4px 16px rgba(26,58,92,.3); }
.btn-gold {
  background: var(--gold);
  color: var(--navy2);
  box-shadow: 0 2px 8px rgba(200,168,75,.3);
}
.btn-gold:hover { background: var(--gold2); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}
.btn-outline:hover { border-color: var(--navy); color: var(--navy); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { height: 36px; padding: 0 14px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ── Alerts ───────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: 8px;
  font-size: 14px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-success { background: #dcfce7; color: #15803d; border-left: 4px solid #16a34a; }
.alert-danger   { background: #fee2e2; color: #b91c1c; border-left: 4px solid #dc2626; }
.alert-info     { background: #dbeafe; color: #1d4ed8; border-left: 4px solid #3b82f6; }
.alert-warning  { background: #fef9c3; color: #854d0e; border-left: 4px solid #ca8a04; }

/* ── Step indicator ───────────────────────────── */
.steps {
  display: flex; gap: 0;
  margin-bottom: 24px; overflow-x: auto;
}
.step {
  flex: 1; text-align: center;
  padding: 10px 6px;
  font-size: 12px; font-weight: 600;
  border-bottom: 3px solid var(--border);
  color: var(--muted);
  white-space: nowrap;
  min-width: 60px;
}
.step.active { border-color: var(--gold); color: var(--navy); }
.step.done   { border-color: var(--success); color: var(--success); }

/* ── Table ────────────────────────────────────── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { background: var(--navy); color: #fff; padding: 10px 12px; text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; }
td { padding: 10px 12px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr:last-child td { border-bottom: none; }
tr:hover td { background: var(--bg); }

/* ── Status badges ────────────────────────────── */
.badge {
  display: inline-block; padding: 3px 10px;
  border-radius: 20px; font-size: 12px; font-weight: 600;
}
.badge-submitted { background: #dbeafe; color: #1d4ed8; }
.badge-approved  { background: #dcfce7; color: #15803d; }
.badge-rejected  { background: #fee2e2; color: #b91c1c; }
.badge-reviewed  { background: #fef9c3; color: #854d0e; }

/* ── Summary card for submissions ────────────────*/
.summary-row {
  display: flex; justify-content: space-between; align-items: flex-start;
  padding: 10px 0; border-bottom: 1px solid var(--bg2);
  gap: 12px;
}
.summary-row:last-child { border-bottom: none; }
.summary-label { font-size: 13px; color: var(--muted); min-width: 140px; }
.summary-value { font-size: 14px; font-weight: 500; text-align: right; }

/* ── Login page ───────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px 16px;
  background: var(--navy);
  background-image: radial-gradient(circle at 20% 80%, rgba(200,168,75,.15) 0%, transparent 50%),
                    radial-gradient(circle at 80% 20%, rgba(200,168,75,.1) 0%, transparent 50%);
}
.login-card {
  background: #fff;
  border-radius: 16px;
  padding: 36px 28px;
  width: 100%; max-width: 400px;
  box-shadow: 0 8px 48px rgba(0,0,0,0.25);
}
.login-logo {
  text-align: center; margin-bottom: 28px;
}
.login-logo .mark {
  width: 64px; height: 64px;
  background: var(--navy);
  border-radius: 16px;
  display: inline-grid; place-items: center;
  font-size: 28px; font-weight: 900; color: var(--gold);
  margin-bottom: 12px;
}
.login-logo h1 {
  font-size: 18px; color: var(--navy);
}
.login-logo .sub {
  font-size: 12px; color: var(--muted);
  font-family: 'Noto Sans SC', sans-serif;
}

/* ── Admin sidebar/topbar ─────────────────────── */
.admin-topbar {
  background: var(--navy2);
  color: #fff;
  padding: 0 20px;
  height: 56px;
  display: flex; align-items: center; justify-content: space-between;
  position: sticky; top: 0; z-index: 100;
  gap: 12px;
}
.admin-nav {
  background: var(--navy);
  padding: 10px 16px;
  display: flex; gap: 4px; overflow-x: auto;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.admin-nav a {
  color: rgba(255,255,255,0.75); text-decoration: none;
  padding: 8px 14px; border-radius: 8px; font-size: 14px; font-weight: 500;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.12); color: #fff; }
.admin-nav a.active { background: var(--gold); color: var(--navy2); }

/* ── Utility ──────────────────────────────────── */
.mt-8  { margin-top: 8px; }
.mt-16 { margin-top: 16px; }
.mt-24 { margin-top: 24px; }
.mb-16 { margin-bottom: 16px; }
.gap-8  { gap: 8px; }
.flex   { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.text-muted { color: var(--muted); font-size: 13px; }
.text-sm { font-size: 13px; }
.text-right { text-align: right; }
.w-full { width: 100%; }
.divider { border: none; border-top: 1px solid var(--border); margin: 20px 0; }

/* ── Mobile tweaks ────────────────────────────── */
@media (max-width: 480px) {
  .card { padding: 18px; }
  .login-card { padding: 28px 20px; }
  .page-hero h1 { font-size: 17px; }
  .summary-label { min-width: 110px; }

  /* ── Header: shrink logo text + tighten nav links ── */
  .site-header { padding: 0 10px; }
  .site-header .inner { gap: 8px; height: 54px; }
  .site-header .logo { gap: 7px; }
  .site-header .logo-mark { width: 30px; height: 30px; font-size: 15px; border-radius: 6px; }
  .site-header .logo span { font-size: 13px !important; }
  .nav-link { padding: 5px 8px; font-size: 12px; }

  /* ── Page hero ── */
  .page-hero { padding: 18px 14px 16px; margin-bottom: 16px; }
  .page-hero .inner { max-width: 100%; }

  /* ── Buttons ── */
  .btn-sm { height: 34px; padding: 0 12px; font-size: 12px; }
}
