/* eStore Hiring (Hope) - dashboard styling
   Values taken from estore-design: colour.md, typography.md, layout.md,
   components.md, forms.md. Where a value looks arbitrary it is quoted from
   those modules, which say the CSS is the source of truth rather than the
   documented tokens. Don't "tidy" these numbers. */

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

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

body {
  font-family: Manrope, Arial, sans-serif;
  background: #F6F8FA;
  color: #1E293B;
  font-size: 13px;
}

/* ------------------------------------------------------------------ header */

.header { background: #1a1a2e; padding: 0; position: sticky; top: 0; z-index: 50; }
.header-top {
  display: flex; align-items: stretch; justify-content: space-between;
  min-height: 70px;
}
.logo-zone {
  width: 220px; flex-shrink: 0; background: #131325;
  display: flex; align-items: center; justify-content: center;
  padding: 0 18px; height: 100%;
}
/* Dashboard header: reversed asset, sits directly on #131325 with NO white
   pill. The pill is for login/admin/invite pages only (logo.md).
   SPEC CONFLICT, flagged to Leigh: logo.md specifies height 36px inside a
   220px zone, but the published wordmark is 353x44, so 36px tall renders
   289px wide against 184px of available space. max-width keeps it inside the
   zone; the effective height lands near 23px. Restore the flat 36px once the
   asset Regina and Bobby actually ship is available. */
.logo {
  height: 36px; width: auto; max-width: 100%;
  object-fit: contain; padding: 0; background: transparent;
}

.accent-bar { height: 3px; background: #F3DA00; }

.header-meta {
  text-align: right; font-size: 11px; color: rgba(255,255,255,0.5);
  display: flex; flex-direction: column; justify-content: center;
  padding: 0 32px 0 24px;
}
.header-meta strong {
  display: block; color: rgba(255,255,255,0.75);
  text-transform: uppercase; letter-spacing: 1px; font-size: 10px;
}

/* ---------------------------------------------------------------- auth bar */

.auth-bar {
  background: #f0f2f5; padding: 6px 32px; min-height: 36px;
  display: flex; align-items: center; justify-content: flex-end; gap: 16px;
  border-bottom: 1px solid #E2E8F0; font-size: 12px; color: #64748B;
}
.auth-bar a, .auth-bar button {
  font-size: 12px; color: #1a1a2e; text-decoration: none; font-weight: 600;
  border: none; background: none; cursor: pointer;
  font-family: Manrope, Arial, sans-serif;
}
.auth-bar a:hover, .auth-bar button:hover { color: #D4AF00; }

/* ------------------------------------------------------- shell and sidebar */

.app-shell { display: flex; height: calc(100vh - 115px); }

.sidebar {
  width: 220px; flex-shrink: 0; background: #1a1a2e;
  display: flex; flex-direction: column; overflow-y: auto; height: 100%;
  transition: transform 0.25s ease, width 0.25s ease;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.15); border-radius: 2px; }
.sidebar-section { padding: 16px 0 8px; border-bottom: 1px solid rgba(255,255,255,0.06); }
.sidebar-section:last-child { border-bottom: none; flex: 1; }
.sidebar-section-label {
  font-size: 9px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 1.5px; color: rgba(255,255,255,0.3); padding: 0 18px 6px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px;
  font-size: 12px; font-weight: 600; color: rgba(255,255,255,0.55);
  cursor: pointer; border-left: 3px solid transparent;
  transition: all 0.15s; text-decoration: none; white-space: nowrap;
}
.nav-item:hover { color: rgba(255,255,255,0.9); background: rgba(255,255,255,0.06); }
.nav-item.active {
  color: #F3DA00; border-left-color: #F3DA00; background: rgba(243,218,0,0.08);
}
.nav-item .nav-icon { font-size: 14px; width: 18px; text-align: center; flex-shrink: 0; }
.nav-badge {
  margin-left: auto; background: rgba(229,57,53,0.25); color: #FF6B6B;
  font-size: 9px; font-weight: 700; padding: 2px 6px; border-radius: 10px;
  border: 1px solid rgba(229,57,53,0.3);
}
.nav-badge.med {
  background: rgba(244,168,37,0.2); color: #F4A825; border-color: rgba(244,168,37,0.3);
}

.content {
  background: #F6F8FA; flex: 1;
  /* Without min-width:0 a wide table stops this flex column shrinking. This
     cost real debugging time during Bobby's redesign - see layout.md. */
  min-width: 0;
  overflow-y: auto; height: 100%; padding: 24px 32px;
}

.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* ------------------------------------------------------------------- cards */

.stat-cards { display: flex; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.stat-card {
  background: #ffffff; border: 1px solid #E2E8F0; border-radius: 10px;
  padding: 18px 20px; flex: 1; min-width: 120px;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.stat-card-label {
  font-size: 11px; font-weight: 700; color: #64748B;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}
.stat-card-value { font-size: 22px; font-weight: 800; color: #1E293B; }
.stat-card-sub { font-size: 11px; color: #94A3B8; margin-top: 3px; }

.chart-card {
  background: #ffffff; border: 1px solid #E2E8F0; border-radius: 10px;
  padding: 20px 24px; box-shadow: 0 1px 4px rgba(0,0,0,0.05);
}
.chart-card-title { font-size: 13px; font-weight: 700; color: #1E293B; }
.chart-card-sub { font-size: 11px; font-weight: 400; color: #94A3B8; margin-top: 4px; }

.panel { padding: 0; overflow: hidden; }
.panel-header {
  padding: 14px 18px; border-bottom: 1px solid #E2E8F0; background: #F8FAFC;
  display: flex; align-items: center; justify-content: space-between;
}
.panel-header-title {
  font-size: 12px; font-weight: 700; color: #1E293B;
  text-transform: uppercase; letter-spacing: 0.5px;
}

/* Greeting bar - full-width dark navy, not a floating card. */
.greeting {
  background: #1a1a2e; border-radius: 10px; padding: 20px 24px; margin-bottom: 20px;
  display: flex; align-items: center; justify-content: space-between;
  flex-wrap: wrap; gap: 12px;
}
.greeting-left { display: flex; align-items: center; gap: 14px; }
.greeting-icon {
  width: 44px; height: 44px; background: rgba(255,255,255,0.1); border-radius: 10px;
  display: flex; align-items: center; justify-content: center; font-size: 20px;
}
/* 18px display heading, deliberately NOT the 22px stat-card metric tier. */
.greeting-title { font-size: 18px; font-weight: 800; color: #fff; }
.greeting-sub { font-size: 12px; color: rgba(255,255,255,0.5); margin-top: 2px; }
.greeting-time { font-size: 11px; color: rgba(255,255,255,0.35); }

/* -------------------------------------------------------------- AI insight */

.ai-insight {
  background: #FAF5FF; border: 1px solid #DDD6FE; border-radius: 10px;
  padding: 20px 24px; margin-bottom: 20px;
}
.ai-insight-badge {
  display: inline-block; background: #EDE9FE; color: #5B21B6;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; padding: 3px 10px; border-radius: 100px; margin-bottom: 8px;
}

/* ------------------------------------------------------------------ badges */

.badge {
  display: inline-block; padding: 3px 10px; border-radius: 100px;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; white-space: nowrap; border: 1px solid transparent;
}
.badge-HIGH     { background: #FEE2E2; color: #DC2626; border-color: #FECACA; }
.badge-MEDIUM   { background: #FEF3C7; color: #D97706; border-color: #FDE68A; }
.badge-LOW      { background: #DCFCE7; color: #16A34A; border-color: #BBF7D0; }
.badge-admin    { background: #FFFDE7; color: #92700A; border-color: #FDE68A; }
.badge-viewer   { background: #F1F5F9; color: #64748B; border-color: #E2E8F0; }
.badge-invited  { background: #FEF3C7; color: #D97706; border-color: #FDE68A; }
.badge-active   { background: #DCFCE7; color: #16A34A; border-color: #BBF7D0; }

/* ----------------------------------------------------------------- buttons */

.btn {
  background: #1a1a2e; color: #F3DA00; border: none; border-radius: 100px;
  padding: 8px 20px; font-family: Manrope, Arial, sans-serif;
  font-size: 12px; font-weight: 700; cursor: pointer;
  transition: all 0.2s; letter-spacing: 0.3px; text-decoration: none;
  display: inline-block;
}
.btn:hover { background: #2d2d4e; box-shadow: 0 2px 8px rgba(26,26,46,0.2); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-sm {
  background: #FEE2E2; color: #DC2626; border: 1px solid #FECACA;
  border-radius: 100px; padding: 4px 12px;
  font-family: Manrope, Arial, sans-serif; font-size: 11px; font-weight: 600;
  cursor: pointer;
}

.btn-ghost {
  background: none; border: 1px solid #CBD5E1; border-radius: 6px;
  color: #64748B; font-size: 11px; font-weight: 600; padding: 6px 12px;
  cursor: pointer; font-family: Manrope, Arial, sans-serif; text-decoration: none;
}
.btn-ghost:hover { border-color: #1a1a2e; color: #1a1a2e; }

/* ------------------------------------------------------------------ inputs */

input[type="text"], input[type="email"], input[type="date"], textarea, select {
  background: #ffffff; border: 1px solid #CBD5E1; border-radius: 8px;
  padding: 10px 14px; color: #1E293B;
  font-family: Manrope, Arial, sans-serif; font-size: 13px;
  outline: none; transition: border-color 0.2s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.04);
}
input:focus, textarea:focus, select:focus {
  border-color: #1a1a2e; box-shadow: 0 0 0 3px rgba(26,26,46,0.08);
}
textarea { resize: vertical; line-height: 1.5; }
select { cursor: pointer; }

label {
  display: block; font-size: 11px; font-weight: 600; color: #64748B;
  text-transform: uppercase; letter-spacing: 0.5px; margin-bottom: 6px;
}

.field { margin-bottom: 16px; }
.field-error { font-size: 12px; color: #DC2626; margin-top: 6px; }
input.invalid, textarea.invalid {
  border-color: #DC2626; box-shadow: 0 0 0 3px rgba(220,38,38,0.08);
}

.msg { font-size: 12px; margin-top: 8px; min-height: 18px; }
.msg.ok  { color: #16A34A; }
.msg.err { color: #DC2626; }

/* ------------------------------------------------------------------ tables */

.table-wrap {
  border-radius: 10px; overflow: hidden; border: 1px solid #E2E8F0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
table { width: 100%; border-collapse: collapse; font-size: 13px; background: #fff; }
thead.dark th {
  background: #1a1a2e; color: rgba(255,255,255,0.7);
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.8px; padding: 10px 12px; text-align: left;
}
thead.light th {
  background: #F8FAFC; color: #475569;
  font-size: 10px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.6px; padding: 8px 12px; text-align: left;
  border-bottom: 1px solid #E2E8F0;
}
tbody td {
  padding: 10px 12px; border-bottom: 1px solid #F1F5F9;
  vertical-align: middle; color: #1E293B;
}
tbody tr:hover { background: #FFFBEB; }
tbody tr.total-row, tbody tr.expanded { background: #FFFDE7; }
td.num { text-align: right; font-variant-numeric: tabular-nums; }
td.primary { font-weight: 700; }

/* ------------------------------------------------------------- filter bar  */

.filters { display: flex; gap: 12px; margin-bottom: 20px; flex-wrap: wrap; align-items: center; }
.filters .right { margin-left: auto; }

.page-head { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 20px; gap: 16px; }
.page-title { font-size: 20px; font-weight: 800; color: #1E293B; }
.page-sub { font-size: 12px; color: #64748B; margin-top: 4px; }

.empty {
  text-align: center; padding: 40px 24px; color: #94A3B8; font-size: 13px;
}

.muted { color: #64748B; }
.meta { font-size: 11px; color: #94A3B8; }

/* ------------------------------------------------------------- login page  */
/* Distinct from the dashboard: full-screen dark with a centred card. */

.auth-body {
  background: #111; min-height: 100vh;
  display: flex; align-items: center; justify-content: center; padding: 24px;
}
.auth-card {
  background: #1C1C1C; border-radius: 16px; width: 100%; max-width: 420px;
  overflow: hidden; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
}
.auth-card-header { padding: 32px 36px 0; }
/* Login/admin/invite: standard asset in a white pill, 28px. Without the pill
   the charcoal letterforms disappear against the dark card. */
.auth-body .logo, .admin-body .logo {
  height: 28px; padding: 5px 10px; background: #fff; border-radius: 6px;
  display: block; margin-bottom: 24px;
}
.auth-accent { height: 3px; background: #F3DA00; margin: 0 -36px; }
.auth-headline { padding: 28px 0 0; font-size: 24px; font-weight: 800; color: #fff; }
.auth-sub { font-size: 12px; color: rgba(255,255,255,0.4); margin-top: 4px; padding-bottom: 28px; }
.auth-card-body { padding: 28px 36px 36px; }

.btn-google {
  width: 100%; background: #F3DA00; color: #333; border: none;
  border-radius: 100px; padding: 13px;
  font-family: Manrope, Arial, sans-serif; font-size: 14px; font-weight: 700;
  cursor: pointer; transition: opacity 0.2s; text-decoration: none;
  display: flex; align-items: center; justify-content: center; gap: 10px;
}
.btn-google:hover { opacity: 0.85; }

/* Banner variant, used consistently for every error state in this app. */
.auth-error {
  background: rgba(229,57,53,0.12); border: 1px solid rgba(229,57,53,0.3);
  color: #E53935; font-size: 12px; padding: 10px 14px; border-radius: 8px;
  margin: 4px 0 18px; display: none;
}
.auth-error.visible { display: block; }
.auth-foot { font-size: 11px; color: rgba(255,255,255,0.4); margin-top: 18px; text-align: center; }

/* -------------------------------------------------------------- responsive */

@media (max-width: 900px) {
  .sidebar {
    position: fixed; top: 115px; left: 0; bottom: 0; z-index: 60;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }
  .content { padding: 16px; }
  .logo-zone { width: 160px; }
}
@media (max-width: 700px) {
  .stat-cards { flex-direction: column; }
  .header-meta { padding: 0 16px; }
  .auth-bar { padding: 6px 16px; }
}

/* ------------------------------------------------------------ admin page  */
/* Utility surface, not a dashboard: single card, 800px, no auth bar,
   light thead. Deliberately stripped down (forms.md). */

.admin-body { background: #F6F8FA; padding: 32px; min-height: 100vh; }
.admin-head { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.admin-body .logo { margin-bottom: 0; }
.admin-head h1 { font-size: 20px; font-weight: 800; color: #1E293B; }
.back {
  font-size: 12px; color: #1a1a2e; text-decoration: none; font-weight: 600;
  margin-left: auto; border-bottom: 1px solid #F3DA00;
}
.admin-card {
  background: #fff; border-radius: 12px; padding: 24px; margin-bottom: 24px;
  max-width: 800px; border: 1px solid #E2E8F0; box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.admin-card h2 {
  font-size: 14px; font-weight: 800; text-transform: uppercase;
  letter-spacing: 0.8px; color: #64748B; margin-bottom: 16px;
}
.invite-row { display: flex; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.invite-row input { flex: 1; min-width: 160px; }

/* ---------------------------------------------------------------- modal    */

.modal-overlay {
  display: none; position: fixed; inset: 0;
  background: rgba(15,23,42,0.4); z-index: 100; backdrop-filter: blur(3px);
}
.modal-overlay.open { display: flex; align-items: center; justify-content: center; padding: 24px; }
.modal {
  background: #fff; border-radius: 12px; width: 100%; max-width: 560px;
  border: 1px solid #E2E8F0; box-shadow: 0 20px 60px rgba(0,0,0,0.2);
  max-height: 90vh; overflow-y: auto;
}
.modal-header {
  background: #F8FAFC; padding: 18px 24px; border-bottom: 1px solid #E2E8F0;
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title { font-size: 13px; font-weight: 700; color: #1E293B; text-transform: uppercase; letter-spacing: 0.5px; }
.modal-close { background: none; border: none; font-size: 18px; color: #94A3B8; cursor: pointer; line-height: 1; }
.modal-close:hover { color: #1E293B; }
.modal-body { padding: 24px; }
.modal-foot {
  padding: 16px 24px; border-top: 1px solid #E2E8F0; background: #F8FAFC;
  display: flex; justify-content: flex-end; gap: 10px; align-items: center;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.modal input, .modal select { width: 100%; }

/* Honest placeholder for surfaces that are not built yet. Uses the AI-insight
   lavender rather than an error tint: this is information, not a failure. */
.notbuilt {
  padding: 20px 24px; font-size: 13px; color: #475569; line-height: 1.6;
  background: #FAF5FF; border: 1px solid #DDD6FE; border-radius: 8px; margin: 20px;
}
.notbuilt strong { color: #5B21B6; }

/* -------------------------------------------------------- position detail */

.row-link { cursor: pointer; }
.back-link {
  display: inline-block; font-size: 12px; font-weight: 600; color: #1a1a2e;
  text-decoration: none; margin-bottom: 16px; border-bottom: 1px solid #F3DA00;
  cursor: pointer;
}
.back-link:hover { color: #D4AF00; }
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 20px; align-items: start; }
@media (max-width: 900px) { .detail-grid { grid-template-columns: 1fr; } }

.doc-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 14px 18px; border-bottom: 1px solid #F1F5F9;
}
.doc-row:last-child { border-bottom: none; }
.meta-row {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-top: 1px solid #F1F5F9; font-size: 13px;
}
.meta-row:first-child { border-top: none; }
.meta-row span:first-child { color: #64748B; }
.meta-row span:last-child { font-weight: 600; text-align: right; }
