/* ============================================================
   Koorooma Parent Portal — Shared Stylesheet
   Colours: purple #7c3aed / orange #f97316 / warm bg #fffdf7
   Font: Poppins (matches main site)
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&display=swap');

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

:root {
  --purple:      #7c3aed;
  --purple-dark: #6d28d9;
  --purple-light:#f3e8ff;
  --purple-pale: #faf5ff;
  --orange:      #f97316;
  --orange-light:#fff7ed;
  --bg:          #fffdf7;
  --white:       #ffffff;
  --text-dark:   #1f2937;
  --text-mid:    #374151;
  --text-muted:  #6b7280;
  --text-faint:  #9ca3af;
  --border:      #e5e7eb;
  --border-light:#f3f4f6;
  --shadow:      0 2px 16px rgba(124,58,237,0.10);
  --shadow-lg:   0 8px 40px rgba(124,58,237,0.14);
  --radius:      14px;
  --radius-sm:   8px;
  --radius-pill: 999px;
}

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: 'Poppins', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text-dark);
  margin: 0;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

/* ── HEADER / NAV ─────────────────────────────────────────── */
.portal-header {
  position: sticky; top: 0; z-index: 100;
  background: var(--white);
  border-bottom: 2px solid var(--purple-light);
  box-shadow: 0 1px 8px rgba(124,58,237,0.07);
}

.portal-header__inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 1.5rem;
  height: 64px;
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem;
}

.portal-header__brand {
  display: flex; align-items: center; gap: 0.6rem;
  text-decoration: none; flex-shrink: 0;
}

.portal-header__logo {
  height: 40px; width: auto;
  /* keeps crisp at all sizes */
  image-rendering: auto;
}

.portal-header__name {
  font-size: 1.05rem; font-weight: 700;
  color: var(--purple);
  letter-spacing: -0.02em;
}

.portal-header__nav {
  display: flex; align-items: center; gap: 0.25rem;
}

.pnav-link {
  padding: 0.4rem 0.85rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem; font-weight: 600;
  color: var(--text-mid); text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.pnav-link:hover { background: var(--purple-light); color: var(--purple); }
.pnav-link--active { color: var(--purple); background: var(--purple-light); }

.pnav-btn {
  padding: 0.45rem 1rem;
  border-radius: var(--radius-pill);
  font-size: 0.875rem; font-weight: 700;
  text-decoration: none;
  background: var(--purple); color: var(--white);
  transition: background 0.15s;
  border: none; cursor: pointer;
}
.pnav-btn:hover { background: var(--purple-dark); }
.pnav-btn--ghost {
  background: transparent;
  color: var(--purple);
  border: 2px solid var(--purple);
}
.pnav-btn--ghost:hover { background: var(--purple-light); }

.pnav-user {
  font-size: 0.85rem; font-weight: 600;
  color: var(--text-mid);
  padding-left: 0.5rem;
  border-left: 1.5px solid var(--border);
  margin-left: 0.25rem;
}

/* burger — hidden on desktop */
.pnav-burger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 6px;
  border-radius: var(--radius-sm);
}
.pnav-burger span {
  display: block; width: 22px; height: 2px;
  background: var(--purple); border-radius: 2px;
  transition: transform 0.2s;
}

/* Mobile drawer */
.pnav-drawer {
  display: none; flex-direction: column;
  background: var(--white);
  border-top: 1px solid var(--purple-light);
  padding: 0.5rem 1rem 1rem;
}
.pnav-drawer--open { display: flex; }
.pnav-drawer__link {
  padding: 0.7rem 0.5rem;
  font-size: 0.95rem; font-weight: 600;
  color: var(--text-mid); text-decoration: none;
  border-bottom: 1px solid var(--border-light);
}
.pnav-drawer__link:last-child { border-bottom: none; }
.pnav-drawer__link:hover { color: var(--purple); }
.pnav-drawer__link--accent { color: var(--orange); }

@media (max-width: 700px) {
  .portal-header__nav { display: none; }
  .pnav-burger { display: flex; }
  .portal-header__name { font-size: 0.95rem; }
}

/* ── UTILITIES ────────────────────────────────────────────── */
.container-portal {
  max-width: 1440px; margin: 0 auto;
  padding: 2rem 1.5rem;
}

