/* LCPL Lab System — interface styles
   Palette: petrol sidebar, mineral background, Lotte red as the brand accent,
   with status colours that match the approval stamp. */
:root {
  --ink: #13232b;
  --ink-2: #3c4f56;
  --muted: #687a7f;
  --line: #dbe3e1;
  --line-2: #e9eeed;
  --bg: #eef2f1;
  --surface: #ffffff;
  --petrol: #0e3b43;
  --petrol-2: #15505a;
  --petrol-3: #1d6370;
  --red: #d42a30;
  --amber: #a8640c;  --amber-bg: #fdf3e3;
  --green: #1c7350;  --green-bg: #e6f4ed;
  --blue: #23589f;   --blue-bg: #e8effa;
  --rose: #b0262d;   --rose-bg: #fbe9ea;
  --radius: 14px;
  --radius-s: 9px;
  --shadow: 0 1px 2px rgba(19, 35, 43, .06), 0 6px 18px -10px rgba(19, 35, 43, .18);
  --font: "Instrument Sans", "Segoe UI", system-ui, -apple-system, sans-serif;
}
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
a { color: var(--petrol-3); text-decoration: none; }
a:hover { text-decoration: underline; }
b, strong { font-weight: 600; }
:focus-visible { outline: 2.5px solid var(--petrol-3); outline-offset: 2px; border-radius: 6px; }
.num, table, .stat b, .clock b { font-variant-numeric: tabular-nums; }

