/*
 * DAO Derma HR - design tokens and base components.
 * Brand anchor: pine green. Surfaces are cool porcelain and white; mint is reserved
 * for the one live thing in the product, the clock.
 */

@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/readex-arabic.woff2") format("woff2");
  unicode-range: U+0600-06FF, U+0750-077F, U+0870-0891, U+0897-08E1, U+08E3-08FF, U+200C-200E, U+2010-2011, U+204F, U+2E41, U+FB50-FDFF, U+FE70-FE74, U+FE76-FEFC;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/readex-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Readex Pro";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("../fonts/readex-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  /* brand */
  --pine: #00666A;
  --pine-deep: #00494D;
  --pine-soft: #0A7F86;
  --mint: #87D2CE;
  --mint-ink: #00666A;

  /* surfaces and text */
  --paper: #F0F6F6;
  --surface: #FFFFFF;
  --mist: #E1EFEF;
  --mist-soft: #F5FAFA;
  --line: #D5E3E3;
  --ink: #14282A;
  --ink-soft: #4F6668;
  --ink-faint: #839597;

  /* status */
  --ok-bg: #DFF3E8;   --ok-fg: #166A47;
  --wait-bg: #FCEFD0; --wait-fg: #805A0E;
  --bad-bg: #FADFD8;  --bad-fg: #A33C27;
  --info-bg: #DFEAF8; --info-fg: #285A98;
  --neutral-bg: #E6EFEF; --neutral-fg: #4F6668;

  /* shape */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 18px;
  --r-xl: 28px;
  --shadow-pop: 0 18px 48px rgba(0, 40, 44, 0.22);

  --font: "Readex Pro", "Segoe UI", system-ui, -apple-system, sans-serif;

  /* legacy names still referenced by inline styles in the screens */
  --green-900: var(--pine);
  --green-700: var(--pine-soft);
  --green-500: #3AA8AD;
  --green-100: var(--mist);
  --cream: var(--paper);
  --cream-dark: var(--line);
  --white: var(--surface);
  --coral: var(--mint-ink);
  --warn: var(--bad-fg);
  --radius: var(--r-md);
  --shadow: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

#app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  position: relative;
}

button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; }
a { color: inherit; }

:focus-visible {
  outline: 3px solid rgba(10, 127, 134, 0.45);
  outline-offset: 2px;
}

/* ---------- Brand ---------- */
.brand { display: flex; align-items: center; gap: 12px; }

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: var(--mint);
  color: var(--pine-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}

.brand-name { font-weight: 600; font-size: 16px; letter-spacing: -0.01em; color: var(--pine); }

/* ---------- Page header ---------- */
.page-title {
  font-size: 30px;
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1.15;
  color: var(--ink);
  margin: 0 0 6px;
}

.page-subtitle {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 26px;
  max-width: 64ch;
}

/* ---------- Surfaces ----------
 * Cards that sit next to each other read as one divided list; a lone card
 * stands on its own. No shadows: hierarchy comes from borders and spacing. */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 0;
  padding: 16px 18px;
  margin: 0 0 -1px;
}
.card:first-child, :not(.card) + .card { border-top-left-radius: var(--r-md); border-top-right-radius: var(--r-md); }
.card:last-child, .card:has(+ :not(.card)) { border-bottom-left-radius: var(--r-md); border-bottom-right-radius: var(--r-md); margin-bottom: 18px; }

.card-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; }

