/* Internal Job Postings (jobs.dompkg.com) - styles.css
   Navy/slate foundation with Dominion blue accents, per WIP Inspections
   template reference (frontend-design/APP-TEMPLATE-REFERENCE.md). */

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

:root {
  --bg:        #0b0e17;
  --surface:   #131726;
  --card:      #171c2e;
  --card-2:    #1d2338;
  --border:    #2a3050;
  --text:      #e7ecf5;
  --muted:     #8a92ab;
  --primary:   #3b82f6;
  --primary-2: #2563eb;
  --hero-1:    #1e3a8a;
  --hero-2:    #1e40af;
  --success:   #34d399;
  --warning:   #fbbf24;
  --danger:    #f87171;
}

[data-theme="light"] {
  --bg:        #f1f5f9;
  --surface:   #ffffff;
  --card:      #ffffff;
  --card-2:    #f8fafc;
  --border:    #d7e0ee;
  --text:      #101828;
  --muted:     #5b6478;
  --primary:   #2563eb;
  --primary-2: #1d4ed8;
  --hero-1:    #1d4ed8;
  --hero-2:    #2563eb;
  --success:   #16a34a;
  --warning:   #d97706;
  --danger:    #dc2626;
}

html, body {
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 14px;
  overflow-x: hidden;
}

#root { min-height: calc(100vh - 36px); overflow-x: hidden; }

button, input, select, textarea { font-family: inherit; }

.app { display: flex; flex-direction: column; min-height: calc(100vh - 36px); }

/* ── Header ─────────────────────────────────────────────────────────── */
.dp-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.dp-header .hdr-left {
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  min-width: 90px;
}
.dp-header .hdr-center {
  flex: 1;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 16px;
  font-weight: 700;
}
.dp-header .hdr-center .dp-badge {
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 800; flex-shrink: 0;
}
.dp-header .hdr-right {
  display: flex; align-items: center; gap: 10px; min-width: 90px; justify-content: flex-end;
}
.theme-btn {
  background: none; border: 1px solid var(--border); border-radius: 8px;
  padding: 6px 12px; cursor: pointer; font-size: 13px; color: var(--muted);
  transition: all .15s;
}
.theme-btn:hover { border-color: var(--primary); color: var(--primary); }

.dp-nav {
  display: flex; gap: 4px; padding: 0 24px; background: var(--surface);
  border-bottom: 1px solid var(--border); flex-wrap: wrap; flex-shrink: 0;
}
.dp-nav .nav-tab {
  padding: 12px 16px; cursor: pointer; font-size: 13px; font-weight: 600;
  color: var(--muted); border-bottom: 2px solid transparent; transition: all .15s;
  background: none; border-left: none; border-right: none; border-top: none;
}
.dp-nav .nav-tab:hover { color: var(--text); }
.dp-nav .nav-tab.active { color: var(--primary); border-bottom-color: var(--primary); }

/* ── Layout shell ───────────────────────────────────────────────────── */
.dp-main { flex: 1; padding: 24px; max-width: 1100px; width: 100%; margin: 0 auto; }

/* ── Hero panel ─────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--hero-1), var(--hero-2));
  border-radius: 20px;
  padding: 32px;
  color: #fff;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}
.hero-copy { max-width: 620px; }
.hero-eyebrow {
  font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase;
  color: #bfdbfe; font-weight: 700; margin-bottom: 10px;
}
.hero-title { font-size: 34px; font-weight: 800; line-height: 1.1; margin-bottom: 12px; }
.hero-sub { font-size: 14px; color: #dbeafe; line-height: 1.6; }
.hero-kpis { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-kpi {
  background: rgba(255,255,255,.12); border: 1px solid rgba(255,255,255,.18);
  border-radius: 12px; padding: 14px 18px; min-width: 92px; text-align: center;
}
.hero-kpi .kpi-num { font-size: 24px; font-weight: 800; }
.hero-kpi .kpi-label { font-size: 10px; text-transform: uppercase; letter-spacing: .5px; color: #dbeafe; margin-top: 4px; }

/* ── Panels / cards ─────────────────────────────────────────────────── */
.panel-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 24px;
  margin-bottom: 20px;
}
.panel-eyebrow {
  font-size: 11px; letter-spacing: 1px; text-transform: uppercase;
  color: var(--primary); font-weight: 700; margin-bottom: 8px;
}
.panel-title { font-size: 20px; font-weight: 700; margin-bottom: 6px; }
.panel-desc { font-size: 13px; color: var(--muted); margin-bottom: 20px; line-height: 1.6; }

