/* AwardFares Desk Calendar.
   Tokens follow awardfares-recap/web/css/style.css, which mirrors the brand
   standards (awardfares-design/brand/brand-standards.json, approved 2026-10-28).
   Fonts: Barlow and Barlow Semi Condensed from awardfares-design/brand/fonts (SIL OFL). */

@font-face { font-family: "Barlow"; font-weight: 400; font-display: swap; src: url("/assets/fonts/Barlow-Regular.ttf") format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 500; font-display: swap; src: url("/assets/fonts/Barlow-Medium.ttf") format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 600; font-display: swap; src: url("/assets/fonts/Barlow-SemiBold.ttf") format("truetype"); }
@font-face { font-family: "Barlow"; font-weight: 700; font-display: swap; src: url("/assets/fonts/Barlow-Bold.ttf") format("truetype"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 500; font-display: swap; src: url("/assets/fonts/BarlowSemiCondensed-Medium.ttf") format("truetype"); }
@font-face { font-family: "Barlow Semi Condensed"; font-weight: 600; font-display: swap; src: url("/assets/fonts/BarlowSemiCondensed-SemiBold.ttf") format("truetype"); }

:root {
  --font: "Barlow", Arial, sans-serif;
  --font-cond: "Barlow Semi Condensed", Arial, sans-serif;
  --navy: #1D3863;
  --sky: #28BAEB;
  --brand: #2E5C8A;
  --on-brand: #FFFFFF;
  --heading: #1D3863;
  --surface: #F4F7FA;
  --card: #FDFEFF;
  --ink: #34383F;
  --ink-2: #5A6470;
  --hairline: #DCE4ED;
  --wash: #EAF0F6;
  --night: #1D3863;
  --night-ink: #F5F7FA;
  --night-2: #C9D6E6;
  --k-review: #2E5C8A;
  --k-review-bg: #EAF0F6;
  --k-decide: #B88A0C;
  --k-decide-bg: #FFF4D6;
  --k-decide-ink: #7A5A00;
  --k-build: #28BAEB;
  --k-build-bg: #E4F6FC;
  --k-deadline: #C2410C;
  --k-deadline-bg: #FCEBE2;
  --today: #28BAEB;
  --shadow: 0 1px 2px rgba(20, 35, 59, 0.06), 0 4px 12px rgba(20, 35, 59, 0.07);
}
[data-theme="dark"] {
  --brand: #28BAEB;
  --on-brand: #1D3863;
  --heading: #F5F7FA;
  --surface: #1D3863;
  --card: #274570;
  --ink: #F5F7FA;
  --ink-2: #C9D6E6;
  --hairline: #3A5A8A;
  --wash: #3A5A8A;
  --night: #142A4D;
  --k-review: #C9D6E6;
  --k-review-bg: #30507E;
  --k-decide: #F5C26B;
  --k-decide-bg: #555132;
  --k-decide-ink: #F5E3BC;
  --k-build: #28BAEB;
  --k-build-bg: #22547A;
  --k-deadline: #FF8A5C;
  --k-deadline-bg: #6B433B;
  --shadow: none;
}

* { box-sizing: border-box; min-width: 0; }
html, body { margin: 0; padding: 0; }
body { background: var(--surface); color: var(--ink); font: 400 15px/1.5 var(--font); overflow-x: clip; }
a { color: var(--brand); }
button, select, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sky); outline-offset: 2px; }

