:root {
  --ink: #1b3a4b;
  --ink-2: #24485c;
  --paper: #f3f6f4;
  --card: #ffffff;
  --line: #d5ded8;
  --teal: #0e6b66;
  --teal-2: #14857f;
  --clay: #b4532a;
  --text: #1c2c2a;
  --muted: #5c6d68;
  --ok: #1b7a4e;
  --warn: #8a5a10;
  --bad: #a32626;
  --side: 216px;
  --top: 48px;
  --font: "Source Sans 3", "Segoe UI", sans-serif;
  --display: "Newsreader", "Times New Roman", serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --t: 180ms;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.4;
  color: var(--text);
  background: var(--paper);
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--teal); outline-offset: 2px; }
h1, h2, p { margin: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  border-radius: 6px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  text-decoration: none;
  font-size: 13px;
  font-weight: 600;
  transition: background var(--t) var(--ease), transform var(--t) var(--ease), opacity var(--t) var(--ease);
}
.btn-primary { background: var(--teal); color: #fff; }
.btn-primary:hover { background: var(--teal-2); transform: translateY(-1px); }
.btn-primary:active { transform: none; }
.btn-ghost { border-color: var(--line); background: #fff; color: var(--ink); }
.btn-ghost:hover { background: var(--paper); }
.btn-danger, .btn.danger { color: var(--bad); }
.btn-block { width: 100%; height: 36px; }
.icon-btn {
  width: 32px;
  height: 32px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  color: var(--ink);
}
.text-btn {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  padding: 0 4px;
}

.login { min-height: 100vh; background: var(--paper); }
.login-split {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(280px, 42%) 1fr;
}
.login-aside {
  background: var(--ink);
  color: #e7f0ec;
  padding: 48px 40px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.aside-kicker {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #9fb4ad;
  margin-bottom: 8px;
}
.login-aside h1 {
  font-family: var(--display);
  font-weight: 550;
  font-size: 2.5rem;
  line-height: 1.05;
  letter-spacing: -0.02em;
  color: #fff;
  animation: rise 640ms var(--ease) both;
}
.aside-lead {
  margin-top: 12px;
  max-width: 28ch;
  color: #c5d5cf;
  font-size: 15px;
  animation: rise 700ms var(--ease) 80ms both;
}
.aside-services {
  list-style: none;
  padding: 0;
  margin: 28px 0 0;
  display: grid;
  gap: 8px;
  animation: rise 700ms var(--ease) 150ms both;
}
.aside-services li {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
}
.aside-services i, .swatch i, .legend i, .svc i {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  display: inline-block;
  flex: none;
}
.login-panel {
  display: grid;
  place-items: center;
  padding: 32px 20px;
}
.login-card {
  width: min(360px, 100%);
  animation: rise 700ms var(--ease) 40ms both;
}
.login-card h2 { font-size: 1.25rem; color: var(--ink); font-weight: 650; }
.login-sub { color: var(--muted); font-size: 13px; margin: 4px 0 16px; }
.form-error {
  background: #fdecec;
  color: var(--bad);
  border-radius: 6px;
  padding: 8px 10px;
  font-size: 13px;
  margin-bottom: 12px;
}

.field { display: grid; gap: 4px; margin-bottom: 10px; }
.field > span, .check span { font-size: 12px; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea, .swal-desk input, .swal-desk textarea, .swal-desk select {
  width: 100%;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 6px;
  padding: 6px 8px;
  min-height: 32px;
}
.field textarea { min-height: 72px; resize: vertical; }
.pass-wrap { display: flex; align-items: center; gap: 6px; }
.pass-wrap input { flex: 1; }
.check { display: flex; align-items: center; gap: 8px; margin: 4px 0 14px; font-size: 13px; }
.check span { font-weight: 500; color: var(--text); }

.app { min-height: 100vh; }
.side {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--side);
  background: var(--ink);
  color: #d7e4de;
  display: flex;
  flex-direction: column;
  z-index: 20;
}
.brand {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 14px 14px 8px;
  text-decoration: none;
  color: #fff;
}
.brand-mark {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: var(--teal);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 16px;
}
.brand-text { display: grid; line-height: 1.15; }
.brand-text strong { font-size: 13.5px; font-weight: 650; }
.brand-text em { font-style: normal; font-size: 11px; color: #9fb4ad; }
.swatch { display: flex; gap: 4px; padding: 0 14px 10px; }
.swatch i { width: 18px; height: 4px; border-radius: 2px; }
.nav { display: grid; padding: 4px 8px; gap: 2px; }
.nav a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: #d5e2dc;
  font-size: 13.5px;
  padding: 7px 10px;
  border-radius: 6px;
  border-left: 2px solid transparent;
}
.nav-ico { width: 16px; height: 16px; flex: none; opacity: 0.85; }
.nav a:hover { background: rgba(255,255,255,0.05); }
.nav a.is-on { background: rgba(255,255,255,0.07); color: #fff; border-left-color: #7dcfc6; }
.nav a.is-on .nav-ico { opacity: 1; }
.side-backup {
  margin-top: auto;
  padding: 12px 16px 16px;
  font-size: 11px;
  color: #9fb4ad;
  border-top: 1px solid rgba(255,255,255,0.08);
}
.side-backup strong { color: #fff; font-weight: 600; }
.main {
  margin-left: var(--side);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.desk-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  flex-wrap: wrap;
  margin-top: auto;
  padding: 8px 18px;
  border-top: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
  font-size: 12px;
}
.desk-foot p { margin: 0; }
.desk-credit { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.desk-credit a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink);
  text-decoration: none;
}
.desk-credit a strong { font-weight: 650; }
.desk-credit img { width: 18px; height: 18px; object-fit: contain; }
.desk-phone { color: var(--muted); font-variant-numeric: tabular-nums; }
.desk-credit a:hover, .desk-phone:hover { color: var(--teal); }
.desk-credit a:focus-visible, .desk-phone:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}
.top {
  height: var(--top);
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  background: #fff;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 15;
}
#nav-toggle { display: none; }
.top-date { margin: 0; font-size: 13px; color: var(--muted); }
.who { margin-left: auto; position: relative; }
.who-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 4px;
  border-radius: 8px;
}
.who-btn:hover { background: var(--paper); }
.avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--ink);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 10px;
  font-weight: 700;
}
.who-name { font-size: 13px; font-weight: 600; color: var(--ink); }
.who-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 4px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  min-width: 168px;
  padding: 4px;
  box-shadow: 0 8px 24px rgba(27, 58, 75, 0.08);
}
.who-menu a {
  display: block;
  text-decoration: none;
  padding: 7px 8px;
  border-radius: 5px;
  font-size: 13px;
}
.who-menu a:hover { background: var(--paper); }
.content { flex: 1; padding: 16px 18px 24px; }
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 12px;
  margin-bottom: 12px;
}
.page-head h1 { font-size: 1.25rem; font-weight: 650; color: var(--ink); letter-spacing: -0.01em; }
.sub, .empty, .meta { color: var(--muted); font-size: 12.5px; }
.desk { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.panel {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
}
.panel-h, .cal-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}
.panel h2 { font-size: 14px; font-weight: 650; color: var(--ink); }
.feed { list-style: none; margin: 0; padding: 0; }
.feed li {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}
.feed li:first-child { border-top: 0; }
.feed strong { font-size: 13.5px; }
.feed p { font-size: 12.5px; color: var(--text); margin-top: 2px; }
.feed .is-done strong { color: var(--muted); text-decoration: line-through; }
.feed .is-over .meta { color: var(--clay); }
.row-actions { display: flex; gap: 4px; flex: none; align-items: flex-start; }
.cal-panel { margin-top: 12px; }
.cal-nav { display: flex; align-items: center; gap: 6px; }
.cal-nav h2 { margin-left: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.seg button {
  border: 0;
  background: #fff;
  padding: 5px 10px;
  font-size: 12.5px;
  color: var(--muted);
  cursor: pointer;
}
.seg button.is-on { background: var(--ink); color: #fff; }
.legend { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.legend button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 99px;
  padding: 3px 8px;
  font-size: 12px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}
.legend button.is-off { opacity: 0.4; }
.cal-month, .cal-week { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.cal-dow { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); padding: 2px 4px 4px; }
.cal-cell, .cal-col {
  background: #fbfcfb;
  border: 1px solid var(--line);
  border-radius: 6px;
  min-height: 88px;
  padding: 4px;
}
.cal-cell.is-out { opacity: 0.45; }
.cal-cell.is-today, .cal-col.is-today { box-shadow: inset 0 0 0 1.5px var(--teal); }
.cal-num, .cal-col h3 { font-size: 12px; font-weight: 650; color: var(--ink); }
.cal-col { min-height: 220px; max-height: 460px; overflow: auto; }
.cal-col h3 { position: sticky; top: 0; background: #fbfcfb; padding-bottom: 4px; }
.chip {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 1px;
  text-align: left;
  border: 0;
  border-left: 3px solid var(--c, var(--teal));
  background: color-mix(in srgb, var(--c, var(--teal)) 16%, white);
  border-radius: 3px;
  padding: 2px 4px;
  margin-top: 3px;
  cursor: pointer;
  font-size: 11.5px;
  line-height: 1.25;
}
.chip-top { display: flex; gap: 4px; align-items: baseline; min-width: 0; }
.cal-cell .chip-top { flex-direction: column; align-items: flex-start; gap: 0; }
.cal-cell .chip-top span { width: 100%; }
.chip em { font-style: normal; font-weight: 700; color: var(--ink); flex: none; }
.chip-top span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.chip-note {
  display: block;
  color: var(--ink);
  font-size: 10.5px;
  font-weight: 550;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-col .chip-note,
.day-list .chip-note {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}
.cal-more {
  border: 0;
  background: transparent;
  color: var(--teal);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 4px;
}
.day-list { display: grid; gap: 6px; }
.day-list .chip { font-size: 13px; padding: 6px 8px; }
.cal-list { display: grid; gap: 12px; }
.cal-list h3 { font-size: 13px; color: var(--ink); margin-bottom: 4px; }
.list-note { grid-column: 2 / -1; white-space: normal; font-size: 12px; }
.list-row {
  display: grid;
  grid-template-columns: 7.4rem 1.3fr 1fr 1fr auto;
  gap: 8px;
  align-items: center;
  width: 100%;
  text-align: left;
  border: 0;
  border-left: 3px solid var(--c, var(--teal));
  background: color-mix(in srgb, var(--c, var(--teal)) 12%, white);
  border-radius: 4px;
  padding: 6px 8px;
  margin-top: 4px;
  cursor: pointer;
  font-size: 13px;
}
.badge {
  display: inline-block;
  border-radius: 99px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 650;
  background: var(--paper);
  color: var(--ink);
}
.badge-approved { background: #e5f5ec; color: var(--ok); }
.badge-pending { background: #f8f1de; color: var(--warn); }
.badge-cancelled, .badge-rejected { background: #fdecec; color: var(--bad); }
.svc { display: inline-flex; align-items: center; gap: 6px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 12px; max-width: 760px; }
.span-2 { grid-column: span 2; }
.lookup { position: relative; display: block; }
.lookup-list {
  position: absolute;
  z-index: 5;
  left: 0;
  right: 0;
  top: calc(100% + 2px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  max-height: 220px;
  overflow: auto;
  box-shadow: 0 8px 24px rgba(27, 58, 75, 0.08);
}
.lookup-list button {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: #fff;
  padding: 7px 8px;
  cursor: pointer;
  font-size: 13px;
}
.lookup-list button:hover { background: var(--paper); }
.lookup-list small { color: var(--muted); margin-left: 6px; }
.modal[hidden] { display: none !important; }
.modal {
  position: fixed;
  inset: 0;
  z-index: 40;
  background: rgba(27, 58, 75, 0.42);
  display: grid;
  place-items: center;
  padding: 16px;
}
.modal-card {
  width: min(440px, 100%);
  background: #fff;
  border-radius: 10px;
  padding: 14px;
  max-height: min(86vh, 640px);
  overflow: auto;
}
.modal-card h2 { font-size: 1.05rem; color: var(--ink); margin-bottom: 10px; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 8px; }
.shade[hidden] { display: none !important; }
.shade { position: fixed; inset: 0; background: rgba(27, 58, 75, 0.35); z-index: 18; }
.plain { width: 100%; border-collapse: collapse; font-size: 13px; }
.plain th, .plain td { text-align: left; padding: 7px 8px; border-bottom: 1px solid var(--line); }
.plain th { font-size: 11px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.col-act { white-space: nowrap; text-align: right; }
.col-notes { max-width: 240px; white-space: normal; }
.hint { font-size: 12px; color: var(--muted); margin-top: 2px; }

.dt-container { font-family: var(--font); font-size: 12.5px; }
.dt-container .dt-search input,
.dt-container .dt-length select {
  font: inherit;
  height: 30px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
  background: #fff;
}
.dt-container .dt-layout-row { margin: 0 0 8px; align-items: center; }
.dt-container table.dataTable { border-collapse: collapse; width: 100% !important; }
.dt-container table.dataTable thead th {
  font-size: 11px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 650;
  border-bottom: 1px solid var(--line);
  padding: 6px 8px;
}
.dt-container table.dataTable tbody td {
  padding: 6px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: middle;
}
.dt-container table.dataTable tbody tr:hover { background: #f7faf8; }
.dt-container .dt-paging .dt-paging-button {
  border-radius: 5px !important;
  border: 1px solid transparent !important;
  padding: 2px 7px !important;
}
.dt-container .dt-paging .dt-paging-button.current {
  background: var(--ink) !important;
  color: #fff !important;
  border-color: var(--ink) !important;
}
.dt-buttons { display: flex; gap: 6px; flex-wrap: wrap; }
.dt-buttons .dt-button {
  height: 30px !important;
  border: 1px solid var(--line) !important;
  background: #fff !important;
  border-radius: 6px !important;
  font-family: var(--font) !important;
  font-size: 12px !important;
  font-weight: 650 !important;
  color: var(--ink) !important;
  padding: 0 10px !important;
}
.dt-buttons .dt-button:hover { background: var(--paper) !important; }
div.dt-processing { font-size: 12px; border: 1px solid var(--line) !important; border-radius: 6px; background: #fff; }
.table-panel { overflow-x: auto; }
.swal2-container { z-index: 2000; }
.swal-desk { font-family: var(--font) !important; border-radius: 10px !important; padding: 1rem 1rem 0.85rem !important; }
.swal-desk .swal2-title { font-size: 1.05rem !important; color: var(--ink) !important; padding: 0 !important; }
.swal-desk .swal2-html-container { font-size: 13.5px !important; color: var(--text) !important; margin: 8px 0 0 !important; }
.swal-desk .swal2-actions { gap: 8px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; margin: 6px 0; }

@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.asan { position: fixed; right: 16px; bottom: 30px; z-index: 32; }
.asan-open {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 36px;
  padding: 0 12px 0 8px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 650;
  box-shadow: 0 8px 20px rgba(27, 58, 75, 0.18);
}
.asan-mark {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--teal);
  display: grid;
  place-items: center;
  font-family: var(--display);
  font-size: 13px;
}
.asan-panel[hidden] { display: none !important; }
.asan-hints[hidden] { display: none !important; }
.asan-panel {
  position: absolute;
  right: 0;
  bottom: 46px;
  width: min(340px, calc(100vw - 32px));
  height: min(460px, calc(100vh - 120px));
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 16px 40px rgba(27, 58, 75, 0.16);
  display: flex;
  flex-direction: column;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t) var(--ease), transform var(--t) var(--ease);
}
.asan-panel.is-on { opacity: 1; transform: none; }
.asan-h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  background: var(--ink);
  color: #fff;
  border-radius: 11px 11px 0 0;
  font-family: var(--display);
  font-size: 16px;
  font-weight: 550;
}
.asan-x {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
  font-size: 18px;
}
.asan-log { flex: 1; overflow: auto; padding: 10px; display: flex; flex-direction: column; gap: 8px; background: var(--paper); }
.asan-msg {
  max-width: 92%;
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 13px;
  line-height: 1.35;
  white-space: pre-wrap;
}
.asan-msg.is-bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); color: var(--text); }
.asan-msg.is-me { align-self: flex-end; background: var(--ink); color: #fff; }
.asan-item { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; }
.asan-item i { width: 8px; height: 8px; border-radius: 2px; flex: none; }
.asan-item b { font-variant-numeric: tabular-nums; }
.asan-hints { display: flex; flex-wrap: wrap; gap: 6px; }
.asan-hints button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 12px;
  cursor: pointer;
  color: var(--ink);
}
.asan-form { display: flex; gap: 6px; padding: 8px; border-top: 1px solid var(--line); }
.asan-form input {
  flex: 1;
  min-width: 0;
  height: 32px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 8px;
}
@media (max-width: 900px) {
  .desk, .form-grid, .login-split { grid-template-columns: 1fr; }
  .span-2 { grid-column: auto; }
  .login-aside { padding: 28px 20px 18px; }
  .login-aside h1 { font-size: 2rem; }
  #nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .side { transform: translateX(-105%); transition: transform var(--t) var(--ease); }
  .side.is-open { transform: none; }
  .main { margin-left: 0; }
  .who-name { display: none; }
  .list-row { grid-template-columns: 7.4rem 1fr; }
  .cal-week { min-width: 720px; }
  .cal-scroll { overflow-x: auto; }
  .page-head { align-items: flex-start; flex-direction: column; }
  .desk-foot { padding: 10px 14px 14px; }
  .asan-panel {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }
  .asan-h {
    border-radius: 0;
    padding-top: max(8px, env(safe-area-inset-top));
  }
  .asan-form { padding-bottom: max(8px, env(safe-area-inset-bottom)); }
  .asan-panel.is-on ~ .asan-open { visibility: hidden; }
}

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