@import url("https://fonts.googleapis.com/css2?family=Tajawal:wght@400;500;700;800;900&display=swap");
@import url("https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700,900&display=swap");

:root {
  --cobalt: #0b1d3a;
  --cobalt-deep: #071429;
  --teal: #155e75;
  --teal-light: #1f8a99;
  --amber: #d97a3a;
  --amber-soft: #f4a25e;
  --white: #ffffff;
  --ink: #0f2033;
  --muted: #64707d;
  --muted-soft: #93a0ac;
  --line: #dfe7eb;
  --surface: #f2f7f8;
  --surface-2: #e8f2f1;
  --warning-bg: #fdf1e2;
  --warning-line: rgba(217, 122, 58, 0.32);
  --danger: #b5432e;
  --danger-bg: #fbeae6;
  --shadow-sm: 0 6px 18px rgba(11, 29, 58, 0.06);
  --shadow-md: 0 18px 40px rgba(11, 29, 58, 0.1);
  --shadow-lg: 0 30px 70px rgba(11, 29, 58, 0.18);
  --radius: 14px;
  --radius-sm: 10px;
  --font-ar: "Tajawal", "Segoe UI", Arial, sans-serif;
  --font-num: "Satoshi", "Tajawal", "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

/* Any element styled with `display` elsewhere (labels, .toast, etc.) would
   otherwise defeat the browser's built-in [hidden] rule, since author CSS
   always wins over the user-agent stylesheet regardless of specificity. */
[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--font-ar);
  color: var(--ink);
  background: var(--surface);
}

a {
  color: inherit;
  text-decoration: none;
}

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

:focus-visible {
  outline: 2px solid var(--teal-light);
  outline-offset: 2px;
}

.num {
  font-family: var(--font-num);
  font-variant-numeric: tabular-nums;
}

/* ---------- Signature: pulse / ECG line ---------- */

.pulse-divider {
  display: block;
  width: 100%;
  height: 26px;
  margin: 14px 0 22px;
  overflow: visible;
}

.pulse-divider .pulse-path {
  fill: none;
  stroke: var(--line);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.pulse-divider .pulse-path-accent {
  fill: none;
  stroke: var(--teal-light);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 340;
  stroke-dashoffset: 340;
  animation: draw-pulse 2.6s ease-out forwards;
}

.pulse-divider .pulse-dot {
  fill: var(--amber);
  filter: drop-shadow(0 0 5px rgba(217, 122, 58, 0.75));
}

@keyframes draw-pulse {
  to {
    stroke-dashoffset: 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .pulse-divider .pulse-path-accent {
    animation: none;
    stroke-dashoffset: 0;
  }
  .pulse-divider .pulse-dot animateMotion {
    display: none;
  }
}

.live-pill {
  min-height: 38px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 16px;
  border: 1px solid rgba(21, 94, 117, 0.22);
  border-radius: 999px;
  color: var(--teal);
  background: var(--surface-2);
  font-weight: 800;
  font-size: 14px;
}

.live-pill .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 0 0 rgba(217, 122, 58, 0.55);
  animation: dot-pulse 1.8s ease-out infinite;
}

@keyframes dot-pulse {
  0% {
    box-shadow: 0 0 0 0 rgba(217, 122, 58, 0.55);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(217, 122, 58, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(217, 122, 58, 0);
  }
}

/* ---------- Brand mark ---------- */

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 8px 20px rgba(11, 29, 58, 0.35);
  flex: none;
}

.brand-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ================= Auth shell ================= */

.auth-shell {
  width: 100%;
  min-height: 100vh;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
}

.auth-story {
  position: relative;
  padding: 48px 44px;
  color: var(--white);
  background:
    radial-gradient(1100px 500px at 15% -10%, rgba(217, 122, 58, 0.18), transparent 60%),
    linear-gradient(165deg, var(--cobalt) 0%, var(--cobalt-deep) 62%, #05101f 100%);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.auth-story::after {
  content: "";
  position: absolute;
  inset-inline-end: -120px;
  bottom: -140px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(31, 138, 153, 0.35), transparent 70%);
}

.story-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.story-brand strong {
  display: block;
  font-size: 21px;
}

.story-brand span {
  display: block;
  margin-top: 2px;
  color: rgba(255, 255, 255, 0.6);
  font-size: 12px;
  letter-spacing: 0.3px;
}

.story-headline {
  margin-top: auto;
  position: relative;
  z-index: 1;
}

.story-headline h2 {
  margin: 0 0 14px;
  font-size: 34px;
  line-height: 1.35;
  max-width: 460px;
}

.story-headline p {
  margin: 0 0 26px;
  max-width: 420px;
  color: rgba(255, 255, 255, 0.68);
  line-height: 1.9;
  font-size: 15px;
}

.story-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  max-width: 460px;
  position: relative;
  z-index: 1;
}