/* ---- top bar (same as the recap) ---- */
.topbar {
  position: sticky; top: 0; z-index: 40;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px;
  padding: 10px 18px; background: var(--card); border-bottom: 1px solid var(--hairline);
}
.topbar .logo { height: 26px; width: auto; display: block; }
.on-dark { display: none !important; }
[data-theme="dark"] .on-dark { display: block !important; }
[data-theme="dark"] .on-light { display: none !important; }
.wordmark span { color: var(--ink-2); font-family: var(--font-cond); font-weight: 600; font-size: 15px; letter-spacing: 0.08em; text-transform: uppercase; margin-right: 8px; }
.topbar button, .dlg button {
  font-size: 14px; background: var(--surface); border: 1px solid var(--hairline);
  border-radius: 8px; padding: 6px 12px; min-height: 36px; cursor: pointer;
}
.topbar button:hover, .dlg button:hover { border-color: var(--brand); }
button.primary { background: var(--brand) !important; color: var(--on-brand) !important; border-color: var(--brand) !important; font-weight: 600; }
.seg { display: inline-flex; border: 1px solid var(--hairline); border-radius: 8px; overflow: hidden; }
.topbar .seg button { border: 0; border-radius: 0; }
.seg button[aria-pressed="true"] { background: var(--navy); color: #fff; }
[data-theme="dark"] .seg button[aria-pressed="true"] { background: var(--sky); color: var(--navy); }
#range { font-size: 20px; font-weight: 600; color: var(--heading); margin: 0 0 0 6px; letter-spacing: -0.01em; white-space: nowrap; }
.spacer { flex: 1; }
.status { font-family: var(--font-cond); font-weight: 500; font-size: 13px; color: var(--ink-2); }

/* ---- layout ---- */
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 20px; padding: 18px 18px 60px; max-width: 1680px; margin: 0 auto; }
.legend { display: flex; flex-wrap: wrap; gap: 4px 18px; font-family: var(--font-cond); font-weight: 500; font-size: 13px; color: var(--ink-2); margin: 0 2px 12px; }
.legend i { display: inline-block; width: 10px; height: 10px; border-radius: 3px; margin-right: 6px; vertical-align: -1px; }
.legend .tz { margin-left: auto; }
.k-cloud { background: var(--night); } .k-review { background: var(--k-review); } .k-decide { background: var(--k-decide); }
.k-build { background: var(--k-build); } .k-deadline { background: var(--k-deadline); } .k-local { border: 2px dashed var(--k-review); }