/* ---------- shell ---------- */
.shell { display: flex; min-height: 100vh; }
.sidebar {
  width: 256px; flex: none; position: sticky; top: 0; height: 100vh;
  background: var(--petrol); color: #c9dadb; display: flex; flex-direction: column; padding: 18px 14px;
}
.brand { display: flex; gap: 12px; align-items: center; color: #fff; padding: 6px 8px 22px; text-decoration: none !important; }
.brand-mark { width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center; background: var(--red); color: #fff; font-size: 18px; box-shadow: inset 0 -3px 0 rgba(0,0,0,.18); }
.brand b { display: block; font-size: 17px; letter-spacing: -.01em; }
.brand small { display: block; color: #8fb1b4; font-size: 12.5px; }
.nav { display: flex; flex-direction: column; gap: 2px; overflow-y: auto; }
.nav a { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 10px; color: #c9dadb; font-weight: 500; text-decoration: none; }
.nav a i { width: 18px; text-align: center; color: #86a9ad; }
.nav a:hover { background: var(--petrol-2); color: #fff; }
.nav a.active { background: #fff; color: var(--petrol); }
.nav a.active i { color: var(--red); }
.nav .count { margin-left: auto; font-style: normal; font-size: 12px; font-weight: 700; background: var(--red); color: #fff; border-radius: 20px; padding: 1px 8px; }
.nav-group { margin: 18px 12px 6px; font-size: 12.5px; color: #7fa2a6; }
.me { margin-top: auto; display: flex; align-items: center; gap: 10px; padding: 12px 8px 8px; border-top: 1px solid var(--petrol-2); }
.avatar { width: 36px; height: 36px; border-radius: 50%; background: var(--petrol-3); color: #fff; display: grid; place-items: center; font-weight: 600; font-size: 13px; flex: none; }
.me-text { flex: 1; min-width: 0; }
.me-text b { display: block; color: #fff; font-size: 13.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.me-text small { color: #8fb1b4; font-size: 12px; }
.me a { color: #8fb1b4; padding: 6px; border-radius: 8px; }
.me a:hover { color: #fff; background: var(--petrol-2); }
.credit { margin: 6px 8px 0; font-size: 11px; color: #5f8a8f; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 16px; padding: 22px 32px 10px; }
.titles { flex: 1; min-width: 0; }
.titles h1 { margin: 0; font-size: 26px; letter-spacing: -.02em; line-height: 1.2; }
.titles p { margin: 3px 0 0; color: var(--muted); }
.clock { display: flex; align-items: center; gap: 10px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 8px 14px; }
.clock i { color: var(--petrol-3); font-size: 18px; }
.clock b { display: block; font-size: 16px; line-height: 1.1; }
.clock small { color: var(--muted); font-size: 12px; }
.content { padding: 14px 32px 48px; display: flex; flex-direction: column; gap: 22px; }
.topbar .menu-btn { display: none; }
.scrim { display: none; }

/* ---------- surfaces ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); }
.panel-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.panel-head h2 { margin: 0; font-size: 16.5px; flex: 1; letter-spacing: -.01em; }
.panel-head p { margin: 0; color: var(--muted); font-size: 13.5px; width: 100%; order: 3; }
.panel-body { padding: 20px; }
.grid-2 { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 22px; align-items: start; }
.grid-form { display: grid; grid-template-columns: 360px minmax(0, 1fr); gap: 22px; align-items: start; }

/* ---------- stats ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; display: flex; gap: 14px; align-items: center; text-decoration: none !important; color: inherit; }
.stat i { width: 42px; height: 42px; border-radius: 11px; display: grid; place-items: center; font-size: 17px; flex: none; }
.stat b { display: block; font-size: 26px; line-height: 1.1; letter-spacing: -.02em; }
.stat span { color: var(--muted); font-size: 13.5px; }
.stat.is-pending i { background: var(--amber-bg); color: var(--amber); }
.stat.is-ok i { background: var(--green-bg); color: var(--green); }
.stat.is-sent i { background: var(--blue-bg); color: var(--blue); }
.stat.is-neutral i { background: #e6eeee; color: var(--petrol-3); }
a.stat:hover { border-color: var(--petrol-3); }
.stat.attention { border-color: #ecc690; background: linear-gradient(0deg, #fffaf1, #fff); }

/* ---------- tables ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th { text-align: left; font-weight: 600; color: var(--muted); font-size: 12.5px; padding: 11px 16px; background: #f6f8f8; border-bottom: 1px solid var(--line); white-space: nowrap; }
td { padding: 13px 16px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fafcfb; }
td.when { white-space: nowrap; }
td.when b { display: block; font-weight: 600; }
td.when small { color: var(--muted); }
.title-cell { font-weight: 600; max-width: 340px; min-width: 200px; }
td.nowrap { white-space: nowrap; }
.by { display: block; color: var(--muted); font-size: 12px; margin-top: 5px; }
.title-cell small { display: block; font-weight: 400; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }
.actions { white-space: nowrap; text-align: right; }
.empty { text-align: center; padding: 44px 20px; color: var(--muted); }
.empty i { font-size: 28px; color: #a9bbbd; display: block; margin-bottom: 10px; }

/* ---------- pills + the approval stamp ---------- */
.pill { display: inline-block; font-size: 12.5px; font-weight: 600; padding: 3px 10px; border-radius: 20px; white-space: nowrap; }
.pill-pending { background: var(--amber-bg); color: var(--amber); }
.pill-approved { background: var(--green-bg); color: var(--green); }
.pill-sent { background: var(--blue-bg); color: var(--blue); }
.pill-rejected { background: var(--rose-bg); color: var(--rose); }
.pill-failed { background: var(--rose-bg); color: var(--rose); }

.stamp {
  display: inline-flex; align-items: center; gap: 9px; padding: 6px 11px 6px 9px; border-radius: 8px;
  border: 1.5px solid currentColor; box-shadow: inset 0 0 0 2px #fff, inset 0 0 0 3px currentColor;
  font-size: 12.5px; line-height: 1.25; white-space: nowrap; transform: rotate(-1.2deg); background: #fff;
}
.stamp > i { font-size: 13px; }
.stamp b { font-weight: 700; }
.stamp-body { display: flex; flex-direction: column; }
.stamp-verb { font-size: 10.5px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; }
.stamp-by { color: var(--muted); font-size: 11.5px; }
.stamp-ok { color: var(--green); }
.stamp-no { color: var(--rose); }
.stamp-wait { color: var(--amber); transform: none; box-shadow: none; border-style: dashed; }
.stamp-unknown { color: #7d8b8e; transform: none; box-shadow: none; border-style: dashed; }
.stamp-unknown .stamp-by { margin-left: 2px; }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 600 14px/1 var(--font); padding: 10px 16px; border-radius: 10px; border: 1px solid transparent; cursor: pointer; text-decoration: none !important; white-space: nowrap; }
.btn-primary { background: var(--petrol); color: #fff; }
.btn-primary:hover { background: var(--petrol-2); }
.btn-approve { background: var(--green); color: #fff; }
.btn-approve:hover { background: #165e41; }
.btn-reject { background: #fff; color: var(--rose); border-color: #ecc3c6; }
.btn-reject:hover { background: var(--rose-bg); }
.btn-ghost { background: #fff; color: var(--ink-2); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--petrol-3); color: var(--petrol); }
.btn-danger { background: var(--rose); color: #fff; }
.btn-sm { padding: 7px 11px; font-size: 13px; border-radius: 8px; }
.btn-block { width: 100%; }
.icon-btn { width: 34px; height: 34px; display: inline-grid; place-items: center; border-radius: 9px; border: 1px solid var(--line); background: #fff; color: var(--ink-2); cursor: pointer; text-decoration: none !important; }
.icon-btn:hover { border-color: var(--petrol-3); color: var(--petrol); }
.icon-btn.danger:hover { border-color: var(--rose); color: var(--rose); background: var(--rose-bg); }
form.inline { display: inline; }
button:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- forms ---------- */
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.field label, .label { font-weight: 600; font-size: 13.5px; color: var(--ink-2); }
.field .hint { color: var(--muted); font-size: 12.5px; }
.input, select.input, textarea.input {
  width: 100%; font: 15px var(--font); color: var(--ink); background: #fff; border: 1px solid var(--line);
  border-radius: 10px; padding: 10px 12px; transition: border-color .15s, box-shadow .15s;
}
.input:focus { outline: none; border-color: var(--petrol-3); box-shadow: 0 0 0 3px rgba(29, 99, 112, .15); }
textarea.input { resize: vertical; min-height: 90px; }
.check { display: flex; gap: 9px; align-items: center; font-size: 14px; }
.check input { width: 17px; height: 17px; accent-color: var(--petrol); }
.row-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: flex-end; padding: 16px 20px; border-bottom: 1px solid var(--line-2); }
.filters .field { margin: 0; min-width: 140px; }
.filters .field.grow { flex: 1; min-width: 220px; }
.filters .input { padding: 8px 11px; font-size: 14px; }

/* drop zone */
.drop { border: 2px dashed #b9cbcc; border-radius: var(--radius); background: #f7faf9; padding: 34px 20px; text-align: center; position: relative; transition: background .15s, border-color .15s; }
.drop.over { border-color: var(--petrol-3); background: #ecf5f4; }
.drop input[type=file] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.drop i { font-size: 30px; color: var(--petrol-3); }
.drop p { margin: 8px 0 2px; font-weight: 600; }
.drop small { color: var(--muted); }
.file-list { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.file-list li { display: flex; gap: 10px; align-items: center; padding: 8px 12px; border-radius: 9px; background: #f2f6f5; font-size: 13.5px; }
.file-list li span { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-list li small { color: var(--muted); }

/* ---------- flash ---------- */
.flash { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-radius: 12px; border: 1px solid; font-weight: 500; }
.flash-success { background: var(--green-bg); color: #135c3f; border-color: #bfe0cf; }
.flash-error { background: var(--rose-bg); color: #8e1c22; border-color: #f0c5c8; }
.flash-info { background: var(--blue-bg); color: #1c477f; border-color: #c9d8ef; }
.flash span { flex: 1; }
.flash-x { background: none; border: 0; font-size: 22px; line-height: 1; color: inherit; opacity: .6; cursor: pointer; }

/* ---------- approval batches ---------- */
.batch { border-bottom: 1px solid var(--line-2); padding: 18px 20px; display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; gap: 14px; }
.batch:last-child { border-bottom: 0; }
.batch h3 { margin: 0 0 4px; font-size: 15.5px; }
.meta { display: flex; flex-wrap: wrap; gap: 6px 18px; color: var(--muted); font-size: 13px; }
.meta i { margin-right: 5px; color: #91a5a8; }
.batch .desc { margin: 10px 0 0; padding: 10px 12px; background: #f6f8f8; border-left: 3px solid var(--petrol-3); border-radius: 0 8px 8px 0; font-size: 13.5px; color: var(--ink-2); }
.batch .files { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.chip { display: inline-flex; align-items: center; gap: 7px; padding: 6px 10px; border: 1px solid var(--line); border-radius: 8px; font-size: 13px; color: var(--ink-2); background: #fff; max-width: 100%; }
.chip i { color: var(--red); }
.chip span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
a.chip:hover { border-color: var(--petrol-3); text-decoration: none; }
.decide { display: flex; flex-direction: column; gap: 8px; min-width: 210px; }
.decide textarea { min-height: 60px; font-size: 13.5px; }
.decide .btns { display: flex; gap: 8px; }
.decide .btns .btn { flex: 1; }
.bulkbar { display: flex; gap: 12px; align-items: center; padding: 12px 20px; background: #f6f8f8; border-bottom: 1px solid var(--line-2); flex-wrap: wrap; }
.bulkbar .check { margin-right: auto; }

/* timeline of decisions */
.timeline { list-style: none; margin: 0; padding: 6px 20px 14px; }
.timeline li { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.timeline li:last-child { border-bottom: 0; }
.timeline .t-title { font-weight: 600; font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.timeline small { color: var(--muted); font-size: 12.5px; }

/* archive */
details.year { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
details.year > summary { cursor: pointer; padding: 16px 20px; font-size: 18px; font-weight: 700; display: flex; align-items: center; gap: 12px; list-style: none; }
details.year > summary::-webkit-details-marker { display: none; }
details.year > summary::after { content: "\f078"; font: 900 13px "Font Awesome 6 Free"; margin-left: auto; color: var(--muted); transition: transform .2s; }
details.year[open] > summary::after { transform: rotate(180deg); }
details.year > summary small { font-size: 13px; font-weight: 500; color: var(--muted); }
details.month { border-top: 1px solid var(--line-2); }
details.month > summary { cursor: pointer; padding: 12px 20px; font-weight: 600; display: flex; gap: 10px; align-items: center; background: #f8faf9; }
details.month > summary small { color: var(--muted); font-weight: 500; }

/* pagination */
.pager { display: flex; justify-content: space-between; align-items: center; padding: 14px 20px; border-top: 1px solid var(--line-2); color: var(--muted); font-size: 13.5px; gap: 12px; flex-wrap: wrap; }
.pager div { display: flex; gap: 6px; }

/* ---------- login ---------- */
.login { min-height: 100vh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(360px, 1fr); }
.login-art { background: var(--petrol); color: #e4eeee; padding: 48px 56px; display: flex; flex-direction: column; position: relative; overflow: hidden; }
.login-art::before { content: ""; position: absolute; inset: 0; opacity: .14;
  background-image: radial-gradient(circle at 1px 1px, #9fd1d4 1px, transparent 0); background-size: 22px 22px; }
.login-art > * { position: relative; }
.login-art h1 { font-size: clamp(34px, 4vw, 52px); line-height: 1.05; letter-spacing: -.03em; margin: auto 0 18px; color: #fff; max-width: 13ch; }
.login-art p { max-width: 42ch; color: #a9c6c8; font-size: 16.5px; margin: 0 0 36px; }
.flow { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: auto; }
.flow span { display: inline-flex; align-items: center; gap: 8px; padding: 8px 13px; border-radius: 30px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.12); font-size: 13.5px; }
.flow span i { color: #ff8d8f; }
.login-foot { display: flex; justify-content: space-between; color: #7fa2a6; font-size: 12.5px; margin-top: 40px; gap: 12px; flex-wrap: wrap; }
.login-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; background: var(--surface); }
.login-box { width: 100%; max-width: 380px; }
.login-box h2 { font-size: 26px; letter-spacing: -.02em; margin: 18px 0 4px; }
.login-box > p { color: var(--muted); margin: 0 0 28px; }

/* ---------- responsive ---------- */
@media (max-width: 1640px) { .grid-2 { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 1180px) { .grid-2, .grid-form { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 900px) {
  .sidebar { position: fixed; z-index: 50; left: 0; transform: translateX(-100%); transition: transform .25s ease; }
  body.nav-open .sidebar { transform: none; }
  body.nav-open .scrim { display: block; position: fixed; inset: 0; background: rgba(10, 30, 35, .45); z-index: 40; }
  .topbar .menu-btn { display: inline-grid; }
  .topbar { padding: 16px 18px 6px; flex-wrap: wrap; }
  .content { padding: 12px 18px 40px; }
  .clock { order: 3; width: 100%; }
  .batch { grid-template-columns: 26px minmax(0, 1fr); }
  .decide { grid-column: 1 / -1; }
  .login { grid-template-columns: 1fr; }
  .login-art { padding: 32px 26px; }
  .login-art h1 { margin-top: 40px; }
  .row-fields { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } .stamp { transform: none; } }
@media print {
  .sidebar, .topbar .menu-btn, .filters, .pager, .actions, .flash { display: none !important; }
  .content { padding: 0; } .panel { box-shadow: none; }
}