.story-stats div {
  padding: 14px 12px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: var(--radius-sm);
  background: rgba(255, 255, 255, 0.05);
}

.story-stats strong {
  display: block;
  font-family: var(--font-num);
  font-size: 24px;
  color: var(--amber-soft);
}

.story-stats span {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.62);
}

.auth-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.auth-card {
  width: 100%;
  max-width: 520px;
  padding: 30px;
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow-md);
  border-radius: var(--radius);
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  margin-bottom: 26px;
}

.tab {
  min-height: 46px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-weight: 800;
  transition: background 0.18s ease, color 0.18s ease;
}

.tab.is-active {
  color: var(--white);
  background: linear-gradient(135deg, var(--cobalt), var(--teal));
  box-shadow: 0 10px 26px rgba(11, 29, 58, 0.2);
}

.panel {
  display: none;
}

.panel.is-active {
  display: block;
}

.form-heading {
  margin-bottom: 22px;
}

.eyebrow {
  margin: 0 0 8px;
  color: var(--amber);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.4px;
  text-transform: uppercase;
}

h1 {
  margin: 0;
  color: var(--cobalt);
  font-size: 26px;
}

.grid {
  display: grid;
  gap: 14px;
}

.grid.two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

label {
  display: block;
}

label span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
  font-weight: 500;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--ink);
  padding: 0 14px;
  outline: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}

input,
select {
  min-height: 48px;
}

textarea {
  min-height: 116px;
  padding-top: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--teal);
  box-shadow: 0 0 0 4px rgba(21, 94, 117, 0.12);
}

.file-box {
  position: relative;
  margin-top: 14px;
  border: 1.5px dashed rgba(21, 94, 117, 0.5);
  border-radius: var(--radius-sm);
  min-height: 108px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  text-align: center;
  padding: 18px;
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}

.file-box:hover {
  border-color: var(--teal);
  background: #e2f1f0;
}

.file-box input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.file-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: var(--teal);
  color: var(--white);
  font-size: 20px;
  font-weight: 900;
}

.file-box strong {
  color: var(--cobalt);
  display: block;
}

.file-box small {
  color: var(--muted);
  margin-top: 4px;
  display: block;
}

.notice {
  margin: 16px 0;
  padding: 13px 16px;
  border-radius: var(--radius-sm);
  color: #234b47;
  background: var(--surface-2);
  border: 1px solid rgba(21, 94, 117, 0.2);
  line-height: 1.7;
  font-size: 14px;
}

.notice.warning {
  color: #6b4413;
  background: var(--warning-bg);
  border-color: var(--warning-line);
}

.primary-action,
.text-action {
  width: 100%;
  min-height: 50px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  font-weight: 900;
  font-size: 15px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.primary-action {
  border: 0;
  color: var(--white);
  background: linear-gradient(135deg, var(--teal) 0%, var(--cobalt) 100%);
  box-shadow: 0 16px 30px rgba(11, 29, 58, 0.22);
}

.primary-action:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(11, 29, 58, 0.28);
}

.primary-action:active {
  transform: translateY(0);
}

.text-action {
  margin-top: 10px;
  border: 1px solid var(--line);
  color: var(--teal);
  background: var(--white);
}

.text-action:hover {
  border-color: var(--teal);
  background: var(--surface-2);
}

.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: min(410px, calc(100% - 48px));
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, var(--cobalt), var(--cobalt-deep));
  color: var(--white);
  box-shadow: var(--shadow-lg);
  line-height: 1.7;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  z-index: 40;
}