/* ---- week ---- */
.week { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) repeat(2, minmax(0, .6fr)); gap: 10px; }
.day { background: var(--card); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow); display: flex; flex-direction: column; overflow: hidden; }
.day.weekend { opacity: .78; }
.day.today { border-color: var(--today); box-shadow: 0 0 0 2px var(--today); }
.dh { display: flex; align-items: baseline; gap: 8px; padding: 10px 12px 8px; }
.dh .wd { font-family: var(--font-cond); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); }
.dh .n { font-size: 26px; font-weight: 600; line-height: 1; color: var(--heading); font-variant-numeric: tabular-nums; }
.dh .tag { margin-left: auto; font-family: var(--font-cond); font-weight: 600; font-size: 12px; color: var(--on-brand); background: var(--brand); border-radius: 999px; padding: 0 8px; }
.night { background: var(--night); color: var(--night-ink); padding: 8px 12px 10px; }
.night .lim { font-family: var(--font-cond); font-weight: 500; font-size: 12px; color: var(--sky); margin-bottom: 4px; }
.night .empty { font-family: var(--font-cond); font-size: 13px; color: var(--night-2); }
.run { display: grid; grid-template-columns: 52px minmax(0, 1fr); gap: 0 6px; width: 100%; text-align: left; background: none; border: 0; color: inherit; padding: 2px 0; font-size: 13px; line-height: 1.35; cursor: pointer; }
.run .t { font-family: var(--font-cond); font-weight: 600; color: var(--sky); white-space: nowrap; font-variant-numeric: tabular-nums; }
.run:hover .nm { text-decoration: underline; }
.arrived { border-top: 1px solid rgba(201, 214, 230, .25); margin-top: 6px; padding-top: 6px; display: flex; flex-direction: column; gap: 3px; }
.arrived a { color: var(--night-2); font-size: 12.5px; text-decoration: none; line-height: 1.3; }
.arrived a:hover { color: #fff; text-decoration: underline; }
.arrived b { font-family: var(--font-cond); font-weight: 600; color: var(--sky); margin-right: 4px; }
.arrived .ah { font-family: var(--font-cond); font-weight: 600; font-size: 11.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--night-2); opacity: .8; }
.arrived details { display: flex; flex-direction: column; gap: 3px; }
.arrived summary { font-family: var(--font-cond); font-weight: 600; font-size: 12.5px; color: var(--sky); cursor: pointer; }
.arrived details a { display: block; margin-top: 3px; }
.mine { padding: 10px 10px 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.blk { display: block; width: 100%; text-align: left; border: 0; border-left: 3px solid var(--k-review); background: var(--k-review-bg); color: var(--ink); border-radius: 8px; padding: 6px 9px; font-size: 13.5px; line-height: 1.3; cursor: pointer; }
.blk .t { display: block; font-family: var(--font-cond); font-weight: 500; font-size: 12.5px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.blk:hover { filter: brightness(.97); }
.blk.decide { border-color: var(--k-decide); background: var(--k-decide-bg); }
.blk.build { border-color: var(--k-build); background: var(--k-build-bg); }
.blk.deadline { border-color: var(--k-deadline); background: var(--k-deadline-bg); font-weight: 600; }
.blk.local { border-left-style: dashed; background: var(--card); outline: 1px solid var(--hairline); }
.add { border: 1px dashed var(--hairline); background: none; border-radius: 8px; min-height: 34px; color: var(--ink-2); cursor: pointer; font-size: 13px; margin-top: auto; }
.add:hover { border-color: var(--brand); color: var(--brand); }

/* ---- month ---- */
.month { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.mh { font-family: var(--font-cond); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); padding: 0 6px; }
.mc { background: var(--card); border: 1px solid var(--hairline); border-radius: 10px; min-height: 118px; padding: 6px 8px; text-align: left; display: flex; flex-direction: column; gap: 3px; cursor: pointer; color: var(--ink); }
.mc:hover { border-color: var(--brand); }
.mc.out { opacity: .45; }
.mc.today { border-color: var(--today); box-shadow: 0 0 0 2px var(--today); }
.mn { font-size: 17px; font-weight: 600; color: var(--heading); }
.ml { font-size: 12px; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; width: 100%; padding-left: 6px; border-left: 2px solid var(--k-review); }
.ml.c { border-color: var(--night); color: var(--ink-2); font-family: var(--font-cond); font-weight: 500; }
[data-theme="dark"] .ml.c { border-color: var(--sky); }
.ml.decide { border-color: var(--k-decide); } .ml.build { border-color: var(--k-build); } .ml.deadline { border-color: var(--k-deadline); font-weight: 600; } .ml.local { border-left-style: dashed; }
.ml.more { border: 0; color: var(--ink-2); padding: 0; font-family: var(--font-cond); }

/* ---- panels ---- */
.panel, .side { background: var(--card); border: 1px solid var(--hairline); border-radius: 14px; box-shadow: var(--shadow); padding: 18px 20px; }
.panel { margin-top: 20px; }
.side { align-self: start; position: sticky; top: 74px; max-height: calc(100vh - 92px); overflow-y: auto; }
.panel-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 10px; }
h2 { font-size: 19px; font-weight: 600; color: var(--heading); margin: 0; }
.asof, .fine { font-family: var(--font-cond); font-weight: 500; font-size: 13px; color: var(--ink-2); }
.grp { margin-top: 14px; }
.grp h3 { display: flex; align-items: baseline; gap: 8px; font-family: var(--font-cond); font-weight: 600; font-size: 13px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-2); margin: 0 0 6px; }
.grp h3 .c { font-family: var(--font); font-size: 20px; letter-spacing: 0; color: var(--heading); }
.grp h3 i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.grp ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; }
.grp li a { display: flex; gap: 6px; text-decoration: none; color: var(--ink); font-size: 13.5px; line-height: 1.35; padding: 4px 6px; border-radius: 6px; }
.grp li a:hover { background: var(--wash); }
.grp li a b { font-family: var(--font-cond); font-weight: 600; color: var(--brand); flex: none; }
.grp .none { font-size: 13px; color: var(--ink-2); }
.scroll { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; font-size: 14px; }
th { text-align: left; font-family: var(--font-cond); font-weight: 600; font-size: 13px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--ink-2); border-bottom: 1px solid var(--hairline); padding: 6px 8px; }
td { border-bottom: 1px solid var(--hairline); padding: 8px; vertical-align: top; }
td.tm { white-space: nowrap; font-variant-numeric: tabular-nums; }
td .sub { font-family: var(--font-cond); font-weight: 500; font-size: 13px; color: var(--ink-2); }
tr.off td { color: var(--ink-2); }

