/* Leave Desk — a leave register, not a SaaS dashboard.
   Ink on pale eucalyptus paper, serif numerals, hairline rules. */

:root {
  --paper: #eef1f0;
  --surface: #ffffff;
  --ink: #16252c;
  --ink-soft: #5c6e72;
  --rule: #d3dbd8;
  --rule-strong: #b3c0bb;
  --green: #1f6f5c;
  --green-deep: #14503f;
  --amber: #9a6413;
  --amber-bg: #f6ecd8;
  --red: #8f352b;
  --red-bg: #f6e2de;
  --green-bg: #dcebe4;
  --focus: #2f7ae5;
  --radius: 3px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: "Public Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-variant-numeric: tabular-nums;
}

h1, h2, h3 {
  font-family: Newsreader, Georgia, "Times New Roman", serif;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin: 0 0 .4rem;
}
h1 { font-size: 1.9rem; line-height: 1.15; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.02rem; font-family: inherit; font-weight: 650; }

a { color: var(--green-deep); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--green); }

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

/* ------------------------------------------------------------- shell */
.shell { display: flex; min-height: 100vh; }

.rail {
  width: 232px;
  flex: 0 0 232px;
  background: var(--ink);
  color: #cdd8d5;
  padding: 1.4rem 1rem 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.6rem;
}
.rail .wordmark {
  font-family: Newsreader, Georgia, serif;
  font-size: 1.35rem;
  color: #fff;
  line-height: 1.1;
  display: block;
  text-decoration: none;
}
.rail .wordmark small {
  display: block;
  font-family: inherit;
  font-size: .72rem;
  color: #8fa49e;
  letter-spacing: .04em;
}
.rail nav { display: flex; flex-direction: column; gap: .1rem; }
.rail nav a {
  color: #cdd8d5;
  text-decoration: none;
  padding: .42rem .6rem;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  gap: .5rem;
}
.rail nav a:hover { background: #22343c; color: #fff; }
.rail nav a.active { background: #2c4149; color: #fff; box-shadow: inset 2px 0 0 var(--green); }
.rail .group-title {
  font-size: .74rem;
  color: #7d938d;
  padding: .6rem .6rem .2rem;
  border-top: 1px solid #2a3c43;
  margin-top: .5rem;
}
.rail .whoami { margin-top: auto; font-size: .82rem; color: #93a8a2; }
.rail .whoami strong { display: block; color: #fff; font-weight: 600; font-size: .92rem; }
.rail form { margin-top: .6rem; }
.rail .signout {
  background: none; border: 1px solid #3b5158; color: #cdd8d5;
  padding: .3rem .7rem; border-radius: var(--radius); cursor: pointer; font: inherit; font-size: .84rem;
}
.rail .signout:hover { border-color: #6b8189; color: #fff; }
.badge-count {
  background: var(--green); color: #fff; border-radius: 10px;
  padding: 0 .45rem; font-size: .76rem; line-height: 1.5;
}

.main { flex: 1; min-width: 0; padding: 2rem 2.2rem 4rem; max-width: 1080px; }
.page-head { margin-bottom: 1.6rem; }
.page-head p { color: var(--ink-soft); margin: .2rem 0 0; max-width: 62ch; }

/* ------------------------------------------------------------- pieces */
.panel {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  margin-bottom: 1.3rem;
}
.panel > h2, .panel > h3 { margin-top: 0; }
.panel-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 1rem; margin-bottom: .8rem;
}

/* Balance ledger: three columns split by hairlines, big serif numerals. */
.ledger {
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  margin-bottom: 1.3rem;
}
.ledger .cell { padding: 1.1rem 1.2rem; border-left: 1px solid var(--rule); }
.ledger .cell:first-child { border-left: 0; }
.ledger .num {
  font-family: Newsreader, Georgia, serif;
  font-size: 2.6rem;
  line-height: 1;
  display: block;
}
.ledger .num span { font-size: 1rem; color: var(--ink-soft); font-family: inherit; }
.ledger .cell h3 { margin: .45rem 0 .15rem; font-size: .95rem; }
.ledger .meta { font-size: .82rem; color: var(--ink-soft); margin: 0; }
.ledger .bar { height: 3px; background: var(--rule); margin-top: .7rem; }
.ledger .bar i { display: block; height: 3px; background: var(--green); }

/* Approval chain reads as a numbered sequence, because it is one. */
.chain { list-style: none; margin: 0; padding: 0; }
.chain li {
  position: relative;
  padding: 0 0 1.1rem 2.3rem;
  border-left: 1px solid var(--rule);
  margin-left: .7rem;
}
.chain li:last-child { border-left-color: transparent; padding-bottom: 0; }
.chain .marker {
  position: absolute; left: -.72rem; top: 0;
  width: 1.45rem; height: 1.45rem; border-radius: 50%;
  background: var(--surface); border: 1px solid var(--rule-strong);
  display: grid; place-items: center; font-size: .8rem; color: var(--ink-soft);
}
.chain li.done .marker { background: var(--green); border-color: var(--green); color: #fff; }
.chain li.now .marker { border-color: var(--amber); color: var(--amber); border-width: 2px; }
.chain li.no .marker { background: var(--red); border-color: var(--red); color: #fff; }
.chain .who { font-weight: 600; }
.chain .role, .chain .when { color: var(--ink-soft); font-size: .86rem; }
.chain .note { margin: .3rem 0 0; font-size: .9rem; }

/* status */
.status {
  display: inline-block; padding: .08rem .5rem; border-radius: 2px;
  font-size: .8rem; font-weight: 600; border: 1px solid;
}
.status.pending { background: var(--amber-bg); color: var(--amber); border-color: #e2cda2; }
.status.approved { background: var(--green-bg); color: var(--green-deep); border-color: #a9cbbc; }
.status.rejected { background: var(--red-bg); color: var(--red); border-color: #dcb4ac; }
.status.cancelled { background: #e9eceb; color: var(--ink-soft); border-color: var(--rule); }

/* tables */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: .55rem .6rem; border-bottom: 1px solid var(--rule); vertical-align: top; }
th { font-size: .82rem; color: var(--ink-soft); font-weight: 600; border-bottom-color: var(--rule-strong); }
tbody tr:last-child td { border-bottom: 0; }
td.num, th.num { text-align: right; }
.table-wrap { overflow-x: auto; }

/* forms */
label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: .25rem; }
input[type=text], input[type=email], input[type=date], input[type=password],
input[type=number], select, textarea {
  width: 100%; padding: .48rem .6rem; font: inherit; color: var(--ink);
  background: #fff; border: 1px solid var(--rule-strong); border-radius: var(--radius);
}
textarea { min-height: 5.5rem; resize: vertical; }
.field { margin-bottom: .95rem; }
.field .hint { font-size: .82rem; color: var(--ink-soft); font-weight: 400; margin: .25rem 0 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 1rem; }
.check { display: flex; align-items: center; gap: .5rem; font-weight: 500; }
.check input { width: auto; }
fieldset { border: 0; padding: 0; margin: 0 0 1rem; }
legend { font-weight: 650; padding: 0; margin-bottom: .6rem; }

.btn {
  display: inline-block; font: inherit; font-weight: 600; cursor: pointer;
  padding: .45rem 1rem; border-radius: var(--radius);
  background: var(--green); color: #fff; border: 1px solid var(--green);
  text-decoration: none;
}
.btn:hover { background: var(--green-deep); border-color: var(--green-deep); color: #fff; }
.btn.secondary { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.btn.secondary:hover { background: #e7ebea; color: var(--ink); }
.btn.danger { background: var(--red); border-color: var(--red); }
.btn.danger:hover { background: #712a22; border-color: #712a22; }
.btn.small { padding: .25rem .65rem; font-size: .86rem; }
.actions { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; margin-top: 1rem; }

/* radio cards for leave type */
.types { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; }
.types label {
  border: 1px solid var(--rule-strong); border-radius: var(--radius);
  padding: .7rem .8rem; cursor: pointer; font-weight: 500; background: #fff;
}
.types label:has(input:checked) { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.types label:has(input:disabled) { opacity: .5; cursor: not-allowed; }
.types input { margin-right: .4rem; }
.types .left { display: block; font-size: .84rem; color: var(--ink-soft); margin-top: .2rem; }

/* flashes */
.flashes { list-style: none; padding: 0; margin: 0 0 1.2rem; }
.flashes li {
  padding: .6rem .85rem; border-radius: var(--radius); margin-bottom: .5rem;
  border-left: 3px solid var(--rule-strong); background: var(--surface);
}
.flashes .success { border-left-color: var(--green); }
.flashes .error { border-left-color: var(--red); }
.flashes .info { border-left-color: var(--focus); }

.empty {
  padding: 1.6rem 1.2rem; text-align: left; color: var(--ink-soft);
  border: 1px dashed var(--rule-strong); border-radius: var(--radius); background: var(--surface);
}
.empty p { margin: 0 0 .7rem; }

.muted { color: var(--ink-soft); }
.small { font-size: .86rem; }
.stack > * + * { margin-top: 1rem; }
.inline-form { display: inline; }

/* sign-in */
.signin { min-height: 100vh; display: grid; place-items: center; padding: 2rem 1rem; }
.signin .card {
  width: 100%; max-width: 380px; background: var(--surface);
  border: 1px solid var(--rule-strong); border-radius: var(--radius); padding: 1.8rem;
}
.signin h1 { font-size: 1.7rem; }
.signin .lede { color: var(--ink-soft); margin: 0 0 1.4rem; }

@media (max-width: 860px) {
  .shell { flex-direction: column; }
  .rail { width: 100%; flex: none; flex-direction: column; }
  .rail .whoami { margin-top: 1rem; }
  .main { padding: 1.2rem 1rem 3rem; }
  .ledger, .grid-2, .grid-3, .types { grid-template-columns: 1fr; }
  .ledger .cell { border-left: 0; border-top: 1px solid var(--rule); }
  .ledger .cell:first-child { border-top: 0; }
}

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