/* File: compliance_tracker/static/style.css */

/* ===================================================================
   DESIGN TOKENS — InPath Technologies brand
   =================================================================== */
:root {
  /* Brand */
  --brand-dark:    #09403D;
  --brand-mid:     #1A4E4B;
  --brand-light-t: #1C5F5E;
  --brand-accent:  #01AD68;
  --brand-accent-dim: rgba(1, 173, 104, 0.12);

  /* Surfaces */
  --bg-page:      #FAF9F5;
  --bg-surface:   #FFFFFF;
  --bg-surface-2: #F5F4F0;
  --bg-hover:     #EEECEA;

  /* Borders */
  --border:       #E6E4DE;
  --border-light: #D1CFC8;

  /* Typography */
  --text-primary:   #141413;
  --text-secondary: #333333;
  --text-muted:     #7A7870;

  /* Status — Overdue (red) */
  --overdue-fg:     #DC2626;
  --overdue-bg:     #FEF2F2;
  --overdue-border: #FECACA;
  --overdue-accent: #DC2626;

  /* Status — Due Soon (amber) */
  --due-soon-fg:     #D97706;
  --due-soon-bg:     #FFFBEB;
  --due-soon-border: #FDE68A;
  --due-soon-accent: #D97706;

  /* Status — Upcoming (teal-blue) */
  --upcoming-fg:     #1D6FA4;
  --upcoming-bg:     #EFF6FF;
  --upcoming-border: #BAE6FD;
  --upcoming-accent: #1D6FA4;

  /* Status — Fulfilled (brand green) */
  --fulfilled-fg:     #059669;
  --fulfilled-bg:     #ECFDF5;
  --fulfilled-border: #A7F3D0;
  --fulfilled-accent: #01AD68;

  /* Misc */
  --radius-sm: 4px;
  --radius:    8px;
  --radius-lg: 10px;
  --shadow:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-lg: 0 4px 16px rgba(9,64,61,0.12);

  --font: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;

  /* Sidebar width — one place to change */
  --sidebar-w: 240px;
}

/* ===================================================================
   RESET
   =================================================================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-page);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
img { max-width: 100%; }

/* ===================================================================
   APP SHELL — sidebar + main
   =================================================================== */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ===================================================================
   SIDEBAR
   =================================================================== */
.sidebar {
  width: var(--sidebar-w);
  min-height: 100vh;
  background: var(--brand-dark);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  z-index: 200;
  overflow-y: auto;
}

/* — Logo area — */
.sidebar__logo {
  padding: 1.4rem 1.25rem 1.15rem;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  flex-shrink: 0;
}
.sidebar__logo-img {
  width: 36px;
  height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.sidebar__logo-text { line-height: 1.2; }
.sidebar__logo-name {
  font-size: 0.82rem;
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.01em;
}
.sidebar__logo-sub {
  font-size: 0.64rem;
  color: rgba(255,255,255,0.38);
  text-transform: uppercase;
  letter-spacing: 0.09em;
  margin-top: 1px;
}

/* — Section label — */
.sidebar__section-label {
  padding: 1.25rem 1.25rem 0.4rem;
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.35);
  flex-shrink: 0;
  border-top: 1px solid rgba(255,255,255,0.07);
  margin-top: 0.25rem;
}

/* — Nav list — */
.sidebar__nav {
  list-style: none;
  padding: 0 0.65rem;
  flex-shrink: 0;
}
.sidebar__nav li { margin-bottom: 1px; }
.sidebar__nav a {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.52rem 0.75rem;
  border-radius: 7px;
  text-decoration: none;
  font-size: 0.83rem;
  font-weight: 500;
  color: rgba(255,255,255,0.58);
  transition: background 0.12s, color 0.12s;
}
.sidebar__nav a:hover {
  background: rgba(255,255,255,0.07);
  color: rgba(255,255,255,0.88);
}
.sidebar__nav a.active {
  background: var(--brand-accent);
  color: #fff;
  font-weight: 700;
}
.sidebar__nav .nav-icon {
  width: 16px;
  text-align: center;
  flex-shrink: 0;
  opacity: 0.75;
  font-style: normal;
}
.sidebar__nav a.active .nav-icon { opacity: 1; }

