/* Backoffice: a working tool. Quiet, dense, legible. Same palette, no decoration. */

body.admin { background: var(--ground); }
.a-shell { display: grid; grid-template-columns: minmax(0, 1fr); min-height: 100dvh; }
@media (min-width: 62rem) { .a-shell { grid-template-columns: 15.5rem minmax(0, 1fr); } }

.a-side { background: var(--forest); color: #fff; display: flex; flex-direction: column; gap: 1.5rem; padding: 1.1rem 1rem; }
@media (min-width: 62rem) { .a-side { position: sticky; top: 0; height: 100dvh; padding: 1.5rem 1rem; } }
.a-side .brand img { width: 10.5rem; }
.a-nav { display: flex; gap: 0.25rem; overflow-x: auto; padding-bottom: 0.25rem; }
@media (min-width: 62rem) { .a-nav { flex-direction: column; overflow: visible; } }
.a-nav a, .a-nav button {
  display: flex; align-items: center; gap: 0.75rem; padding: 0.65rem 0.85rem; border-radius: var(--radius-sm); border: 0; background: transparent;
  color: rgb(255 255 255 / 0.9); font-weight: 500; font-size: 0.9375rem; text-decoration: none; white-space: nowrap; width: 100%; text-align: left;
  transition: background-color 0.2s, color 0.2s;
}
.a-nav a:hover, .a-nav button:hover { background: rgb(255 255 255 / 0.1); color: #fff; }
.a-nav a[aria-current="page"] { background: rgb(255 255 255 / 0.18); color: #fff; }
.a-nav .pill { margin-left: auto; min-width: 1.5rem; padding: 0 0.5rem; border-radius: 99px; background: var(--sun); color: var(--forest); font-size: 0.75rem; font-weight: 700; text-align: center; line-height: 1.5rem; }
.a-side .a-foot { margin-top: auto; display: none; gap: 0.25rem; }
@media (min-width: 62rem) { .a-side .a-foot { display: grid; } }
.a-nav-mobile-foot { display: contents; }
@media (min-width: 62rem) { .a-nav-mobile-foot { display: none; } }
.a-user { font-size: 0.8125rem; color: rgb(255 255 255 / 0.8); padding: 0 0.85rem 0.5rem; word-break: break-all; }

.a-main { padding: clamp(1.25rem, 3vw, 2.5rem) clamp(1rem, 3vw, 2.75rem) 4rem; min-width: 0; }
.a-head { display: flex; flex-wrap: wrap; gap: 1rem 2rem; align-items: end; justify-content: space-between; margin-bottom: 2rem; }
.a-head h1 { font-size: clamp(1.75rem, 3vw, 2.4rem); font-weight: 700; letter-spacing: -0.02em; }
.a-head p { color: var(--ink-soft); margin-top: 0.25rem; }
.a-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; align-items: center; }
.a-btn {
  display: inline-flex; align-items: center; gap: 0.5rem; min-height: 2.5rem; padding: 0.45rem 1.05rem; border-radius: 99px; border: 0;
  background: var(--field); color: #fff; font-weight: 600; font-size: 0.875rem; text-decoration: none; line-height: 1.2;
  transition: background-color 0.2s, box-shadow 0.2s;
}
.a-btn:hover { background: var(--field-deep); text-decoration: none; }
.a-btn--ghost { background: #fff; color: var(--link); box-shadow: inset 0 0 0 1.5px var(--line); }
.a-btn--ghost:hover { background: var(--aqua-wash); box-shadow: inset 0 0 0 1.5px var(--field); }
.a-btn--danger { background: #fff; color: var(--berry-ink); box-shadow: inset 0 0 0 1.5px #e9c2cb; }
.a-btn--danger:hover { background: var(--berry-wash); }
.a-btn--sm { min-height: 2rem; padding: 0.25rem 0.8rem; font-size: 0.8125rem; }

.flash { display: flex; gap: 0.75rem; align-items: center; padding: 0.85rem 1.1rem; border-radius: var(--radius-sm); margin-bottom: 1.5rem; font-weight: 500; }
.flash--success { background: var(--green-wash); color: #33440a; }
.flash--error { background: var(--berry-wash); color: var(--berry-ink); }

.a-section { margin-top: 2.5rem; }
.a-section > h2, .a-section-head h2 { font-size: 1.35rem; font-weight: 700; }
.a-section-head { display: flex; flex-wrap: wrap; gap: 0.5rem 1.5rem; align-items: baseline; justify-content: space-between; margin-bottom: 0.9rem; }

/* status tabs */
.tabs { display: flex; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 1.25rem; }
.tabs a {
  display: inline-flex; align-items: baseline; gap: 0.55rem; padding: 0.5rem 1rem; border-radius: 99px; background: #fff; box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink); text-decoration: none; font-weight: 500; font-size: 0.9375rem;
}
.tabs a:hover { box-shadow: inset 0 0 0 1.5px var(--aqua); }
.tabs a[aria-current="true"] { background: var(--forest); color: #fff; box-shadow: none; }
.tabs .n { font-variant-numeric: tabular-nums; font-weight: 700; font-size: 0.875rem; opacity: 0.85; }

/* tables */
.a-table-wrap { overflow-x: auto; background: #fff; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line-soft); }
.a-table { min-width: 40rem; font-size: 0.9375rem; }
.a-table th { text-align: left; padding: 0.85rem 1.1rem; font-size: 0.8125rem; font-weight: 600; color: var(--ink-soft); border-bottom: 1px solid var(--line); background: #fafcfc; white-space: nowrap; }
.a-table td { padding: 0.95rem 1.1rem; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
.a-table tr:last-child td { border-bottom: 0; }
.a-table tbody tr:hover { background: #f7fbfa; }
.a-table .num { text-align: right; font-variant-numeric: tabular-nums; }
.a-table .who strong { display: block; font-weight: 600; }
.a-table .who span { color: var(--ink-soft); font-size: 0.8125rem; }
.a-table a.row-link { font-weight: 600; text-decoration: none; }
.a-table a.row-link:hover { text-decoration: underline; }
.a-table .actions { display: flex; gap: 0.4rem; justify-content: flex-end; flex-wrap: wrap; }
.a-table time { white-space: nowrap; font-variant-numeric: tabular-nums; }
.a-table .muted { color: var(--ink-soft); }
.a-empty { padding: 2.5rem 1.5rem; text-align: center; color: var(--ink-soft); background: #fff; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line-soft); }
.a-empty strong { display: block; color: var(--ink); font-size: 1.1rem; margin-bottom: 0.25rem; }

/* badges */
.badge { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.15rem 0.7rem; border-radius: 99px; font-size: 0.8125rem; font-weight: 600; white-space: nowrap; background: var(--mist); color: var(--ink); }
.badge::before { content: ""; width: 0.5rem; height: 0.5rem; border-radius: 50%; background: currentColor; opacity: 0.7; }
.badge--new { background: var(--sun-wash); color: #5e4a00; }
.badge--reviewing { background: var(--aqua-wash); color: var(--forest); }
.badge--interview { background: var(--green-wash); color: #33440a; }
.badge--rejected { background: var(--berry-wash); color: var(--berry-ink); }
.badge--hired { background: var(--forest); color: #fff; }
.badge--published { background: var(--green-wash); color: #33440a; }
.badge--draft { background: var(--mist); color: #444; }
.badge--archived { background: #f1f1f1; color: #666; }

/* filters bar */
.a-filters { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 1rem; align-items: center; }
.a-filters input, .a-filters select {
  min-height: 2.6rem; padding: 0.4rem 0.9rem; border: 1.5px solid #b9cfcd; border-radius: 99px; background: #fff; font-size: 0.9375rem; min-width: 12rem;
}
.a-filters input:focus-visible, .a-filters select:focus-visible { border-color: var(--field); outline: none; box-shadow: 0 0 0 4px rgb(0 118 138 / 0.18); }

/* forms */
.a-form { display: grid; grid-template-columns: minmax(0, 1fr); gap: 2rem; }
@media (min-width: 70rem) { .a-form { grid-template-columns: minmax(0, 1fr) 20rem; align-items: start; } }
.a-form-main { display: grid; gap: 2.5rem; min-width: 0; }
.a-panel { background: #fff; border-radius: var(--radius); box-shadow: inset 0 0 0 1px var(--line-soft); padding: clamp(1.1rem, 2.5vw, 1.75rem); display: grid; gap: 1.25rem; }
.a-panel > h2 { font-size: 1.2rem; font-weight: 700; }
.a-panel .sub { color: var(--ink-soft); font-size: 0.875rem; margin-top: -0.75rem; }
.a-side-form { display: grid; gap: 1rem; }
@media (min-width: 70rem) { .a-side-form { position: sticky; top: 1.5rem; } }
.a-grid-2 { display: grid; gap: 1.25rem; }
@media (min-width: 44rem) { .a-grid-2 { grid-template-columns: 1fr 1fr; } }
.a-form .fld > label { font-size: 0.875rem; }
.a-form .fld input:not([type="checkbox"]), .a-form .fld textarea, .a-form .fld select { min-height: 2.75rem; }
.a-form .fld select { appearance: auto; }

.sec-entry { border: 1.5px solid var(--line); border-radius: var(--radius-sm); padding: 1rem; display: grid; gap: 1rem; background: var(--ground); }
.sec-entry-head { display: flex; gap: 0.5rem; align-items: center; justify-content: space-between; }
.sec-entry-head strong { font-family: var(--font-display); font-size: 1rem; }
.sec-entry-tools { display: flex; gap: 0.3rem; }
.icon-btn { display: grid; place-items: center; width: 2.25rem; height: 2.25rem; border-radius: 50%; border: 0; background: #fff; color: var(--link); box-shadow: inset 0 0 0 1px var(--line); }
.icon-btn:hover { background: var(--aqua-wash); box-shadow: inset 0 0 0 1.5px var(--field); }
.icon-btn--danger { color: var(--berry-ink); }
.icon-btn--danger:hover { background: var(--berry-wash); box-shadow: inset 0 0 0 1.5px var(--berry); }
.sec-list { display: grid; gap: 1rem; }
.sec-hint { color: var(--ink-soft); font-size: 0.875rem; }

/* candidature detail */
.a-split { display: grid; grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
@media (min-width: 70rem) { .a-split { grid-template-columns: minmax(0, 1fr) 22rem; align-items: start; } }
.identity h2 { font-size: 1.6rem; font-weight: 700; }
.kv { display: grid; gap: 0.9rem; }
.kv div { display: grid; grid-template-columns: 1.5rem 1fr; gap: 0.75rem; align-items: start; }
.kv svg { color: var(--link); margin-top: 0.2rem; }
.kv small { display: block; color: var(--ink-soft); font-size: 0.8125rem; }
.docs { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.quote { padding: 1rem 1.25rem; border-radius: var(--radius-sm); background: var(--ground); white-space: pre-line; max-width: 70ch; }

/* login */
.login { min-height: 100dvh; display: grid; }
@media (min-width: 60rem) { .login { grid-template-columns: 1.1fr 1fr; } }
.login-art { position: relative; overflow: clip; display: none; padding: 2.5rem; }
@media (min-width: 60rem) { .login-art { display: flex; flex-direction: column; justify-content: space-between; } }
.login-art img.art { position: absolute; inset: auto 0 0 0; width: 100%; opacity: 0.3; mix-blend-mode: screen; pointer-events: none; -webkit-mask: linear-gradient(to top, #000 45%, transparent 95%); mask: linear-gradient(to top, #000 45%, transparent 95%); }
.login-art h2 { font-size: clamp(2rem, 3.4vw, 3rem); font-weight: 300; letter-spacing: -0.02em; line-height: 1.05; max-width: 14ch; position: relative; }
.login-art h2 strong { font-weight: 800; }
.login-panel { display: grid; place-items: center; padding: 2rem var(--gutter); }
.login-panel form { width: min(100%, 26rem); display: grid; gap: 1.25rem; }
.login-panel h1 { font-size: 2rem; font-weight: 700; }
.login-panel .m-logo { display: block; margin-bottom: 1.5rem; }
@media (min-width: 60rem) { .login-panel .m-logo { display: none; } }
.login-panel .m-logo img { width: 11rem; background: var(--field); padding: 0.9rem 1.1rem; border-radius: var(--radius-sm); }
.login .fld input { min-height: 3rem; }
.remember { display: flex; gap: 0.6rem; align-items: center; font-size: 0.9375rem; }
.remember input { width: 1.15rem; height: 1.15rem; }

/* narrow screens: tables become stacked rows, nav wraps instead of clipping */
@media (max-width: 44rem) {
  .a-table { min-width: 0; }
  .a-table thead { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .a-table, .a-table tbody, .a-table tr, .a-table td { display: block; }
  .a-table tr { padding: 0.9rem 1.1rem; border-bottom: 1px solid var(--line-soft); }
  .a-table tr:last-child { border-bottom: 0; }
  .a-table td { border: 0; padding: 0.2rem 0; display: flex; gap: 0.75rem; justify-content: space-between; align-items: baseline; text-align: right; }
  .a-table td::before { content: attr(data-label); flex: none; color: var(--ink-soft); font-size: 0.8125rem; font-weight: 600; text-align: left; }
  .a-table td.who { display: block; text-align: left; padding-bottom: 0.4rem; }
  .a-table td.who::before { content: none; }
  .a-table td:not([data-label]) { justify-content: flex-start; padding-top: 0.5rem; }
  .a-table td:not([data-label])::before { content: none; }
  .a-table .num { text-align: right; }
  .a-table .actions { justify-content: flex-start; }
  .a-nav { flex-wrap: wrap; overflow: visible; }
  .a-nav a { width: auto; }
}
.sec-entry-body { display: grid; gap: 1rem; }
.sec-entry-body[hidden] { display: none; }
.sec-entry-head .sec-toggle { display: flex; align-items: center; gap: 0.5rem; border: 0; background: transparent; padding: 0.25rem 0; text-align: left; min-width: 0; flex: 1; }
.sec-entry-head .sec-toggle strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.sec-entry-head .sec-toggle svg { flex: none; transition: transform 0.3s var(--ease-out); }
.sec-entry.is-collapsed .sec-toggle svg { transform: rotate(-90deg); }

.a-form-main, .a-side-form, .a-panel, .a-grid-2, .sec-list, .sec-entry, .sec-entry-body { grid-template-columns: minmax(0, 1fr); }
@media (min-width: 44rem) { .a-grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