.section-title {
  font-size: 1rem; font-weight: 700; color: var(--text-mid);
  margin: 0 0 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.section-title::before {
  content: ''; display: inline-block;
  width: 4px; height: 1rem;
  background: linear-gradient(180deg, var(--purple), var(--orange));
  border-radius: 2px;
}

.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.5rem;
  margin-bottom: 1.75rem;
}

/* ── BADGES / STATUS ─────────────────────────────────────── */
.badge {
  display: inline-block; padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.03em;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #d1fae5; color: #065f46; }
.badge-rejected { background: #fee2e2; color: #991b1b; }

.inv-status {
  display: inline-block; padding: 0.2rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem; font-weight: 700;
  text-align: center; min-width: 72px;
}
.inv-paid    { background: #d1fae5; color: #065f46; }
.inv-unpaid  { background: #fef3c7; color: #92400e; }
.inv-overdue { background: #fee2e2; color: #991b1b; }
.inv-draft   { background: var(--border-light); color: var(--text-muted); }

/* ── ALERTS ──────────────────────────────────────────────── */
.alert {
  padding: 0.85rem 1rem; border-radius: var(--radius-sm);
  margin-bottom: 1.25rem; font-size: 0.9rem; font-weight: 500;
}
.alert-info    { background: #eff6ff; color: #1d4ed8; }
.alert-success { background: #f0fdf4; color: #166534; }
.alert-error   { background: #fef2f2; color: #dc2626; }

/* ── FORM ELEMENTS ───────────────────────────────────────── */
.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block; font-size: 0.82rem; font-weight: 600;
  color: var(--text-mid); margin-bottom: 0.35rem;
}
.form-group input,
select, input[type=text], input[type=email], input[type=tel], input[type=password] {
  width: 100%; padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-size: 0.95rem; font-family: 'Poppins', sans-serif;
  background: var(--white); color: var(--text-dark);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.form-group input:focus,
select:focus, input[type=text]:focus, input[type=email]:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124,58,237,0.12);
}

/* ── BUTTONS ─────────────────────────────────────────────── */
.btn {
  display: inline-block; padding: 0.6rem 1.2rem;
  border-radius: var(--radius-sm); border: none; cursor: pointer;
  font-size: 0.875rem; font-weight: 700; font-family: 'Poppins', sans-serif;
  text-decoration: none; transition: background 0.15s, opacity 0.15s;
  line-height: 1;
}
.btn-primary  { background: var(--purple); color: var(--white); }
.btn-primary:hover  { background: var(--purple-dark); }
.btn-primary--full  { width: 100%; padding: 0.85rem; font-size: 1rem; }
.btn-danger   { background: #ef4444; color: var(--white); }
.btn-danger:hover   { background: #dc2626; }
.btn-info     { background: #0ea5e9; color: var(--white); }
.btn-info:hover     { background: #0284c7; }
.btn-orange   { background: var(--orange); color: var(--white); }
.btn-orange:hover   { background: #ea6c08; }
.btn-sm { padding: 0.3rem 0.7rem; font-size: 0.78rem; border-radius: 6px; }

.btn-pay {
  padding: 0.35rem 0.9rem; background: var(--purple);
  color: var(--white); border: none; border-radius: 8px;
  font-size: 0.78rem; font-weight: 700; cursor: pointer;
  font-family: 'Poppins', sans-serif;
  text-decoration: none; display: inline-block;
  transition: background 0.15s;
}
.btn-pay:hover { background: var(--purple-dark); }

/* ── LOADING / EMPTY / ERROR ─────────────────────────────── */
.loading, .empty {
  text-align: center; padding: 2rem;
  color: var(--text-faint); font-size: 0.95rem;
}
.loading::before { content: '⏳ '; }
.error-msg {
  background: #fef2f2; color: #dc2626;
  border-radius: var(--radius-sm);
  padding: 1rem; text-align: center;
  font-size: 0.9rem;
}

/* ── TABLE ───────────────────────────────────────────────── */
.portal-table {
  width: 100%; border-collapse: collapse;
  font-size: 0.875rem;
}
.portal-table th {
  padding: 0.6rem 0.75rem; text-align: left;
  font-weight: 700; color: var(--text-muted);
  font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.04em;
  border-bottom: 2px solid var(--border-light);
}
.portal-table td {
  padding: 0.65rem 0.75rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}
.portal-table tr:last-child td { border-bottom: none; }
.portal-table tr:hover td { background: var(--purple-pale); }

form.inline { display: inline; }