.card-title { font-weight: 500; font-size: 15px; color: var(--ink); }
.card-sub { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

/* ---------- Status badges (sentence case, dot + label) ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px 3px 8px;
  border-radius: 100px;
  white-space: nowrap;
  background: var(--neutral-bg);
  color: var(--neutral-fg);
}
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; flex-shrink: 0; }

.badge-approved, .badge-active, .badge-hired, .badge-confirmed, .badge-paid { background: var(--ok-bg); color: var(--ok-fg); }
.badge-pending, .badge-onleave, .badge-due { background: var(--wait-bg); color: var(--wait-fg); }
.badge-rejected, .badge-cancelled { background: var(--bad-bg); color: var(--bad-fg); }
.badge-interview { background: var(--info-bg); color: var(--info-fg); }
.badge-inactive, .badge-applied, .badge-completed { background: var(--neutral-bg); color: var(--neutral-fg); }

/* ---------- Forms ---------- */
.field { margin-bottom: 16px; }

.field label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin-bottom: 6px;
}

.field input, .field select, .field textarea {
  width: 100%;
  min-height: 46px;
  padding: 11px 14px;
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  background: var(--surface);
  font-size: 15px;
  color: var(--ink);
}
.field textarea { min-height: 84px; resize: vertical; line-height: 1.45; }
.field input::placeholder, .field textarea::placeholder { color: var(--ink-faint); }

.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--pine-soft);
  box-shadow: 0 0 0 3px rgba(10, 127, 134, 0.18);
}

.field input:disabled { background: var(--mist-soft); color: var(--ink-soft); }

/* ---------- Buttons ---------- */
.btn-primary, .btn-secondary, .btn-outline-danger {
  width: 100%;
  min-height: 46px;
  border-radius: var(--r-md);
  padding: 11px 18px;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.2;
  transition: background 120ms ease, border-color 120ms ease, transform 80ms ease;
}
.btn-primary:active, .btn-secondary:active, .btn-outline-danger:active { transform: translateY(1px); }

.btn-primary { background: var(--pine); color: #fff; border: 1px solid var(--pine); font-weight: 600; }
.btn-primary:hover { background: var(--pine-deep); }
.btn-primary:disabled, .btn-secondary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-secondary { background: var(--surface); color: var(--pine); border: 1px solid var(--line); }
.btn-secondary:hover { background: var(--mist-soft); border-color: #B3CDCD; }

.btn-outline-danger { background: transparent; color: var(--bad-fg); border: 1px solid #E3B4A8; }
.btn-outline-danger:hover { background: #FDF3F0; }

.error-text { color: var(--bad-fg); font-size: 13px; margin: 0 0 14px; }
.helper-text { color: var(--ink-soft); font-size: 13px; margin-top: 18px; line-height: 1.6; }

.readonly-note {
  font-size: 13px;
  color: var(--ink-soft);
  background: var(--mist-soft);
  border: 1px solid var(--line);
  padding: 10px 14px;
  border-radius: var(--r-md);
  margin-bottom: 16px;
  line-height: 1.5;
}

/* ---------- Sign-in ---------- */
.auth-wrap {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 40px 24px;
}

.auth-logo-img { width: 190px; height: auto; display: block; margin-bottom: 28px; }
.auth-logo {
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: var(--pine);
  color: var(--mint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  margin-bottom: 28px;
}

.auth-title { font-size: 30px; font-weight: 600; letter-spacing: -0.025em; color: var(--ink); margin-bottom: 6px; }
.auth-sub { color: var(--ink-soft); font-size: 15px; margin-bottom: 30px; }

/* ---------- Misc ---------- */
.empty-state {
  padding: 36px 16px;
  color: var(--ink-soft);
  font-size: 14px;
  background: var(--surface);
  border: 1px dashed #BFD5D5;
  border-radius: var(--r-md);
  text-align: center;
}

.toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--pine-deep);
  color: #fff;
  padding: 12px 20px;
  border-radius: 100px;
  font-size: 14px;
  font-weight: 500;
  box-shadow: var(--shadow-pop);
  z-index: 200;
  max-width: 92%;
  text-align: center;
  animation: toast-in 180ms ease-out;
}
@keyframes toast-in { from { opacity: 0; transform: translate(-50%, 8px); } to { opacity: 1; transform: translate(-50%, 0); } }

.section-gap { margin-top: 24px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; }
}
