/* iStudy HR -- shared styles. Plain CSS, no framework, matches the
   plain-HTML/no-build-step convention used across the rest of this repo.

   Brand palette/fonts match istudyacademy.co.za so this reads as the same
   organization, not a generic app -- see SETUP.md "Branding" for the
   source of these values and how to update them if the main site's brand
   ever changes. */

:root {
  /* -- Brand tokens (from istudyacademy.co.za) -------------------------- */
  --brand-teal: #0F7B76;
  --brand-teal-deep: #0A5C58;
  --brand-orange: #E87722;
  --brand-orange-deep: #B85A12;
  --brand-ink: #0F2E4F;
  --brand-ink-soft: #3D5A75;
  --brand-paper: #FAF7F1;
  --brand-paper-2: #F2EDE3;
  --brand-rule: #DED6C7;

  /* -- Semantic tokens used throughout this file ------------------------ */
  --color-bg: var(--brand-paper);
  --color-surface: var(--brand-paper-2);
  --color-surface-raised: #ffffff;
  --color-border: var(--brand-rule);
  --color-text: var(--brand-ink);
  --color-text-muted: var(--brand-ink-soft);
  --color-primary: var(--brand-teal);
  --color-primary-hover: var(--brand-teal-deep);
  --color-accent: var(--brand-orange);
  --color-accent-hover: var(--brand-orange-deep);
  --color-danger: #B3261E;
  --color-danger-bg: #FBE9E7;
  --color-success: var(--brand-teal-deep);
  --color-success-bg: #E3F1EF;
  --color-warning-bg: #FCEADA;
  --color-warning-text: var(--brand-orange-deep);
  --radius: 14px;
  --radius-pill: 999px;
  --shadow: 0 8px 24px rgba(15, 46, 79, 0.08), 0 2px 6px rgba(15, 46, 79, 0.05);

  --font-display: "Bricolage Grotesque", ui-sans-serif, system-ui, "Segoe UI", sans-serif;
  --font-body: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.5;
}

a { color: var(--color-primary); }

.container {
  max-width: 960px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

.container-narrow {
  max-width: 480px;
  margin: 0 auto;
  padding: 24px 20px 64px;
}

header.topbar {
  background: var(--color-surface-raised);
  border-bottom: 1px solid var(--color-border);
}

.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--color-text);
  text-decoration: none;
}

.brand img.brand-logo {
  height: 32px;
  width: auto;
  display: block;
}

.brand span { color: var(--color-primary); }

nav.tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

nav.tabs a {
  padding: 7px 14px;
  border-radius: var(--radius-pill);
  text-decoration: none;
  color: var(--color-text-muted);
  font-size: 0.92rem;
  font-weight: 500;
}

nav.tabs a.active,
nav.tabs a:hover {
  background: var(--color-warning-bg);
  color: var(--color-accent-hover);
}

.card {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 22px;
  margin-bottom: 20px;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 700; }
h1 { font-size: 1.6rem; margin: 0 0 6px; }
h2 { font-size: 1.2rem; margin: 0 0 12px; }
h3 { font-size: 1.02rem; margin: 0 0 8px; }
.muted { color: var(--color-text-muted); }
.small { font-size: 0.85rem; }

.page-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 4px;
  margin-top: 14px;
}

label:first-child { margin-top: 0; }

input, select, textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--color-border);
  border-radius: 10px;
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--color-surface-raised);
  color: var(--color-text);
}

input:focus, select:focus, textarea:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 1px;
}

textarea { resize: vertical; min-height: 80px; }

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}

button, .btn {
  display: inline-block;
  padding: 10px 20px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-primary);
  background: var(--color-primary);
  color: #fff;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: var(--font-body);
  cursor: pointer;
  text-decoration: none;
  text-align: center;
}

button:hover, .btn:hover { background: var(--color-primary-hover); border-color: var(--color-primary-hover); }
button:disabled { opacity: 0.6; cursor: not-allowed; }

.btn-secondary {
  background: var(--color-surface-raised);
  color: var(--color-primary);
}
.btn-secondary:hover { background: var(--color-success-bg); }

/* The one or two standout calls-to-action per flow (sending an offer,
   accepting one) -- orange is the brand's secondary/CTA color, reserved
   for these rather than every button, so it still reads as an accent. */
.btn-accent {
  background: var(--color-accent);
  border-color: var(--color-accent);
}
.btn-accent:hover { background: var(--color-accent-hover); border-color: var(--color-accent-hover); }

.btn-danger {
  background: var(--color-danger);
  border-color: var(--color-danger);
}
.btn-danger:hover { background: #921f18; border-color: #921f18; }

.btn-row { display: flex; gap: 10px; margin-top: 18px; flex-wrap: wrap; }

table { width: 100%; border-collapse: collapse; }
th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--color-border);
  font-size: 0.92rem;
}
th { color: var(--color-text-muted); font-weight: 600; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.02em; }
tr:hover td { background: rgba(15, 123, 118, 0.04); }
tr.clickable { cursor: pointer; }

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: var(--radius-pill);
  font-size: 0.78rem;
  font-weight: 600;
}
.badge-active, .badge-accepted, .badge-finalized { background: var(--color-success-bg); color: var(--color-success); }
.badge-candidate, .badge-draft, .badge-sent { background: var(--color-warning-bg); color: var(--color-warning-text); }
.badge-terminated, .badge-declined { background: var(--color-danger-bg); color: var(--color-danger); }
.badge-on_leave { background: #E7ECF2; color: var(--brand-ink-soft); }

.alert {
  padding: 11px 16px;
  border-radius: var(--radius);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.alert-error { background: var(--color-danger-bg); color: var(--color-danger); }
.alert-success { background: var(--color-success-bg); color: var(--color-success); }
.alert-info { background: var(--color-warning-bg); color: var(--color-warning-text); }

.hidden { display: none !important; }

.kv { display: flex; justify-content: space-between; padding: 6px 0; border-bottom: 1px dashed var(--color-border); }
.kv:last-child { border-bottom: none; }
.kv .label { color: var(--color-text-muted); }
.kv .value { font-weight: 600; }

.empty-state { text-align: center; padding: 40px 20px; color: var(--color-text-muted); }

footer.app-footer {
  text-align: center;
  color: var(--color-text-muted);
  font-size: 0.8rem;
  padding: 30px 20px;
}
