/* ── Reset & base ──────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand:      #830B2C;
  --brand-light:#a8143a;
  --accent:     #e8a020;
  --bg:         #f4f6f9;
  --surface:    #ffffff;
  --border:     #d1d9e0;
  --text:       #1e293b;
  --muted:      #64748b;
  --danger:     #dc2626;
  --success:    #16a34a;
  --pending:    #d97706;
  --radius:     8px;
  --shadow:     0 2px 8px rgba(0,0,0,.08);
}

body {
  font-family: 'Calibri', 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ── Header ─────────────────────────────────────────────────────────────────── */
header {
  background: var(--brand);
  color: #fff;
  padding: .5rem 1.5rem;
  display: flex;
  align-items: center;
  gap: .5rem;
  min-height: 49px;
  box-shadow: 0 2px 6px rgba(0,0,0,.2);
  position: relative;
}
header .header-logo { height: 34px; width: auto; object-fit: contain; flex-shrink: 0; }
header .logo { font-size: 1.25rem; font-weight: 700; letter-spacing: .03em; font-family: 'Calibri', sans-serif; }
header .logo span { color: var(--accent); }

/* Hamburger button (right side, replaces inline nav buttons) */
.header-menu-btn {
  margin-left: auto;
  background: transparent;
  border: 1.5px solid rgba(255,255,255,.55);
  border-radius: 8px;
  width: 42px;
  height: 36px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
  transition: background .15s, border-color .15s;
}
.header-menu-btn:hover { background: rgba(255,255,255,.18); border-color: rgba(255,255,255,.9); }
.header-menu-btn .header-menu-bar {
  display: block;
  width: 22px;
  height: 2.5px;
  background: #fff;
  border-radius: 2px;
}

/* Dropdown nav panel — hidden by default, shown when .open */
header nav.header-menu {
  position: absolute;
  top: 100%;
  right: 1rem;
  margin-top: .35rem;
  background: var(--brand);
  border: 1.5px solid rgba(255,255,255,.35);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
  display: none;
  flex-direction: column;
  min-width: 200px;
  padding: .4rem;
  z-index: 90;
}
header nav.header-menu.open { display: flex; }
header nav.header-menu a {
  color: #fff;
  text-decoration: none;
  padding: .55rem .85rem;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 600;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: background .12s;
}
header nav.header-menu a:hover  { background: rgba(255,255,255,.18); }
header nav.header-menu a.active { background: rgba(255,255,255,.22); }

/* ── Layout ─────────────────────────────────────────────────────────────────── */
.container { max-width: 960px; margin: 0 auto; padding: 2rem 1.5rem; width: 100%; flex: 1 0 auto; }
.container-wide { max-width: 1400px; margin: 0 auto; padding: 2rem 1.5rem; width: 100%; flex: 1 0 auto; }
header .page-title { display: none !important; }

/* ── Cards ───────────────────────────────────────────────────────────────────── */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 1.75rem 2rem;
  margin-bottom: 1.5rem;
}
.card h2 { font-size: 1.15rem; color: var(--brand); margin-bottom: 1.25rem; padding-bottom: .6rem; border-bottom: 2px solid var(--border); }

/* ── Forms ───────────────────────────────────────────────────────────────────── */
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem 1.5rem; }
.form-grid .full { grid-column: 1 / -1; }

.field { display: flex; flex-direction: column; gap: .35rem; }
.field label { font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: .02em; text-transform: uppercase; }
.field label .req { color: var(--danger); margin-left: .15rem; }

input[type=text], input[type=email], input[type=tel], input[type=date],
input[type=number], input[type=password], select, textarea {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  padding: .55rem .8rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font: inherit;
  font-size: .95rem;
  background: #fff;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--brand-light);
  box-shadow: 0 0 0 3px rgba(37,99,168,.15);
}
textarea { resize: vertical; min-height: 90px; }

.file-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  padding: 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: #fafbfc;
  position: relative;
}
.file-area:hover, .file-area.dragover { border-color: var(--brand-light); background: #eff6ff; }
.file-area input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%; }
.file-area .icon { font-size: 1.8rem; margin-bottom: .4rem; }
.file-area .hint { font-size: .8rem; color: var(--muted); }
.file-name { font-size: .85rem; color: var(--success); margin-top: .3rem; font-weight: 600; }

