/* ============================================================
   GLOBAL RESET & VARIABLES
   ============================================================ */
:root {
  --navy-deep:   #0f1f33;
  --navy:        #16314f;
  --blue:        #1f6feb;
  --blue-light:  #4d9bff;
  --gray-bg:     #f4f6f9;
  --white:       #ffffff;
  --text:        #1c2833;
  --text-muted:  #5a6b7b;
  --border:      #dde3ea;
  --success-bg:  #e6f6ed;
  --success-text:#1f7a44;
  --error-bg:    #fdeaea;
  --error-text:  #b3261e;
  --shadow-sm:   0 2px 8px rgba(15,31,51,.08);
  --shadow-md:   0 4px 20px rgba(15,31,51,.12);
  --radius:      10px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', 'Helvetica Neue', sans-serif;
  background: var(--gray-bg);
  color: var(--text);
  line-height: 1.6;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; }

.container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ============================================================
   NAVIGATION
   ============================================================ */
.nav {
  position: sticky; top: 0; z-index: 100;
  background: var(--navy-deep);
  height: 64px;
}

.nav-container {
  max-width: 1100px; margin: 0 auto;
  padding: 0 24px; height: 100%;
  display: flex; align-items: center; gap: 32px;
}

.nav-brand {
  font-family: 'Poppins', sans-serif;
  font-size: 1.1rem; font-weight: 700;
  color: var(--white);
  white-space: nowrap;
}

.nav-links {
  display: flex; gap: 24px; flex: 1;
}

.nav-links a {
  font-size: 0.85rem; font-weight: 600;
  color: rgba(255,255,255,.7);
  letter-spacing: .02em;
  transition: color .2s;
}
.nav-links a:hover, .nav-links a.active { color: var(--white); }

.nav-toggle { display: none; background: none; border: none; color: var(--white); font-size: 1.4rem; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  position: relative;
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  color: var(--white);
  text-align: center;
  padding: 100px 24px 80px;
}

.hero-icon { font-size: 3rem; margin-bottom: 16px; }

.hero-title {
  font-family: 'Poppins', sans-serif;
  font-size: 2.4rem; font-weight: 700;
  margin-bottom: 12px;
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,.8);
  margin-bottom: 28px;
}

.hero-cta { display: inline-block; }

.page-hero {
  background: linear-gradient(135deg, var(--navy-deep), var(--navy));
  color: var(--white);
  padding: 64px 24px 48px;
  text-align: center;
}
.page-hero h1 {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem; font-weight: 700; margin-bottom: 8px;
}
.page-hero p { color: rgba(255,255,255,.8); }

/* ============================================================
   SECTIONS / CARDS
   ============================================================ */
.section { padding: 56px 0; }

.cta-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.cta-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s, box-shadow .15s;
}
.cta-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.cta-icon { font-size: 1.8rem; margin-bottom: 12px; }
.cta-card h3 { font-family: 'Poppins', sans-serif; font-size: 1.05rem; margin-bottom: 8px; }
.cta-card p { color: var(--text-muted); font-size: .92rem; }

/* ============================================================
   PAGE BODY / FORMS
   ============================================================ */
.page-body { padding: 40px 0 64px; }

.form-section, .table-section {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  margin-bottom: 32px;
  box-shadow: var(--shadow-sm);
}

.form-section h2, .table-section h2 {
  font-family: 'Poppins', sans-serif;
  font-size: 1.2rem;
}

