/* Goldinjaya HR -- shared styles.
   Palette lifted from the goldinjaya.com landing page so the HR pages read as
   part of the same site rather than a bolt-on. Sized for a phone held in a
   workshop: 16px base (stops iOS zooming on focus), generous tap targets. */

:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --line: #e2e8f0;
  --ink: #0f172a;
  --muted: #64748b;
  --accent: #0ea5e9;
  --accent-dark: #0369a1;
  --accent-soft: #e0f2fe;
  --ok: #15803d;
  --ok-soft: #dcfce7;
  --warn: #b45309;
  --warn-soft: #fef3c7;
  --bad: #b91c1c;
  --bad-soft: #fee2e2;
  --radius: 12px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  padding: 24px 16px 56px;
  font: 16px/1.55 ui-sans-serif, system-ui, 'Segoe UI', Roboto, sans-serif;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 720px; margin: 0 auto; }
.wrap-wide { max-width: 1100px; margin: 0 auto; }

/* ---------------------------------------------------------------- header */

.topbar {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 24px;
}
.topbar h1 { margin: 0 0 2px; font-size: 21px; letter-spacing: -0.02em; }
.topbar .sub { margin: 0; color: var(--muted); font-size: 14px; }
.topbar .spacer { margin-left: auto; }

/* Padded rather than just sized: the text is small, but the tappable box needs
   to clear ~44px or it is a miss-and-try-again on a phone. */
.back {
  display: inline-block;
  margin-bottom: 4px;
  padding: 11px 2px;
  color: var(--muted);
  font-size: 14px;
  text-decoration: none;
}
.back:hover { color: var(--accent-dark); }

/* Language picker. Six languages is too many for a row of buttons on a phone,
   so it is a native <select> -- which also gives every worker their own OS
   keyboard/scroll behaviour in their own script. */
.langbox { display: flex; align-items: center; gap: 6px; flex: none; }
.langbox .globe { font-size: 15px; }
select.langpick {
  width: auto;
  min-width: 140px;
  padding: 8px 10px;
  font-size: 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  cursor: pointer;
}

/* On a phone the picker and the heading cannot share a row -- side by side they
   crush the title into a two-word-per-line column. Give the picker its own line
   above the heading instead, so the title gets the full width. */
@media (max-width: 560px) {
  .topbar { flex-wrap: wrap; }
  .topbar .spacer { display: none; }
  .langbox {
    order: -1;
    width: 100%;
    justify-content: flex-end;
    margin-bottom: 10px;
  }
}

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

.card {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
}
.card > h2 {
  margin: 0 0 14px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

h2.section {
  margin: 0 0 10px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--muted);
}

/* Hub tiles, same shape as the landing page app cards. */
.tiles { display: grid; gap: 10px; }
.tile {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  color: inherit;
  text-decoration: none;
}
.tile:hover, .tile:focus-visible {
  border-color: #7dd3fc;
  background: #f0f9ff;
  outline: none;
}
.tile .icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 20px;
}
.tile .icon svg { width: 22px; height: 22px; display: block; }
.tile .name { font-weight: 600; }
.tile .desc { color: var(--muted); font-size: 13px; }
.tile .chev { margin-left: auto; flex: none; color: var(--muted); }

/* The Leave Form hub shouts a little: short labels in caps read faster on a
   phone held at arm's length in a workshop. `text-transform` leaves Chinese,
   Nepali, Bengali and Burmese untouched, since those scripts have no case --
   so this is safe to apply to all six languages at once. */
.hub h1 { text-transform: uppercase; letter-spacing: 0.05em; }
.hub .tile .name {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  font-size: 15px;
}

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

label.field { display: block; margin-bottom: 16px; }
label.field > span.lbl {
  display: block;
  margin-bottom: 6px;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}
label.field > span.hint {
  display: block;
  margin-top: 5px;
  font-size: 12.5px;
  color: var(--muted);
}

input[type='text'], input[type='date'], input[type='tel'],
input[type='number'], input[type='password'], select, textarea {
  width: 100%;
  padding: 11px 12px;
  font: inherit;
  color: var(--ink);
  background: #fff;
  border: 1px solid #cbd5e1;
  border-radius: 9px;
  -webkit-appearance: none;
  appearance: none;
}
select { background-image: none; }
input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18);
}
textarea { min-height: 80px; resize: vertical; }

.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
@media (max-width: 520px) { .row { grid-template-columns: 1fr; } }

/* Leave type picker: real radios, visually a grid of buttons. The input stays
   in the DOM (not display:none) so keyboard and screen readers still work. */
