/* VRTEKH portal — brand colours taken from the payslip header */
:root {
  --ink: #1f2a3a;
  --ink-soft: #5a6577;
  --paper: #ffffff;
  --mist: #f3f5f8;
  --line: #d9dee6;
  --orange: #ff8125;   /* VR TEKH logo orange */
  --orange-dark: #e86f15;
  --blue: #3f6fb8;     /* payslip heading blue */
  --red: #b42318;
  --green: #1e7a46;
  font-family: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--mist); }
a { color: var(--blue); }
h1, h2, h3 { line-height: 1.25; margin: 0 0 .5rem; }
h1 { font-size: 1.75rem; font-weight: 600; }
h2 { font-size: 1.25rem; font-weight: 600; }
p { margin: 0 0 1rem; }
[hidden] { display: none !important; }

:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }

/* Top bar */
.bar { background: var(--paper); border-bottom: 1px solid var(--line); }
.bar-inner { max-width: 1180px; margin: 0 auto; padding: .75rem 1.25rem; display: flex; align-items: center; gap: 1rem; }
.brand { display: flex; align-items: center; gap: .75rem; text-decoration: none; color: var(--ink-soft); font-size: .85rem; }
.brand img { height: 34px; width: auto; display: block; }
.brand span { border-left: 1px solid var(--line); padding-left: .75rem; }
.bar .who { margin-left: auto; text-align: right; font-size: .9rem; }
.bar .who span { display: block; color: var(--ink-soft); font-size: .8rem; }

main { max-width: 1180px; margin: 0 auto; padding: 2rem 1.25rem 4rem; }
.panel { background: var(--paper); border: 1px solid var(--line); border-radius: 6px; padding: 1.5rem; margin-bottom: 1.5rem; }

/* Forms */
label { display: block; font-weight: 500; font-size: .9rem; margin: 0 0 .25rem; }
.field { margin-bottom: 1rem; }
.hint { color: var(--ink-soft); font-size: .85rem; margin-top: .25rem; }
input, select {
  width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid #b8c0cc; border-radius: 4px; background: var(--paper); color: var(--ink);
}
input:focus { border-color: var(--blue); }
.row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
@media (max-width: 560px) { .row { grid-template-columns: 1fr; } }

button {
  font: inherit; font-weight: 600; border-radius: 4px; padding: .6rem 1.1rem; cursor: pointer;
  border: 1px solid var(--ink); background: var(--paper); color: var(--ink);
}
button.primary { background: var(--orange); border-color: var(--orange); color: var(--ink); }
button.primary:hover { background: var(--orange-dark); border-color: var(--orange-dark); }
button.link { border: none; background: none; color: var(--blue); padding: .25rem .4rem; font-weight: 500; }
button.link.danger { color: var(--red); }
button:disabled { opacity: .55; cursor: wait; }