/* — Divider — */
.sidebar__divider {
  margin: 0.65rem 1.1rem;
  border: none;
  border-top: 1px solid rgba(255,255,255,0.07);
  flex-shrink: 0;
}

/* — User area at bottom — */
.sidebar__user {
  margin-top: auto;
  padding: 0.9rem 1.1rem;
  border-top: 1px solid rgba(255,255,255,0.07);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}
.sidebar__avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--brand-accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.66rem;
  font-weight: 800;
  flex-shrink: 0;
  text-transform: uppercase;
}
.sidebar__user-name {
  font-size: 0.77rem;
  font-weight: 600;
  color: #fff;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar__user-role {
  font-size: 0.65rem;
  color: rgba(255,255,255,0.35);
  white-space: nowrap;
}
.sidebar__signout {
  margin-left: auto;
  font-size: 0.68rem;
  color: rgba(255,255,255,0.32);
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: color 0.12s;
}
.sidebar__signout:hover { color: rgba(255,255,255,0.65); }

/* ===================================================================
   MAIN CONTENT AREA
   =================================================================== */
.page-content {
  margin-left: var(--sidebar-w);
  flex: 1;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* ===================================================================
   TOPBAR
   =================================================================== */
.topbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border);
  padding: 0.8rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  flex-shrink: 0;
}
.topbar__left { }
.topbar__page {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
}
.topbar__date {
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-top: 1px;
}
.topbar__right {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

/* ===================================================================
   PAGE BODY
   =================================================================== */
.page-body {
  flex: 1;
  padding: 1.75rem 2rem 3rem;
}

/* Legacy alias kept for templates that use .main + .container */
.main { flex: 1; }
.container {
  max-width: 100%;
  margin: 0 auto;
}

/* ===================================================================
   PAGE HEADER
   =================================================================== */
.page-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.page-title {
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.page-subtitle {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.2rem;
}

/* ===================================================================
   STAT CARDS
   =================================================================== */
.stat-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.stat-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1rem 1rem;
  text-align: center;
  transition: box-shadow 0.15s;
  position: relative;
  overflow: hidden;
}
.stat-card:hover { box-shadow: var(--shadow-lg); }

/* Top accent bar */
.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}
.stat-card--total::before     { background: var(--brand-dark); }
.stat-card--overdue::before   { background: var(--overdue-accent); }
.stat-card--due-soon::before  { background: var(--due-soon-accent); }
.stat-card--upcoming::before  { background: var(--upcoming-accent); }
.stat-card--fulfilled::before     { background: var(--fulfilled-accent); }
.stat-card--pending-review::before{ background: #eab308; }

.stat-card__number {
  font-size: 2.1rem;
  font-weight: 800;
  line-height: 1;
  margin-bottom: 0.4rem;
  letter-spacing: -0.03em;
}
.stat-card__label {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  font-weight: 600;
}

.stat-card--total    .stat-card__number { color: var(--brand-dark);      }
.stat-card--overdue  .stat-card__number { color: var(--overdue-accent);   }
.stat-card--due-soon .stat-card__number { color: var(--due-soon-accent);  }
.stat-card--upcoming .stat-card__number { color: var(--upcoming-accent);  }
.stat-card--fulfilled .stat-card__number    { color: var(--fulfilled-accent); }
.stat-card--pending-review .stat-card__number { color: #eab308; }

/* ===================================================================
   FILTER BAR
   =================================================================== */
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-btn {
  padding: 0.32rem 0.85rem;
  border-radius: 9999px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.8rem;
  transition: all 0.12s;
  white-space: nowrap;
}
.filter-btn:hover {
  border-color: var(--brand-dark);
  color: var(--brand-dark);
  background: var(--bg-hover);
}
.filter-btn.active {
  background: var(--brand-dark);
  color: #fff;
  border-color: var(--brand-dark);
}

/* ===================================================================
   SEARCH / FORM INPUTS
   =================================================================== */
.search-input {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.42rem 0.85rem;
  color: var(--text-primary);
  font-size: 0.875rem;
  width: 230px;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  font-family: var(--font);
}
.search-input::placeholder { color: var(--text-muted); }
.search-input:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 2px rgba(1,173,104,0.15);
}

/* ===================================================================
   SECTION CARD
   =================================================================== */
.section-card,
.detail-card,
.notes-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1rem;
  box-shadow: var(--shadow);
}