.toast::before {
  content: "";
  width: 8px;
  height: 8px;
  margin-top: 8px;
  border-radius: 50%;
  background: var(--amber);
  flex: none;
  box-shadow: 0 0 8px rgba(217, 122, 58, 0.9);
}

/* ================= App shell ================= */

.app-layout {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 272px minmax(0, 1fr);
}

.sidebar {
  min-height: 100vh;
  padding: 24px 20px;
  color: var(--white);
  background: linear-gradient(190deg, var(--cobalt) 0%, var(--cobalt-deep) 100%);
  display: flex;
  flex-direction: column;
  gap: 24px;
  position: sticky;
  top: 0;
}

.sidebar-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 20px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.sidebar-title strong,
.sidebar-title span {
  display: block;
}

.sidebar-title strong {
  font-size: 17px;
}

.sidebar-title span {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.55);
  font-size: 12px;
}

.menu-toggle {
  display: none;
  margin-inline-start: auto;
  flex: none;
  width: 40px;
  height: 40px;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: var(--white);
  cursor: pointer;
}

.menu-toggle svg {
  width: 20px;
  height: 20px;
}

.side-nav {
  display: grid;
  gap: 6px;
}

.side-nav a,
.logout-link {
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  border-radius: var(--radius-sm);
  color: rgba(255, 255, 255, 0.66);
  font-weight: 700;
  font-size: 14.5px;
  border: 1px solid transparent;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.side-nav a .nav-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.5;
  flex: none;
}

.side-nav a:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
}

.side-nav a.active {
  color: var(--white);
  background: rgba(31, 138, 153, 0.28);
  border-color: rgba(31, 138, 153, 0.55);
}

.side-nav a.active .nav-dot {
  opacity: 1;
  background: var(--amber-soft);
}

.sidebar-foot {
  margin-top: auto;
  display: grid;
  gap: 14px;
}

.sidebar-pulse {
  height: 30px;
  opacity: 0.55;
}

.sidebar-pulse .pulse-path-accent {
  stroke: var(--teal-light);
}

.logout-link {
  color: #ffd8c2;
  border: 1px solid rgba(217, 122, 58, 0.38);
}

.logout-link:hover {
  background: rgba(217, 122, 58, 0.14);
}

.workspace {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 60px;
}

.workspace-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
}

.workspace-header h1 {
  margin-top: 2px;
}

/* ---------- metric grid ---------- */

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

.metric-card,
.insight-panel,
.table-card,
.detail-hero {
  border: 1px solid var(--line);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  border-radius: var(--radius);
}

.metric-card {
  min-height: 168px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.metric-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: rgba(21, 94, 117, 0.3);
}

.metric-card::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: var(--teal);
}

.metric-card.accent-amber::before {
  background: var(--amber);
}

.metric-card.accent-danger::before {
  background: var(--danger);
}

.metric-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--teal);
}

.metric-card.accent-amber .metric-icon {
  background: var(--warning-bg);
  color: var(--amber);
}

.metric-card.accent-danger .metric-icon {
  background: var(--danger-bg);
  color: var(--danger);
}

.metric-icon svg {
  width: 20px;
  height: 20px;
}

.metric-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.metric-card span.metric-label {
  color: var(--muted);
  font-size: 14.5px;
  font-weight: 700;
}

.metric-card strong {
  color: var(--cobalt);
  font-size: 40px;
  line-height: 1;
  font-family: var(--font-num);
}

.metric-card small {
  color: var(--muted-soft);
  font-size: 12.5px;
}