/* ── Buttons ─────────────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .6rem 1.4rem;
  border: none; border-radius: var(--radius);
  font: 600 .95rem/1 inherit;
  cursor: pointer;
  transition: opacity .15s, transform .1s;
  text-decoration: none;
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary   { background: var(--brand);       color: #fff; }
.btn-secondary { background: var(--brand-light);  color: #fff; }
.btn-success   { background: var(--success);      color: #fff; }
.btn-danger    { background: var(--danger);        color: #fff; }
.btn-outline   { background: transparent; border: 1.5px solid var(--border); color: var(--text); }
.btn-sm { padding: .35rem .9rem; font-size: .82rem; }
.btn-primary:hover   { opacity: .88; }
.btn-secondary:hover { opacity: .88; }
.btn-success:hover   { opacity: .88; }
.btn-danger:hover    { opacity: .88; }
.btn-outline:hover   { background: var(--bg); }

/* ── Badges ──────────────────────────────────────────────────────────────────── */
.badge {
  display: inline-block; padding: .2rem .6rem;
  border-radius: 99px; font-size: .75rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase;
}
.badge-pending  { background: #fef3c7; color: #92400e; }
.badge-approved { background: #dcfce7; color: #14532d; }
.badge-rejected { background: #fee2e2; color: #7f1d1d; }

/* ── Alerts ──────────────────────────────────────────────────────────────────── */
.alert {
  padding: .85rem 1.1rem; border-radius: var(--radius);
  font-size: .9rem; margin-bottom: 1rem; display: none;
}
.alert.show { display: block; }
.alert-success { background: #dcfce7; color: #14532d; border: 1px solid #bbf7d0; }
.alert-error   { background: #fee2e2; color: #7f1d1d; border: 1px solid #fecaca; }
.alert-info    { background: #dbeafe; color: #1e3a8a; border: 1px solid #bfdbfe; }

/* ── Page hero ───────────────────────────────────────────────────────────────── */
.hero { background: var(--brand); color: #fff; padding: 1.75rem 2rem; text-align: center; }
.hero h1 { font-size: 1.35rem; margin-bottom: .35rem; }
.hero p  { font-size: .85rem; opacity: .8; max-width: 600px; margin: 0 auto; }
.hero .accent { color: var(--accent); }

/* ── Schedule / Gantt ────────────────────────────────────────────────────────── */
.schedule-controls {
  display: flex; flex-wrap: wrap; gap: .75rem; align-items: center;
  margin-bottom: 1.25rem;
}
.schedule-controls label { font-size: .85rem; font-weight: 600; color: var(--muted); }

.gantt-wrapper { overflow-x: auto; }
.gantt-table   { width: 100%; border-collapse: collapse; font-size: .82rem; min-width: 900px; }
.gantt-table th {
  background: var(--brand); color: #fff;
  padding: .5rem .6rem;
  text-align: left; white-space: nowrap;
  position: sticky; top: 0; z-index: 2;
}
.gantt-table td { padding: .5rem .6rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.gantt-table tr:hover td { background: #f8fafc; }

.gantt-bar-cell { position: relative; padding: 0 !important; height: 36px; }
.gantt-bar {
  position: absolute; top: 50%; transform: translateY(-50%);
  height: 22px; border-radius: 4px;
  display: flex; align-items: center; padding: 0 6px;
  font-size: .72rem; font-weight: 600; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  cursor: default;
}
.gantt-month-header { text-align: center; background: #1e4d7b; font-size: .78rem; }
.gantt-day-header   { text-align: center; background: var(--brand); font-size: .72rem; width: 28px; }

.month-nav { display: flex; gap: .5rem; align-items: center; }
.month-nav button { background: none; border: 1.5px solid var(--border); border-radius: 6px; padding: .3rem .7rem; cursor: pointer; font-size: 1rem; }
.month-nav button:hover { background: var(--bg); }
.month-nav .current-label { font-weight: 700; font-size: 1rem; min-width: 140px; text-align: center; }

/* ── List view ───────────────────────────────────────────────────────────────── */
.sow-list { display: flex; flex-direction: column; gap: .75rem; }
.sow-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 5px solid var(--brand-light);
  border-radius: var(--radius);
  padding: 1rem 1.25rem;
  display: grid; grid-template-columns: 1fr auto;
  gap: .25rem .5rem;
}
.sow-card h3 { font-size: .95rem; font-weight: 700; }
.sow-card .meta { font-size: .8rem; color: var(--muted); }

/* ── Admin table ─────────────────────────────────────────────────────────────── */
.admin-table { width: 100%; border-collapse: collapse; font-size: .85rem; }
.admin-table th { background: var(--brand); color: #fff; padding: .6rem .8rem; text-align: left; white-space: nowrap; }
.admin-table td { padding: .55rem .8rem; border-bottom: 1px solid var(--border); vertical-align: middle; }
.admin-table tr:hover td { background: #f8fafc; }

.stats-grid { display: grid; grid-template-columns: repeat(4,1fr); gap: 1rem; margin-bottom: 1.5rem; }
.stat-card  { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.2rem; text-align: center; }
.stat-card .num  { font-size: 2rem; font-weight: 800; color: var(--brand); }
.stat-card .lbl  { font-size: .8rem; color: var(--muted); text-transform: uppercase; font-weight: 600; }

/* ── Login ───────────────────────────────────────────────────────────────────── */
.login-wrap {
  flex: 1 0 auto;
  min-height: calc(100vh - 116px);
  display: flex; align-items: center; justify-content: center;
}
.login-box {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 2.5rem; width: 100%; max-width: 380px;
}
.login-box h2 { text-align: center; color: var(--brand); margin-bottom: 1.5rem; }

/* ── Tabs ────────────────────────────────────────────────────────────────────── */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 1.25rem; }
.tab-btn {
  padding: .6rem 1.4rem; border: none; background: none; cursor: pointer;
  font: 600 .9rem inherit; color: var(--muted); border-bottom: 3px solid transparent; margin-bottom: -2px;
  transition: color .15s, border-color .15s;
}
.tab-btn.active { color: var(--brand); border-bottom-color: var(--brand); }
.tab-content { display: none; } .tab-content.active { display: block; }

/* ── Util ────────────────────────────────────────────────────────────────────── */
.flex { display: flex; } .gap-1 { gap: .5rem; } .gap-2 { gap: 1rem; }
.mt-1 { margin-top: .5rem; } .mt-2 { margin-top: 1rem; }
.text-right { text-align: right; }
.text-muted  { color: var(--muted); font-size: .85rem; }
.spinner {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: spin .6s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Modal ───────────────────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 1rem;
}
.modal-overlay.hidden { display: none; }

/* ── Responsive ──────────────────────────────────────────────────────────────── */
@media (max-width: 700px) {
  .form-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  header .logo { font-size: 1rem; }
}

@media (max-width: 480px) {
  /* Header */
  header { padding: .4rem .75rem; gap: .35rem; }
  header .header-logo { height: 28px; }

  /* Layout */
  .container, .container-wide { padding: 1rem .75rem; }
  .card { padding: 1rem 1rem; margin-bottom: 1rem; }
  .card h2 { font-size: 1rem; margin-bottom: .75rem; }

  /* Forms */
  .form-grid { gap: .75rem; }
  .field label { font-size: .78rem; }
  input[type=text], input[type=email], input[type=tel], input[type=date],
  input[type=number], input[type=password], select, textarea { font-size: 16px; padding: .5rem .6rem; }

  /* Buttons */
  .btn { padding: .5rem 1rem; font-size: .85rem; }
  .btn-sm { padding: .35rem .7rem; font-size: .78rem; }

  /* Stats */
  .stats-grid { grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1rem; }
  .stat-card { padding: .75rem .5rem; }
  .stat-card .num { font-size: 1.5rem; }
  .stat-card .lbl { font-size: .7rem; }

  /* Tabs */
  .tabs { flex-wrap: wrap; gap: 0; }
  .tab-btn { padding: .45rem .75rem; font-size: .8rem; }

  /* Login */
  .login-wrap { padding: 1rem; }
  .login-box { padding: 1.5rem 1.25rem; max-width: 100%; }

  /* Admin table */
  .admin-table { font-size: .75rem; }
  .admin-table th { padding: .4rem .5rem; }
  .admin-table td { padding: .4rem .5rem; }

  /* Schedule */
  .gantt-table { min-width: 600px; }
  .month-nav .current-label { min-width: 100px; font-size: .9rem; }

  /* SOW cards */
  .sow-card { grid-template-columns: 1fr; }

  /* Alerts */
  .alert { font-size: .82rem; padding: .7rem .85rem; }

  /* File areas */
  .file-area { padding: .75rem; }
  .file-area .icon { font-size: 1.4rem; }

  /* Modal */
  .modal-overlay { padding: .5rem; }
}

/* Site footer banner — matches header bar height, sticks to bottom */
.page-footer { width: 100%; height: 58px; margin-top: auto; line-height: 0; overflow: hidden; background: var(--brand); flex-shrink: 0; }
.page-footer img { width: 100%; height: 100%; display: block; object-fit: cover; object-position: center; }
@media (max-width: 480px) {
  .page-footer { height: 49px; }
}