/* ---- dialogs ---- */
dialog { border: 1px solid var(--hairline); border-radius: 14px; background: var(--card); color: var(--ink); padding: 0; width: min(520px, calc(100vw - 32px)); box-shadow: var(--shadow); }
dialog::backdrop { background: rgba(20, 35, 59, .45); }
.dlg { padding: 20px 22px; display: grid; gap: 12px; }
.dlg label { display: grid; gap: 4px; font-family: var(--font-cond); font-weight: 500; font-size: 13px; color: var(--ink-2); }
.dlg input, .dlg select, .dlg textarea { font-size: 16px; min-height: 40px; padding: 6px 10px; border: 1px solid var(--hairline); border-radius: 8px; background: var(--surface); color: var(--ink); }
.dlg .row { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 10px; }
.dlg .check { display: flex; align-items: center; gap: 8px; align-self: end; color: var(--ink); font-size: 14px; min-height: 40px; }
.dlg .check input { min-height: 0; }
.days { display: flex; flex-wrap: wrap; gap: 6px; }
.days label { display: flex; align-items: center; gap: 4px; border: 1px solid var(--hairline); border-radius: 8px; padding: 4px 9px; min-height: 36px; color: var(--ink); font-size: 14px; }
.days input { min-height: 0; }
.acts { display: flex; justify-content: space-between; gap: 8px; flex-wrap: wrap; }
.dlg button.ghost { color: var(--k-deadline); }
.dlg p { margin: 0; }
.toast { position: fixed; left: 50%; bottom: 20px; transform: translateX(-50%); background: var(--navy); color: #fff; padding: 10px 16px; border-radius: 10px; display: none; gap: 12px; align-items: center; z-index: 60; }
.toast button { background: none; border: 0; color: var(--sky); text-decoration: underline; cursor: pointer; }

/* ---- narrow ---- */
@media (max-width: 1200px) { .layout { grid-template-columns: minmax(0, 1fr); } .side { position: static; max-height: none; } }
@media (max-width: 900px) { .week { grid-template-columns: minmax(0, 1fr); } .day.weekend { display: none; } #range { width: 100%; margin: 4px 0 0; order: 10; } }
@media (max-width: 600px) {
  .layout { padding: 12px 12px 40px; }
  .mc { min-height: 56px; } .ml { display: none; } .mc .dots { display: flex; }
  .stack thead { display: none; } .stack tr { display: grid; padding-block: 8px; border-bottom: 1px solid var(--hairline); }
  .stack td { display: flex; justify-content: space-between; gap: 12px; border: 0; padding: 2px 0; }
  .stack td::before { content: attr(data-l); font-family: var(--font-cond); color: var(--ink-2); }
  .legend .tz { margin-left: 0; }
}
.dots { display: none; gap: 3px; flex-wrap: wrap; } .dots i { width: 6px; height: 6px; border-radius: 50%; background: var(--k-review); }
.dots i.c { background: var(--night); } .dots i.decide { background: var(--k-decide); } .dots i.build { background: var(--k-build); } .dots i.deadline { background: var(--k-deadline); }