.insight-panel,
.table-card {
  margin-top: 18px;
  padding: 22px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.panel-title h2 {
  margin: 0;
  color: var(--cobalt);
  font-size: 21px;
}

.panel-title span {
  color: var(--muted);
  font-size: 13px;
}

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

.summary-list div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.summary-list span {
  display: block;
  color: var(--muted);
  margin-bottom: 8px;
  font-size: 13px;
  font-weight: 500;
}

.summary-list strong {
  color: var(--teal);
  font-size: 22px;
  font-family: var(--font-num);
}

/* ---------- rating page ---------- */

.detail-grid {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 18px;
}

.detail-hero {
  padding: 26px;
  min-height: 250px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.detail-hero .stars {
  display: flex;
  gap: 4px;
  margin-bottom: 4px;
  color: var(--amber);
}

.detail-hero .stars svg {
  width: 18px;
  height: 18px;
}

.detail-hero span {
  color: var(--muted);
  font-weight: 800;
}

.detail-hero strong {
  margin: 10px 0;
  color: var(--cobalt);
  font-size: 60px;
  line-height: 1;
  font-family: var(--font-num);
}

.detail-hero p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
  max-width: 300px;
}

.table-card h2 {
  margin: 0 0 16px;
  color: var(--cobalt);
  font-size: 21px;
}

.bar-row {
  display: grid;
  grid-template-columns: 66px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  margin: 18px 0;
}

.bar-row span,
.bar-row b {
  color: var(--muted);
  font-size: 13px;
}

.bar-row b {
  font-family: var(--font-num);
  color: var(--ink);
}

.bar-row i {
  height: 10px;
  border-radius: 999px;
  background: #e9eff1;
  position: relative;
  overflow: hidden;
  font-style: normal;
}

.bar-row i::after {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  height: 100%;
  width: var(--value);
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-light), var(--teal));
}

/* ---------- jobs / forms ---------- */

.publish-card {
  margin-top: 0;
  margin-bottom: 18px;
}

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

.job-form .wide {
  grid-column: 1 / -1;
}

.job-form .notice {
  margin: 0;
}

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

table {
  width: 100%;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: var(--radius-sm);
}

th,
td {
  padding: 14px;
  text-align: right;
  border-bottom: 1px solid var(--line);
  font-size: 14.5px;
}

th {
  color: var(--muted);
  background: var(--surface);
  font-size: 12.5px;
  font-weight: 800;
  letter-spacing: 0.2px;
}

td {
  color: var(--ink);
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr {
  transition: background 0.14s ease;
}

tbody tr:hover {
  background: var(--surface);
}

td.num {
  font-family: var(--font-num);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 800;
}

.status-pill::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.status-pill.is-active,
.status-pill.is-confirmed {
  color: var(--teal);
  background: var(--surface-2);
}

.status-pill.is-pending {
  color: var(--amber);
  background: var(--warning-bg);
}

.status-pill.is-due {
  color: var(--amber);
  background: var(--warning-bg);
}

.status-pill.is-soon {
  color: var(--danger);
  background: var(--danger-bg);
}

.match-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.match-chip .track {
  width: 64px;
  height: 6px;
  border-radius: 999px;
  background: #e9eff1;
  overflow: hidden;
}

.match-chip .track span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--teal-light), var(--teal));
  width: var(--match);
}

.match-chip b {
  font-family: var(--font-num);
  font-size: 13px;
  color: var(--ink);
}

.action-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--teal);
  font-weight: 800;
  font-size: 13.5px;
}

.action-link:hover {
  color: var(--cobalt);
}

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

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(7, 20, 41, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  z-index: 50;
}

.modal-overlay.is-open {
  display: flex;
}

.modal {
  width: min(720px, 100%);
  max-height: min(88vh, 760px);
  overflow-y: auto;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
}

.modal.modal-wide {
  width: min(880px, 100%);
}

.modal-header {
  position: sticky;
  top: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 22px 24px 16px;
  background: var(--white);
  border-bottom: 1px solid var(--line);
}

.modal-header h2 {
  margin: 0 0 4px;
  color: var(--cobalt);
  font-size: 20px;
}

.modal-header p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.modal-close {
  width: 34px;
  height: 34px;
  flex: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface);
  color: var(--muted);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.16s ease, color 0.16s ease;
}

.modal-close:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.modal-body {
  padding: 22px 24px 26px;
}

/* ---------- table toolbar / create button ---------- */

.table-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.table-toolbar h2 {
  margin: 0;
  color: var(--cobalt);
  font-size: 21px;
}

.btn-create {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-sm);
  color: var(--white);
  background: linear-gradient(135deg, var(--teal) 0%, var(--cobalt) 100%);
  box-shadow: 0 16px 30px rgba(11, 29, 58, 0.22);
  font-weight: 900;
  font-size: 14.5px;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-create:hover {
  transform: translateY(-1px);
  box-shadow: 0 20px 36px rgba(11, 29, 58, 0.28);
}