.msg { padding: .7rem .9rem; border-radius: 4px; margin-bottom: 1rem; font-size: .95rem; }
.msg.error { background: #fdecea; color: var(--red); }
.msg.ok { background: #e6f4ec; color: var(--green); }

/* Sign-in page: the company letterhead is the hero */
.signin { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; }
.letterhead { background: var(--ink); color: #fff; padding: 3rem; display: flex; flex-direction: column; justify-content: space-between; }
.letterhead .mark { width: min(420px, 100%); height: auto; display: block; }
.letterhead .company { font-size: 1.1rem; margin-top: 1.5rem; max-width: 30ch; color: #d5dbe5; }
.letterhead address { font-style: normal; color: #b9c3d3; font-size: .9rem; max-width: 40ch; }
.signin-form { display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--paper); }
.signin-form form { width: 100%; max-width: 360px; }
.signin-form button.primary { width: 100%; margin-top: .5rem; }
@media (max-width: 800px) {
  .signin { grid-template-columns: 1fr; }
  .letterhead { padding: 1.5rem; }
  .letterhead .mark { width: 200px; }
  .letterhead .company { margin: .5rem 0 0; font-size: 1rem; }
  .letterhead address { display: none; }
  .signin-form { align-items: flex-start; padding: 1.5rem; }
}

/* Details list */
dl.details { display: grid; grid-template-columns: minmax(9rem, 12rem) 1fr; gap: .5rem 1.5rem; margin: 0; }
dl.details dt { color: var(--ink-soft); }
dl.details dd { margin: 0; font-weight: 500; }

.soon { color: var(--ink-soft); border-left: 3px solid var(--line); padding-left: .9rem; }

/* Table */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { text-align: left; padding: .6rem .45rem; border-bottom: 1px solid var(--line); white-space: nowrap; }
th { font-weight: 600; color: var(--ink-soft); font-size: .85rem; }
tr.inactive td { color: #98a1ae; }
.tag { font-size: .8rem; padding: .1rem .45rem; border-radius: 3px; background: var(--mist); }
.tag.warn { background: #fff4e5; color: #8a4b0f; }
.tag.admin { background: #e8eef8; color: var(--blue); }

.toolbar { display: flex; gap: 1rem; align-items: center; margin-bottom: 1rem; flex-wrap: wrap; }
.toolbar input { max-width: 280px; }
.toolbar button.primary { margin-left: auto; }

dialog { border: 1px solid var(--line); border-radius: 6px; padding: 1.5rem; width: min(520px, 92vw); color: var(--ink); }
dialog::backdrop { background: rgba(31, 42, 58, .45); }
.actions { display: flex; gap: .75rem; justify-content: flex-end; margin-top: 1rem; }
.temp-pw { font-size: 1.4rem; font-weight: 600; letter-spacing: .05em; background: var(--mist); padding: .75rem 1rem; border-radius: 4px; text-align: center; margin: .75rem 0; user-select: all; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* ---- Step 2: profile, leave, attendance, appraisals ---- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 1rem; margin-bottom: .75rem; }
.stat { border: 1px solid var(--line); border-radius: 6px; padding: 1rem 1.1rem; background: var(--paper); }
.stat-label { color: var(--ink-soft); font-size: .85rem; }
.stat-value { font-size: 2rem; font-weight: 600; line-height: 1.2; }
.stat-note { font-size: .85rem; color: var(--ink-soft); }
.over { color: var(--red); font-weight: 600; }
table.num td:not(:first-child), table.num th:not(:first-child) { text-align: right; }
td.wrap { white-space: normal; min-width: 14rem; color: var(--ink-soft); font-size: .9rem; }
.prewrap { white-space: pre-wrap; }

.tabs { display: flex; gap: .25rem; border-bottom: 1px solid var(--line); margin-bottom: 1.5rem; overflow-x: auto; }
.tabs button { border: none; background: none; border-bottom: 3px solid transparent; border-radius: 0; padding: .7rem 1rem; color: var(--ink-soft); font-weight: 600; white-space: nowrap; }
.tabs button[aria-selected="true"] { color: var(--ink); border-bottom-color: var(--orange); }
.profile-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; margin-bottom: 1rem; }
.profile-head .hint { margin: 0; }
.back { display: inline-block; margin-bottom: 1rem; font-size: .9rem; }

.appraisal { border: 1px solid var(--line); border-radius: 6px; padding: 1.25rem 1.5rem; margin-bottom: 1rem; background: var(--paper); }
.appraisal header { display: flex; gap: 1rem; align-items: center; margin-bottom: .5rem; }
.appraisal header h2 { margin: 0; }
.appraisal h3 { font-size: .95rem; margin: 1rem 0 .25rem; color: var(--ink-soft); font-weight: 600; }
.appraisal p { margin: 0; }
.rating { display: flex; align-items: center; gap: .5rem; }
.dots { display: inline-flex; gap: 4px; }
.dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--orange); }
.dot.on { background: var(--orange); }

textarea { width: 100%; font: inherit; padding: .6rem .7rem; border: 1px solid #b8c0cc; border-radius: 4px; min-height: 4.5rem; resize: vertical; background: var(--paper); color: var(--ink); }
.inline-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 0 1rem; align-items: end; }
.inline-form .field { margin-bottom: .75rem; }
.inline-form .wide { grid-column: span 2; }
details.add { margin: 1rem 0; }
details.add summary { cursor: pointer; font-weight: 600; color: var(--blue); }
a.emp-link { color: var(--ink); font-weight: 500; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; }
a.emp-link:hover { text-decoration-color: var(--orange); }
.notice { border: 1px solid #f2d3ad; background: #fff8ee; border-radius: 6px; padding: 1rem 1.25rem; margin-bottom: 1.5rem; display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.notice p { margin: 0; flex: 1; min-width: 16rem; }

/* ---- Personal details ---- */
.tag.ok { background: #e6f4ec; color: var(--green); }
h3.sub { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); margin: 1.5rem 0 .6rem; font-weight: 600; }
h3.sub:first-child { margin-top: 0; }
.person { display: grid; grid-template-columns: 140px 1fr; gap: 1.5rem; align-items: start; }
@media (max-width: 640px) { .person { grid-template-columns: 1fr; } }
.photo { width: 140px; height: 140px; border-radius: 8px; object-fit: cover; background: var(--mist); border: 1px solid var(--line); display: flex; align-items: center; justify-content: center; color: var(--ink-soft); font-size: .85rem; text-align: center; }
fieldset { border: none; padding: 0; margin: 0 0 1.25rem; }
legend { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); font-weight: 600; margin-bottom: .6rem; padding: 0; }
.req::after { content: ' *'; color: var(--red); }
.lockbar { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin-bottom: 1rem; }
.lockbar p { margin: 0; flex: 1; }
.log { font-size: .9rem; }
.log td { white-space: normal; }
.keybox { font-family: ui-monospace, Menlo, monospace; background: var(--mist); padding: .6rem .8rem; border-radius: 4px; word-break: break-all; user-select: all; }