.title-divider {
  width: 48px; height: 3px;
  background: var(--blue);
  margin: 10px 0 20px;
  border-radius: 2px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-full { grid-column: 1 / -1; }

.form-group label { font-size: .82rem; font-weight: 600; color: var(--text-muted); }

.form-control {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: .95rem;
  font-family: inherit;
}
.form-control:focus { outline: 2px solid var(--blue-light); border-color: var(--blue); }

.form-textarea { min-height: 80px; resize: vertical; }

.btn {
  display: inline-block;
  padding: 10px 20px;
  border: none;
  border-radius: 8px;
  font-size: .9rem; font-weight: 600;
  text-align: center;
}
.btn-primary { background: var(--blue); color: var(--white); }
.btn-primary:hover { background: var(--blue-light); }
.btn-secondary { background: var(--navy); color: var(--white); }
.btn-danger { background: var(--error-text); color: var(--white); }
.btn-small { padding: 6px 12px; font-size: .8rem; }

.inline-form { display: inline; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 40px 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  font-size: .9rem;
  transition: opacity .3s ease, transform .3s ease;
}
.alert-success { background: var(--success-bg); color: var(--success-text); }
.alert-error { background: var(--error-bg); color: var(--error-text); }
.alert-fade { opacity: 0; transform: translateY(-6px); }

.alert-close {
  position: absolute;
  top: 8px;
  right: 10px;
  background: none;
  border: none;
  font-size: 1.1rem;
  line-height: 1;
  color: inherit;
  opacity: .55;
}
.alert-close:hover { opacity: 1; }

/* ============================================================
   TABLES
   ============================================================ */
.table-wrap { overflow-x: auto; max-height: 560px; }

.records-table { width: 100%; border-collapse: collapse; font-size: .9rem; }
.records-table th, .records-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.records-table th {
  color: var(--text-muted);
  font-weight: 600;
  font-size: .8rem;
  text-transform: uppercase;
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}
.records-table tbody tr:nth-child(even) { background: var(--gray-bg); }
.records-table tbody tr:hover { background: #eaf1fb; }

.sort-link { color: var(--text-muted); text-decoration: none; }
.sort-link:hover { color: var(--blue); }
.sort-arrow { font-size: .6rem; color: var(--blue); margin-left: 2px; }

.empty-state { color: var(--text-muted); padding: 16px 0; }

.table-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: .75rem;
  font-weight: 600;
}
.badge-active { background: var(--success-bg); color: var(--success-text); }
.badge-done { background: var(--border); color: var(--text-muted); }

/* ============================================================
   REPORTS
   ============================================================ */
.report-actions {
  display: flex;
  gap: 12px;
  margin-top: 16px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.summary-card {
  background: var(--gray-bg);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 16px;
}

.summary-card h4 {
  font-family: 'Poppins', sans-serif;
  font-size: .92rem;
  margin-bottom: 10px;
}

.summary-card ul { list-style: none; }

.summary-card li { padding: 6px 0; }

.summary-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  font-size: .85rem;
  margin-bottom: 4px;
}

.summary-count { font-weight: 700; color: var(--blue); }

.summary-bar-track {
  background: var(--border);
  border-radius: 4px;
  height: 6px;
  overflow: hidden;
}
.summary-bar-fill {
  background: var(--blue);
  height: 100%;
  border-radius: 4px;
  transition: width .4s ease;
}

/* ============================================================
   KPI DASHBOARD
   ============================================================ */
.kpi-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
  margin-bottom: 32px;
}

.kpi-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.kpi-value {
  font-family: 'Poppins', sans-serif;
  font-size: 2rem;
  font-weight: 700;
  color: var(--navy);
}

.kpi-label {
  font-size: .78rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .04em;
  margin-top: 4px;
}

/* ============================================================
   PAGINATION
   ============================================================ */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.pagination-info { font-size: .85rem; color: var(--text-muted); }

.pagination-controls { display: flex; gap: 4px; flex-wrap: wrap; }

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 8px;
  border-radius: 6px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--gray-bg);
  border: 1px solid var(--border);
}
.page-btn:hover { background: #eaf1fb; color: var(--blue); }
.page-btn.active { background: var(--blue); color: var(--white); border-color: var(--blue); }
.page-btn.disabled { opacity: .4; cursor: not-allowed; }
.page-ellipsis { padding: 0 4px; color: var(--text-muted); }

/* ============================================================
   QUICK FILTERS / ACTIVE FILTER CHIPS
   ============================================================ */
.quick-filters {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.chip-btn {
  padding: 7px 16px;
  border-radius: 999px;
  background: var(--white);
  border: 1px solid var(--border);
  font-size: .82rem;
  font-weight: 600;
  color: var(--navy);
  transition: background .15s, color .15s;
}
.chip-btn:hover { background: var(--navy); color: var(--white); }

.active-filters {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
  font-size: .85rem;
}

.active-filters-label { color: var(--text-muted); font-weight: 600; }

.filter-chip {
  background: var(--blue);
  color: var(--white);
  padding: 4px 12px;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 600;
}

.filter-clear {
  color: var(--error-text);
  font-size: .82rem;
  font-weight: 600;
  text-decoration: underline;
}

/* ============================================================
   FOOTER
   ============================================================ */
.footer {
  background: var(--navy-deep);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 32px 24px;
}
.footer-name { color: var(--white); font-weight: 700; margin-bottom: 4px; }
.footer-tagline { font-size: .85rem; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 720px) {
  .form-grid { grid-template-columns: 1fr; }
  .cta-grid { grid-template-columns: 1fr; }
  .summary-grid { grid-template-columns: 1fr; }
  .kpi-grid { grid-template-columns: 1fr; }

  .nav-toggle { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--navy-deep);
    box-shadow: var(--shadow-md);
    padding: 8px 0;
    z-index: 99;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 14px 24px; }
  .nav-links a:hover, .nav-links a.active { background: rgba(255,255,255,.08); }

  .pagination-wrap { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 480px) {
  .nav-container { gap: 16px; }
  .hero { padding: 72px 20px 56px; }
  .hero-title { font-size: 1.9rem; }
  .page-hero { padding: 48px 20px 36px; }
  .page-hero h1 { font-size: 1.6rem; }
}