.btn-create svg {
  width: 16px;
  height: 16px;
}

/* ---------- applicants-per-job control ---------- */

.applicants-count {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: var(--teal);
}

.applicants-count:hover {
  color: var(--cobalt);
}

.applicants-count b {
  font-family: var(--font-num);
  font-size: 14.5px;
}

.applicants-count span {
  color: var(--muted);
  font-weight: 700;
  font-size: 12.5px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.empty-state {
  padding: 30px 10px;
  text-align: center;
  color: var(--muted);
  font-size: 14px;
}

/* ---------- job request summary + stop action ---------- */

.status-pill.is-stopped {
  color: var(--muted);
  background: #eef1f3;
}

.job-summary-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
  padding: 16px 18px;
  margin-bottom: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
}

.job-summary-bar > div {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.job-summary-bar > div span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.job-summary-bar > div b {
  color: var(--cobalt);
  font-family: var(--font-num);
  font-size: 15px;
}

.btn-stop {
  margin-inline-start: auto;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(181, 67, 46, 0.35);
  border-radius: var(--radius-sm);
  background: var(--danger-bg);
  color: var(--danger);
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.16s ease;
}

.btn-stop:hover:not(:disabled) {
  background: #f6dcd5;
}

.btn-stop:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

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

.applicant-list {
  display: grid;
  gap: 14px;
}

.applicant-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 16px 18px;
}

.applicant-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.applicant-card-head strong {
  display: block;
  color: var(--cobalt);
  font-size: 15.5px;
}

.applicant-meta {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12.5px;
}

.applicant-detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 14px 0;
}

.applicant-detail-grid div {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.applicant-detail-grid span {
  color: var(--muted);
  font-size: 12px;
}

.applicant-detail-grid b {
  color: var(--ink);
  font-family: var(--font-num);
  font-size: 14px;
}

.privacy-note {
  margin: 0 0 14px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  background: var(--warning-bg);
  border: 1px solid var(--warning-line);
  color: #6b4413;
  font-size: 12.5px;
  line-height: 1.7;
}

.applicant-decision {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
}

.applicant-decision > span {
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
}

.decision-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.decision-btn {
  min-height: 36px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--muted);
  font-weight: 800;
  font-size: 12.5px;
  cursor: pointer;
  transition: background 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.decision-btn:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.decision-btn.is-active.is-final,
.decision-btn.is-active.is-approve {
  border-color: var(--teal);
  background: var(--surface-2);
  color: var(--teal);
}

.decision-btn.is-active.is-preliminary {
  border-color: rgba(217, 122, 58, 0.4);
  background: var(--warning-bg);
  color: var(--amber);
}

.decision-btn.is-active.is-reject {
  border-color: rgba(181, 67, 46, 0.35);
  background: var(--danger-bg);
  color: var(--danger);
}

.decision-note {
  flex-basis: 100%;
  margin: 0;
  color: var(--muted);
  font-size: 12.5px;
}

.interview-form.wide {
  flex-basis: 100%;
}

.interview-form .grid.two {
  gap: 10px;
}

.interview-summary.wide {
  flex-basis: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 13px;
  color: var(--muted);
}

.interview-summary b {
  color: var(--ink);
  font-family: var(--font-num);
}

@media (max-width: 640px) {
  .applicant-detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .btn-stop {
    margin-inline-start: 0;
  }
}

/* ---------- admin shell ---------- */

.role-badge {
  display: inline-flex;
  align-items: center;
  margin-inline-start: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  background: rgba(217, 122, 58, 0.2);
  color: var(--amber-soft);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.4px;
  vertical-align: middle;
}

.status-pill.is-inactive {
  color: var(--muted);
  background: #eef1f3;
}

.status-pill.is-rejected {
  color: var(--danger);
  background: var(--danger-bg);
}

button.action-link {
  border: 0;
  background: none;
  padding: 0;
  cursor: pointer;
}

.btn-activate {
  margin-inline-start: auto;
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid rgba(21, 94, 117, 0.3);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--teal);
  font-weight: 800;
  font-size: 13.5px;
  cursor: pointer;
  transition: background 0.16s ease;
}