.types { display: grid; gap: 8px; grid-template-columns: repeat(2, 1fr); }
@media (max-width: 420px) { .types { grid-template-columns: 1fr; } }
.types label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  cursor: pointer;
  font-size: 14px;
}
.types input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.types label:has(input:checked) {
  border-color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}
.types label:has(input:focus-visible) { box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.18); }
.types .emoji { font-size: 18px; flex: none; }

.halfday { display: flex; gap: 8px; flex-wrap: wrap; }
.halfday label {
  flex: 1 1 120px;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 10px; border: 1px solid var(--line); border-radius: 9px;
  background: #fff; cursor: pointer; font-size: 14px;
}
.halfday input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.halfday label:has(input:checked) {
  border-color: var(--accent); background: var(--accent-soft); font-weight: 600;
}

/* --------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  font: inherit;
  font-weight: 600;
  border: 1px solid transparent;
  border-radius: 9px;
  cursor: pointer;
  background: var(--accent);
  color: #fff;
}
.btn:hover { background: var(--accent-dark); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-block { width: 100%; padding: 14px; font-size: 17px; }
.btn-quiet { background: #fff; color: var(--ink); border-color: #cbd5e1; }
.btn-quiet:hover { background: #f1f5f9; }
.btn-ok { background: var(--ok); }
.btn-ok:hover { background: #166534; }
.btn-bad { background: var(--bad); }
.btn-bad:hover { background: #991b1b; }
.btn-sm { padding: 7px 12px; font-size: 13px; }

/* Approve/Reject/Withdraw sit at 36px on a desktop row, which is fine with a
   mouse and marginal with a thumb. Grow them on small screens only. */
@media (max-width: 640px) {
  .btn-sm { padding: 11px 14px; }
  .filters select, .filters input { flex: 1 1 100%; }
}

/* ---------------------------------------------------------------- pieces */

.pill {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.pill-pending   { background: var(--warn-soft); color: var(--warn); }
.pill-approved  { background: var(--ok-soft);   color: var(--ok); }
.pill-rejected  { background: var(--bad-soft);  color: var(--bad); }
.pill-cancelled { background: #e2e8f0;          color: #475569; }

.balances { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 520px) { .balances { grid-template-columns: 1fr; } }
.bal {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
}
.bal .n { font-size: 24px; font-weight: 700; letter-spacing: -0.02em; }
.bal .k { font-size: 12px; color: var(--muted); }

.summary {
  display: flex; align-items: baseline; gap: 8px;
  padding: 12px 14px;
  border-radius: 10px;
  background: var(--accent-soft);
  color: var(--accent-dark);
  font-size: 14px;
}
.summary strong { font-size: 20px; }

.note {
  padding: 11px 13px;
  border-radius: 9px;
  font-size: 13.5px;
  margin-bottom: 14px;
}
.note-bad  { background: var(--bad-soft);  color: var(--bad); }
.note-ok   { background: var(--ok-soft);   color: var(--ok); }
.note-info { background: #f1f5f9;          color: #475569; }

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

/* ------------------------------------------------------------- req list */

.reqs { display: grid; gap: 10px; }
.req {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.req > .emoji { font-size: 20px; flex: none; line-height: 1.3; }
.req .body { min-width: 0; flex: 1; }
.req .ttl { font-weight: 600; font-size: 14.5px; }
.req .meta { color: var(--muted); font-size: 13px; }
.req .side { display: flex; flex-direction: column; align-items: flex-end; gap: 7px; flex: none; }

/* ---------------------------------------------------------------- table */

.tablewrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14px; }
table.grid th, table.grid td {
  padding: 10px 11px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  white-space: nowrap;
}
table.grid th {
  font-size: 11px; text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--muted); font-weight: 600;
}
table.grid td.wrap-cell { white-space: normal; min-width: 180px; }
table.grid tbody tr:hover { background: #f8fafc; }

/* ----------------------------------------------------------------- tabs */

.tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs button {
  border: 0; background: transparent; cursor: pointer;
  padding: 10px 14px; font: inherit; font-size: 14px; font-weight: 600;
  color: var(--muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tabs button[aria-selected='true'] { color: var(--accent-dark); border-bottom-color: var(--accent); }

.filters { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.filters select, .filters input { width: auto; flex: 1 1 150px; padding: 8px 10px; font-size: 14px; }

footer.foot { margin-top: 30px; color: var(--muted); font-size: 12px; }

.hidden { display: none !important; }