/* ── Form grid ──────────────────────────────────────────────────────── */
.form-grid { display: grid; gap: 16px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row.single { grid-template-columns: 1fr; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label {
  font-size: 11px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); font-weight: 700;
}
.field input[type="text"],
.field select,
.field textarea,
.field input[type="date"] {
  background: var(--card-2); border: 1px solid var(--border); color: var(--text);
  padding: 11px 12px; border-radius: 10px; font-size: 14px; outline: none; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { resize: vertical; min-height: 90px; }
.field .hint { font-size: 11px; color: var(--muted); }

fieldset.confirm-group {
  border: 1px solid var(--border); border-radius: 12px; padding: 16px;
  display: flex; align-items: flex-start; gap: 10px;
}
fieldset.confirm-group legend { padding: 0 6px; font-size: 11px; text-transform: uppercase; color: var(--muted); font-weight: 700; }
fieldset.confirm-group input[type="checkbox"] { margin-top: 3px; width: 18px; height: 18px; flex-shrink: 0; accent-color: var(--primary); }
fieldset.confirm-group label { font-size: 13px; color: var(--text); line-height: 1.5; }

.btn {
  border: none; border-radius: 10px; padding: 13px 24px; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: all .15s;
}
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-2); }
.btn-primary:disabled { opacity: .55; cursor: not-allowed; }
.btn-secondary { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-secondary:hover { border-color: var(--primary); color: var(--primary); }
.btn-danger { background: transparent; border: 1px solid var(--danger); color: var(--danger); }
.btn-danger:hover { background: rgba(248,113,113,.12); }
.btn-block { width: 100%; }

.error-banner {
  background: rgba(248,113,113,.12); border: 1px solid var(--danger); color: var(--danger);
  border-radius: 10px; padding: 12px 16px; font-size: 13px; margin-bottom: 16px;
}
.error-banner ul { margin: 6px 0 0 18px; }

/* ── Success modal ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(4,7,15,.72);
  display: flex; align-items: center; justify-content: center; z-index: 999; padding: 16px;
}
.success-modal {
  background: var(--card); border: 1px solid var(--border); border-radius: 20px;
  width: 100%; max-width: 420px; padding: 32px 28px; text-align: center;
  box-shadow: 0 24px 70px rgba(0,0,0,.5);
  animation: modal-pop .22s ease-out;
}
@keyframes modal-pop { from { opacity: 0; transform: translateY(12px) scale(.97);} to { opacity: 1; transform: translateY(0) scale(1);} }
.success-icon {
  width: 68px; height: 68px; border-radius: 50%; margin: 0 auto 18px;
  background: rgba(52,211,153,.14); color: var(--success);
  display: flex; align-items: center; justify-content: center; font-size: 32px;
}
.success-modal h2 { font-size: 20px; margin-bottom: 8px; }
.success-modal p { font-size: 13px; color: var(--muted); line-height: 1.6; margin-bottom: 4px; }
.confirmation-box {
  margin: 18px 0; background: var(--card-2); border: 1px dashed var(--border);
  border-radius: 12px; padding: 14px; font-size: 11px; text-transform: uppercase;
  letter-spacing: .5px; color: var(--muted);
}
.confirmation-box .conf-number {
  display: block; margin-top: 6px; font-size: 20px; font-weight: 800; letter-spacing: 1px;
  color: var(--primary); text-transform: none;
}
.notify-status { font-size: 11px; color: var(--muted); margin-top: 10px; }

/* ── Tables (admin) ─────────────────────────────────────────────────── */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: 12px; }
table { width: 100%; border-collapse: collapse; font-size: 13px; min-width: 560px; }
thead th {
  background: var(--card-2); color: var(--muted); font-size: 10px; text-transform: uppercase;
  letter-spacing: .5px; padding: 10px 12px; text-align: left; white-space: nowrap;
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 10px 12px; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: top; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover { background: rgba(59,130,246,.06); }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .4px; }
.badge-published { background: rgba(52,211,153,.14); color: var(--success); }
.badge-draft { background: rgba(148,163,184,.16); color: var(--muted); }
.badge-closed, .badge-inactive { background: rgba(248,113,113,.14); color: var(--danger); }

.row-actions { display: flex; gap: 6px; flex-wrap: wrap; }
.row-actions button { font-size: 11px; padding: 6px 10px; }

/* ── KPI grid (admin dashboard) ─────────────────────────────────────── */
.kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 20px; }
.kpi-card { background: var(--card); border: 1px solid var(--border); border-radius: 14px; padding: 18px; }
.kpi-card .kpi-label { font-size: 11px; text-transform: uppercase; color: var(--muted); letter-spacing: .5px; margin-bottom: 8px; }
.kpi-card .kpi-value { font-size: 26px; font-weight: 800; color: var(--primary); }

/* ── Modal (admin add/edit posting) ────────────────────────────────── */
.admin-modal-inner {
  background: var(--card); border: 1px solid var(--border); border-radius: 16px;
  width: 100%; max-width: 560px; max-height: 88vh; overflow-y: auto; padding: 28px;
}
.admin-modal-inner h3 { font-size: 18px; margin-bottom: 4px; }
.admin-modal-inner .modal-sub { font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; margin-top: 20px; }

.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.toolbar h2 { font-size: 18px; }

.empty-state { text-align: center; padding: 40px 16px; color: var(--muted); font-size: 13px; }

.loading-screen {
  display: flex; align-items: center; justify-content: center; height: 60vh;
  color: var(--muted); font-size: 14px; gap: 10px;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .dp-header { padding: 10px 14px; }
  .dp-header .hdr-center { font-size: 14px; }
  .dp-main { padding: 14px; }
  .hero { padding: 22px; border-radius: 16px; }
  .hero-title { font-size: 26px; }
  .hero-kpis { width: 100%; justify-content: space-between; }
  .hero-kpi { flex: 1; min-width: 0; padding: 10px 8px; }
  .form-row { grid-template-columns: 1fr; }
  .panel-card { padding: 18px; border-radius: 14px; }
  .kpi-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
}

@media (max-width: 480px) {
  .dp-header { flex-wrap: nowrap; }
  .dp-header .hdr-left { display: none; }
  .hero-eyebrow { font-size: 10px; }
  .hero-title { font-size: 22px; }
  .success-modal { padding: 26px 20px; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* Focus visibility for accessibility */
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible, textarea:focus-visible {
  outline: 2px solid var(--primary); outline-offset: 2px;
}