.btn-activate:hover {
  background: #d9ecea;
}

.metric-grid.cols-4 {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

/* ---------- attachments ---------- */

.attachment-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 10px 0 0;
}

.attachment-chip {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--surface);
  transition: border-color 0.15s ease, background 0.15s ease;
}

a.attachment-chip {
  cursor: pointer;
}

a.attachment-chip:hover {
  border-color: var(--teal);
  background: var(--surface-2);
}

.attachment-chip .attachment-icon {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: var(--surface-2);
  color: var(--teal);
  flex: none;
  font-size: 14px;
}

.attachment-chip .attachment-meta strong {
  display: block;
  color: var(--ink);
  font-weight: 800;
  font-size: 12.5px;
}

.attachment-chip .attachment-meta span {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 11.5px;
  font-family: var(--font-num);
}

.attachment-chip .attachment-meta span.is-expiring {
  color: var(--danger);
  font-weight: 700;
}

.attachment-section {
  margin-top: 14px;
}

.attachment-section > span {
  display: block;
  color: var(--muted);
  font-weight: 700;
  font-size: 13px;
  margin-bottom: 4px;
}

/* ---------- bank transfer receipt preview ---------- */

.receipt-preview {
  border: 1.5px dashed rgba(21, 94, 117, 0.4);
  border-radius: var(--radius-sm);
  padding: 24px 20px;
  background: var(--surface-2);
  text-align: center;
}

.receipt-preview .receipt-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 12px;
  border-radius: 50%;
  background: var(--white);
  color: var(--teal);
  display: grid;
  place-items: center;
  font-size: 22px;
  box-shadow: var(--shadow-sm);
}

.receipt-preview strong {
  display: block;
  color: var(--cobalt);
  font-size: 15px;
}

.receipt-preview .receipt-details {
  display: grid;
  gap: 8px;
  max-width: 320px;
  margin: 16px auto 0;
  padding-top: 14px;
  border-top: 1px dashed var(--line);
  text-align: right;
}

.receipt-preview .receipt-details div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  font-size: 13px;
  color: var(--muted);
}

.receipt-preview .receipt-details b {
  color: var(--ink);
  font-family: var(--font-num);
}

@media (max-width: 980px) {
  .metric-grid.cols-4 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ================= Responsive ================= */

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-story {
    padding: 34px 26px 46px;
  }

  .story-headline {
    margin-top: 30px;
  }
}

@media (max-width: 640px) {
  .auth-panel {
    padding: 20px;
  }

  .auth-card {
    padding: 18px;
  }

  h1 {
    font-size: 21px;
  }

  .grid.two,
  .story-stats {
    grid-template-columns: 1fr;
  }

  .app-layout {
    grid-template-columns: 1fr;
  }

  .sidebar {
    min-height: auto;
    position: sticky;
    top: 0;
    z-index: 40;
    flex-direction: row;
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 16px;
    gap: 0;
  }

  .sidebar-title {
    border-bottom: 0;
    padding-bottom: 0;
    flex: 1 1 auto;
  }

  .menu-toggle {
    display: flex;
  }

  .side-nav {
    display: none;
    width: 100%;
    order: 3;
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
  }

  .sidebar-foot {
    display: none;
    width: 100%;
    order: 4;
    margin-top: 4px;
  }

  .sidebar.is-nav-open .side-nav,
  .sidebar.is-nav-open .sidebar-foot {
    display: grid;
  }

  .workspace {
    width: min(100% - 20px, 1180px);
    padding: 18px 0 40px;
  }

  .workspace-header {
    align-items: stretch;
    flex-direction: column;
  }

  .metric-grid,
  .summary-list,
  .detail-grid,
  .job-form {
    grid-template-columns: 1fr;
  }

  .table-card {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .table-card table {
    min-width: 560px;
  }

  .table-toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }
}

@media (min-width: 641px) and (max-width: 980px) {
  .app-layout {
    grid-template-columns: 226px minmax(0, 1fr);
  }

  .workspace {
    width: min(100% - 24px, 1180px);
  }

  .metric-grid,
  .summary-list,
  .detail-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}