.section-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

/* ===================================================================
   OBLIGATIONS TABLE
   =================================================================== */
.table-wrapper {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.obligations-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
}

.obligations-table thead {
  background: var(--bg-surface-2);
}

.obligations-table th {
  padding: 0.65rem 1rem;
  text-align: left;
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--text-muted);
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

.obligations-table td {
  padding: 0.875rem 1rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.obligations-table tbody tr:last-child td { border-bottom: none; }

.obligations-table tbody tr {
  background: var(--bg-surface);
  transition: background 0.1s;
}

.obligations-table tbody tr:hover {
  background: rgba(1,173,104,0.04);
}

/* Left-edge status accent */
.obligation-row[data-status="overdue"]   > td:first-child { border-left: 3px solid var(--overdue-accent);  padding-left: calc(1rem - 3px); }
.obligation-row[data-status="due_soon"]  > td:first-child { border-left: 3px solid var(--due-soon-accent); padding-left: calc(1rem - 3px); }
.obligation-row[data-status="upcoming"]  > td:first-child { border-left: 3px solid transparent;            padding-left: calc(1rem - 3px); }
.obligation-row[data-status="fulfilled"] > td:first-child { border-left: 3px solid var(--fulfilled-accent);padding-left: calc(1rem - 3px); }

/* Column helpers */
.col-id     { color: var(--text-muted); font-size: 0.77rem; width: 2.5rem; }
.col-name   { display: flex; flex-direction: column; gap: 0.15rem; }
.col-name strong { color: var(--text-primary); font-weight: 600; font-size: 0.9rem; }
.col-agency { color: var(--text-secondary); font-size: 0.82rem; max-width: 220px; }
.col-due    { white-space: nowrap; color: var(--text-secondary); font-size: 0.84rem; }

.cycle-label        { display: inline-block; font-size: 0.72rem; font-weight: 500; color: var(--text-muted); letter-spacing: 0.02em; }
.cycle-label--header{ font-size: 0.85rem; color: var(--brand-accent); opacity: 0.85; }

/* Days-remaining colour helpers */
.days--overdue   { color: var(--overdue-accent);  font-weight: 700; }
.days--due_soon  { color: var(--due-soon-accent); font-weight: 700; }
.days--upcoming  { color: var(--text-secondary); }
.days--fulfilled       { color: var(--fulfilled-accent); }
.days--pending_review  { color: #ca8a04; }

/* Evidence file list */
.evidence-file-list  { list-style: none; display: flex; flex-direction: column; gap: 0.3rem; }
.evidence-file-item  { display: flex; flex-direction: column; gap: 0.1rem; }
.evidence-file-link  { color: var(--upcoming-accent); font-size: 0.84rem; }
.evidence-file-link:hover { text-decoration: underline; }
.evidence-file-notes { font-size: 0.74rem; color: var(--text-muted); font-style: italic; }

/* ===================================================================
   FREQUENCY BADGE
   =================================================================== */
.freq-badge {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 9999px;
  font-size: 0.67rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}
.freq-badge--monthly  { background: rgba(99,102,241,0.1);  color: #6366f1; border: 1px solid rgba(99,102,241,0.25); }
.freq-badge--annual   { background: rgba(29,111,164,0.1);  color: #1d6fa4; border: 1px solid rgba(29,111,164,0.25); }
.freq-badge--validity { background: rgba(168,85,247,0.1);  color: #9333ea; border: 1px solid rgba(168,85,247,0.25); }

/* ===================================================================
   STATUS BADGE
   =================================================================== */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.6rem;
  border-radius: 9999px;
  font-size: 0.69rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  white-space: nowrap;
}
.badge::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
}

.badge--overdue        { background: var(--overdue-bg);   color: var(--overdue-fg);   border: 1px solid var(--overdue-border); }
.badge--overdue::before{ background: var(--overdue-accent); }

.badge--due_soon        { background: var(--due-soon-bg);  color: var(--due-soon-fg);  border: 1px solid var(--due-soon-border); }
.badge--due_soon::before{ background: var(--due-soon-accent); }

/* legacy hyphenated alias */
.badge--due-soon        { background: var(--due-soon-bg);  color: var(--due-soon-fg);  border: 1px solid var(--due-soon-border); }
.badge--due-soon::before{ background: var(--due-soon-accent); }

.badge--upcoming        { background: var(--upcoming-bg);  color: var(--upcoming-fg);  border: 1px solid var(--upcoming-border); }
.badge--upcoming::before{ background: var(--upcoming-accent); }

.badge--fulfilled        { background: var(--fulfilled-bg); color: var(--fulfilled-fg); border: 1px solid var(--fulfilled-border); }
.badge--fulfilled::before{ background: var(--fulfilled-accent); }

/* pending-review (hyphen) — used in evidence table */
.badge--pending-review { background: #FEF3C7; color: #B45309; border: 1px solid #FDE68A; }
/* pending_review (underscore) — used via badge--{{ item.status }} on dashboard / obligation header */
.badge--pending_review { background: rgba(234,179,8,0.12); color: #a16207; border: 1px solid rgba(234,179,8,0.35); }
.badge--pending_review::before { background: #eab308; }
.badge--approved       { background: var(--fulfilled-bg); color: var(--fulfilled-fg); border: 1px solid var(--fulfilled-border); }
.badge--rejected       { background: var(--overdue-bg); color: var(--overdue-fg); border: 1px solid var(--overdue-border); }

.badge--lg { padding: 0.32rem 1rem; font-size: 0.8rem; }

/* Review meta */
.review-meta {
  margin-top: 0.3rem;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.4;
}
.approve-form { margin-top: 0.5rem; }
.approve-form__row {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-top: 0.35rem;
}

/* Rejection */
.rejection-reason {
  margin-top: 0.35rem;
  font-size: 0.78rem;
  color: var(--overdue-fg);
  background: var(--overdue-bg);
  border-left: 2px solid var(--overdue-accent);
  border-radius: 2px;
  padding: 0.3rem 0.55rem;
  line-height: 1.45;
}
.reject-reason-input {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.35rem 0.5rem;
  color: var(--text-primary);
  font-size: 0.78rem;
  font-family: var(--font);
  resize: vertical;
  min-height: 3rem;
  max-height: 8rem;
  outline: none;
  transition: border-color 0.15s;
  box-sizing: border-box;
}
.reject-reason-input:focus { border-color: var(--overdue-accent); }

/* Per-file row with delete button */
.evidence-file-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
}

/* ===================================================================
   BUTTONS
   =================================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.48rem 1rem;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-size: 0.85rem;
  font-weight: 600;
  transition: all 0.12s;
  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
  font-family: var(--font);
}

.btn--primary {
  background: var(--brand-dark);
  color: #fff;
  border-color: var(--brand-dark);
}
.btn--primary:hover { background: var(--brand-mid); border-color: var(--brand-mid); }

.btn--accent {
  background: var(--brand-accent);
  color: #fff;
  border-color: var(--brand-accent);
}
.btn--accent:hover { filter: brightness(0.92); }

.btn--ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: var(--border);
}
.btn--ghost:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.btn--sm { padding: 0.27rem 0.65rem; font-size: 0.77rem; border-radius: var(--radius-sm); }

.btn:disabled,
.btn[disabled] { opacity: 0.4; cursor: not-allowed; pointer-events: none; }

/* ===================================================================
   OBLIGATION DETAIL PAGE
   =================================================================== */
.back-link { margin-bottom: 1.25rem; }

.ob-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
  flex-wrap: wrap;
}
.ob-header__title  { font-size: 1.5rem; font-weight: 800; letter-spacing: -0.02em; }
.ob-header__agency { color: var(--text-muted); margin-top: 0.25rem; font-size: 0.875rem; }

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-bottom: 1rem;
}

.detail-card__title {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.detail-rows { display: flex; flex-direction: column; gap: 0; }

.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
.detail-row:first-child { padding-top: 0; }
.detail-row:last-child  { border-bottom: none; padding-bottom: 0; }

.detail-row__label { color: var(--text-muted); font-size: 0.82rem; }
.detail-row__value { color: var(--text-primary); font-size: 0.875rem; font-weight: 500; text-align: right; max-width: 60%; }

.notes-text { color: var(--text-secondary); font-size: 0.875rem; line-height: 1.65; }

/* ===================================================================
   EMPTY STATES
   =================================================================== */
.empty-state {
  color: var(--text-muted);
  text-align: center;
  padding: 2.5rem 1rem;
  font-size: 0.9rem;
}

.empty-state-box {
  background: var(--bg-surface);
  border: 1px dashed var(--border-light);
  border-radius: var(--radius-lg);
  padding: 4rem 2rem;
  text-align: center;
}
.empty-state-box p { color: var(--text-muted); margin-bottom: 0.5rem; font-size: 0.9rem; }
.empty-state-box p:first-child { font-size: 1rem; font-weight: 600; color: var(--text-secondary); }

/* ===================================================================
   STATUS BANNERS
   =================================================================== */
.status-banner {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.8rem 1.25rem;
  border-radius: var(--radius-lg);
  margin-bottom: 1.25rem;
  font-size: 0.88rem;
  font-weight: 500;
}
.status-banner--success {
  background: var(--fulfilled-bg);
  border: 1px solid var(--fulfilled-border);
  color: var(--fulfilled-fg);
}
.status-banner--error {
  background: var(--overdue-bg);
  border: 1px solid var(--overdue-border);
  color: var(--overdue-fg);
}

/* ===================================================================
   FULFILL / ACTION BUTTONS
   =================================================================== */
.action-buttons {
  display: flex;
  gap: 0.4rem;
  align-items: center;
  flex-wrap: wrap;
}

.btn--fulfill {
  background: transparent;
  color: var(--fulfilled-fg);
  border-color: var(--fulfilled-border);
}
.btn--fulfill:hover {
  background: var(--fulfilled-bg);
  border-color: var(--fulfilled-accent);
}

.fulfilled-tick {
  font-size: 0.77rem;
  color: var(--fulfilled-fg);
  font-weight: 600;
  padding: 0.27rem 0.65rem;
  border-radius: var(--radius-sm);
  background: var(--fulfilled-bg);
  border: 1px solid var(--fulfilled-border);
  white-space: nowrap;
}

/* ===================================================================
   CHECKLIST
   =================================================================== */
.checklist {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 1rem;
}
.checklist__label {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  cursor: pointer;
  font-size: 0.875rem;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 0.45rem 0.7rem;
  border-radius: var(--radius);
  transition: background 0.1s;
}
.checklist__label:hover { background: var(--bg-hover); color: var(--text-primary); }
.checklist__checkbox {
  flex-shrink: 0;
  width: 1rem;
  height: 1rem;
  margin-top: 0.15rem;
  accent-color: var(--brand-accent);
  cursor: pointer;
}
.checklist__label:has(.checklist__checkbox:checked) {
  color: var(--text-muted);
  text-decoration: line-through;
}
.checklist__note {
  font-size: 0.77rem;
  color: var(--text-muted);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border);
}

/* ===================================================================
   EVIDENCE UPLOAD FORM
   =================================================================== */
.upload-form {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}
.upload-form__row {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
}
.upload-form__label {
  width: 110px;
  flex-shrink: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
  padding-top: 0.45rem;
  text-align: right;
}
.upload-file-wrap {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex: 1;
  max-width: 420px;
}
.upload-file-btn   { white-space: nowrap; flex-shrink: 0; }
.upload-file-name  { font-size: 0.82rem; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.upload-form__textarea {
  flex: 1;
  max-width: 420px;
  min-height: 72px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.5rem 0.75rem;
  color: var(--text-primary);
  font-family: var(--font);
  font-size: 0.875rem;
  resize: vertical;
  outline: none;
  transition: border-color 0.15s;
}
.upload-form__textarea::placeholder { color: var(--text-muted); }
.upload-form__textarea:focus { border-color: var(--brand-accent); box-shadow: 0 0 0 2px rgba(1,173,104,0.12); }

/* ===================================================================
   FOOTER
   =================================================================== */
.footer {
  background: var(--bg-surface);
  border-top: 1px solid var(--border);
  padding: 0.85rem 2rem;
  font-size: 0.73rem;
  color: var(--text-muted);
  flex-shrink: 0;
}

/* ===================================================================
   MODAL
   =================================================================== */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(9,64,61,0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 500;
  align-items: center;
  justify-content: center;
}
.modal-overlay.active { display: flex; }

.modal-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 2rem 2rem 1.5rem;
  max-width: 440px;
  width: calc(100% - 2rem);
  box-shadow: 0 24px 48px rgba(9,64,61,0.2);
  animation: modal-in 0.15s cubic-bezier(0.34, 1.2, 0.64, 1);
}
@keyframes modal-in {
  from { transform: scale(0.94) translateY(8px); opacity: 0; }
  to   { transform: scale(1)    translateY(0);   opacity: 1; }
}
.modal-icon    { font-size: 2rem; line-height: 1; margin-bottom: 0.85rem; }
.modal-title   { font-size: 1.05rem; font-weight: 700; color: var(--text-primary); margin-bottom: 0.4rem; letter-spacing: -0.01em; }
.modal-message { font-size: 0.875rem; color: var(--text-secondary); line-height: 1.65; margin-bottom: 1.75rem; }
.modal-actions { display: flex; justify-content: flex-end; gap: 0.65rem; }

.modal-overlay[data-type="fulfill"] #modalConfirm  { background: var(--fulfilled-accent); border-color: var(--fulfilled-accent); color: #fff; }
.modal-overlay[data-type="fulfill"] #modalConfirm:hover { filter: brightness(0.92); }
.modal-overlay[data-type="danger"]  #modalConfirm  { background: var(--overdue-accent);   border-color: var(--overdue-accent); }
.modal-overlay[data-type="danger"]  #modalConfirm:hover { filter: brightness(0.9); }

/* ===================================================================
   UTILITY
   =================================================================== */
.text-muted     { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }

/* ===================================================================
   RESPONSIVE
   =================================================================== */
@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  :root { --sidebar-w: 0px; }
  .sidebar { display: none; }
  .page-content { margin-left: 0; }
  .page-body { padding: 1.25rem 1rem 2rem; }
  .topbar    { padding: 0.75rem 1rem; }
}
@media (max-width: 768px) {
  .stat-grid   { grid-template-columns: repeat(2, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .filter-bar  { flex-direction: column; align-items: flex-start; }
  .search-input{ width: 100%; }
  .col-agency,
  .col-freq    { display: none; }
}
@media (max-width: 480px) {
  .stat-grid { grid-template-columns: 1fr 1fr; }
}
