:root {
  color-scheme: light;
  --ink: #14213d;
  --muted: #64748b;
  --border: #dbe3ef;
  --surface: #ffffff;
  --background: #f4f7fb;
  --primary: #0f766e;
  --primary-dark: #115e59;
  --danger: #b42318;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; min-height: 100vh; background: var(--background); color: var(--ink); }
button, input { font: inherit; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 18px clamp(20px, 5vw, 72px); background: var(--surface); border-bottom: 1px solid var(--border); }
.brand { display: inline-flex; align-items: center; gap: 14px; color: var(--ink); font-weight: 800; text-decoration: none; }
.brand img { width: 148px; height: auto; display: block; }
.brand span { border-left: 1px solid var(--border); padding-left: 14px; }
.admin-main { width: min(1180px, calc(100% - 32px)); margin: 42px auto 80px; }
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: clamp(22px, 4vw, 36px); box-shadow: 0 12px 35px rgba(20, 33, 61, .06); }
.login-panel { width: min(460px, 100%); margin: 70px auto; }
.page-heading { margin-bottom: 22px; }
.dashboard-nav { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 24px; padding: 6px; background: #e8eef5; border-radius: 12px; }
.dashboard-nav-button { border: 0; border-radius: 8px; padding: 11px 16px; background: transparent; color: var(--muted); cursor: pointer; font-weight: 750; }
.dashboard-nav-button:hover, .dashboard-nav-button.active { background: var(--surface); color: var(--primary-dark); box-shadow: 0 2px 8px rgba(20, 33, 61, .08); }
.dashboard-nav-button.has-pending-notifications { color: var(--primary-dark); background: transparent; box-shadow: none; }
.nav-notification { position: relative; display: inline-flex; width: 25px; height: 28px; align-items: center; justify-content: center; margin-left: 8px; animation: notificationPulse 1.1s ease-in-out infinite; }
.nav-notification[hidden] { display: none; }
.nav-notification::after { display: none; }
.nav-notification-bell { display: inline-grid; width: 21px; height: 25px; place-items: center; color: #e11d48; background: transparent; transform-origin: 50% 10%; animation: notificationBellRing 1.1s ease-in-out infinite; }
.nav-notification-count { position: absolute; top: -8px; right: -10px; z-index: 1; display: inline-grid; min-width: 23px; height: 23px; padding: 0 6px; place-items: center; color: #fff; background: linear-gradient(145deg, #f43f5e, #be123c); border: 2px solid var(--surface); border-radius: 999px; box-shadow: 0 4px 10px rgba(190, 18, 60, .3); font-size: 12px; font-weight: 900; line-height: 1; }
@keyframes notificationPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .58; }
}
@keyframes notificationBellRing {
  0%, 45%, 100% { transform: rotate(0); }
  10% { transform: rotate(14deg); }
  20% { transform: rotate(-12deg); }
  30% { transform: rotate(8deg); }
  40% { transform: rotate(-5deg); }
}
@media (prefers-reduced-motion: reduce) {
  .nav-notification, .nav-notification::after, .nav-notification-bell { animation: none; }
}
.dashboard-section { margin-top: 20px; }
.overview-grid { display: grid; grid-template-columns: minmax(0, 2fr) minmax(260px, 1fr); gap: 18px; }
.overview-card { background: var(--surface); border: 1px solid var(--border); border-radius: 18px; padding: 28px; box-shadow: 0 12px 35px rgba(20, 33, 61, .06); }
.overview-card-highlight { background: linear-gradient(135deg, #effcf9, #ffffff); }
.application-alert-card { border-color: #f59e0b; background: linear-gradient(135deg, #fff7ed, #ffffff); }
.withdrawal-alert-card { border-color: #7c3aed; background: linear-gradient(135deg, #f5f3ff, #ffffff); }
.recruitment-alert-card { border-color: #0f766e; background: linear-gradient(135deg, #ecfdf5, #ffffff); }
.application-alert-blink { animation: applicationAlertBlink 1s ease-in-out 4; }
.application-alert-time { margin: 0; color: var(--muted); font-size: 12px; }
@keyframes applicationAlertBlink {
  0%, 100% { opacity: 1; box-shadow: 0 12px 35px rgba(20, 33, 61, .06); }
  50% { opacity: .45; box-shadow: 0 0 0 6px rgba(245, 158, 11, .2), 0 12px 35px rgba(245, 158, 11, .2); }
}
.overview-card .muted { margin: 8px 0 22px; }
.stat-number { margin: 8px 0 0; font-size: 44px; font-weight: 850; letter-spacing: -.04em; }
.section-heading { margin-bottom: 18px; }
.eyebrow { margin: 0 0 8px; color: var(--primary); font-size: 12px; font-weight: 800; letter-spacing: .13em; text-transform: uppercase; }
h1, h2 { margin: 0; }
h1 { font-size: clamp(28px, 4vw, 42px); letter-spacing: -.03em; }
h2 { font-size: 22px; }
.muted { color: var(--muted); line-height: 1.6; }
.hint { margin: 20px 0 0; color: var(--muted); font-size: 13px; line-height: 1.6; }
code { background: #eef2f7; border-radius: 5px; padding: 2px 5px; }
.stack-form, .job-form { display: grid; gap: 16px; }
.job-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-field { display: grid; gap: 7px; }
.form-field-wide { grid-column: 1 / -1; }
label { font-size: 14px; font-weight: 750; }
.required-mark { color: #dc2626; }
.optional-mark { color: var(--muted); font-size: 12px; font-weight: 600; }
input, select, textarea { width: 100%; border: 1px solid var(--border); border-radius: 10px; padding: 12px 13px; color: var(--ink); background: #fbfdff; outline: none; box-sizing: border-box; font: inherit; }
textarea { min-height: 132px; resize: vertical; line-height: 1.55; }
input[type="file"] { padding: 10px 12px; cursor: pointer; }
input:focus, select:focus, textarea:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(15, 118, 110, .12); }
.form-hint { color: var(--muted); font-size: 12px; line-height: 1.45; }
select:disabled { color: #94a3b8; cursor: not-allowed; }
.button { border: 0; border-radius: 10px; padding: 11px 17px; cursor: pointer; font-weight: 750; transition: transform .15s ease, background .15s ease; }
.button:hover { transform: translateY(-1px); }
.button-primary { background: var(--primary); color: white; }
.button-primary:hover { background: var(--primary-dark); }
.button-secondary { background: #edf2f7; color: var(--ink); }
.back-home-button { display: inline-flex; justify-content: center; text-decoration: none; }
.button-danger { background: #fff1f0; color: var(--danger); }
.text-button { width: fit-content; border: 0; padding: 0; background: transparent; color: var(--primary-dark); cursor: pointer; font-size: 14px; font-weight: 750; }
.text-button:hover { text-decoration: underline; }
.form-actions { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin-top: 5px; }
.message { min-height: 20px; color: var(--muted); font-size: 14px; }
.message.success { color: var(--primary-dark); }
.message.error { color: var(--danger); }
.listings-panel { margin-top: 24px; }
.listings-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 20px; }
.listings-heading .muted { margin: 6px 0 0; }
.table-wrapper { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; min-width: 860px; }
.applications-table { min-width: 1100px; }
th, td { border-bottom: 1px solid var(--border); padding: 13px 12px; text-align: left; vertical-align: middle; font-size: 14px; }
th { color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; }
td:first-child { color: var(--primary-dark); font-weight: 800; }
.table-secondary { display: block; margin-top: 4px; color: var(--muted); font-size: 12px; font-weight: 500; }
.application-status-editor { display: flex; align-items: center; gap: 8px; min-width: 260px; }
.application-status-editor select { min-width: 175px; padding: 9px 10px; }
.application-status-editor .button { padding: 9px 12px; white-space: nowrap; }
.status-pill { display: inline-block; padding: 5px 9px; border-radius: 999px; font-size: 12px; font-weight: 800; white-space: nowrap; }
.status-paid { color: #166534; background: #dcfce7; }
.status-pending { color: #a16207; background: #fef3c7; }
.status-applied { color: #0369a1; background: #e0f2fe; }
.status-under_review { color: #6d28d9; background: #ede9fe; }
.status-shortlisted { color: #b45309; background: #fef3c7; }
.status-interview_scheduled { color: #1d4ed8; background: #dbeafe; }
.status-interview_completed { color: #0f766e; background: #ccfbf1; }
.status-offered { color: #a16207; background: #fef9c3; }
.status-hired { color: #15803d; background: #dcfce7; }
.status-rejected { color: #b91c1c; background: #fee2e2; }
.status-withdrawn { color: #475569; background: #e2e8f0; }
.status-approved { color: #166534; background: #dcfce7; }
.status-failed { color: #b91c1c; background: #fee2e2; }
.withdrawal-error { max-width: 260px; color: var(--danger); }
.withdrawal-request-badge { display: block; width: fit-content; margin-top: 7px; padding: 4px 8px; color: #6d28d9; background: #ede9fe; border-radius: 999px; font-size: 11px; font-weight: 800; }
.withdrawal-table .button { white-space: nowrap; }
.recruitment-table { min-width: 1050px; }
.recruitment-contact { min-width: 190px; }
.recruitment-action-group { display: flex; flex-wrap: wrap; gap: 8px; min-width: 190px; }
.recruitment-action-group .button { white-space: nowrap; }
.recruitment-more-info { margin-top: 7px; color: var(--muted); font-size: 12px; }
.recruitment-more-info summary { color: var(--primary); cursor: pointer; font-weight: 700; }
.recruitment-more-info p { max-width: 340px; margin: 6px 0 0; white-space: pre-wrap; line-height: 1.45; }
.button-success { color: #166534; background: #dcfce7; border-color: #86efac; }
.button-success:hover { background: #bbf7d0; }
.empty-cell { color: var(--muted); text-align: center; padding: 28px; }

@media (max-width: 700px) {
  .admin-header { padding: 15px 16px; }
  .brand img { width: 125px; }
  .brand span { font-size: 13px; }
  .admin-main { width: min(100% - 22px, 1180px); margin-top: 24px; }
  .dashboard-nav-button { flex: 1 1 auto; }
  .overview-grid { grid-template-columns: 1fr; }
  .job-form { grid-template-columns: 1fr; }
  .form-field-wide { grid-column: auto; }
  .listings-heading { align-items: flex-start; flex-direction: column; }
}

/* Responsive hardening for narrow phones and wrapped admin controls. */
.admin-header,
.admin-header .brand,
.admin-main,
.panel,
.overview-card,
.section-heading,
.listings-heading,
.job-form,
.form-field,
.form-actions {
  min-width: 0;
}

.admin-header {
  flex-wrap: wrap;
}

.admin-header .brand {
  max-width: 100%;
  overflow-wrap: anywhere;
}

.admin-header .brand span {
  overflow-wrap: anywhere;
}

input,
select,
textarea,
button {
  max-width: 100%;
}

@media (max-width: 480px) {
  .admin-header {
    align-items: flex-start;
    gap: 12px;
    padding: 14px 12px;
  }

  .admin-header .brand {
    flex: 1 1 180px;
    gap: 9px;
  }

  .admin-header .brand img {
    width: 112px;
  }

  .admin-header .brand span {
    padding-left: 9px;
    font-size: 12px;
  }

  .admin-main {
    width: calc(100% - 16px);
    margin-top: 18px;
    margin-bottom: 56px;
  }

  .panel,
  .overview-card {
    padding: 18px 14px;
    border-radius: 14px;
  }

  .dashboard-nav {
    gap: 5px;
    padding: 5px;
  }

  .dashboard-nav-button {
    min-width: 0;
    padding: 9px 8px;
    font-size: 12px;
  }

  .form-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .form-actions .button {
    width: 100%;
  }

  .message {
    overflow-wrap: anywhere;
  }
}
