/* calendar 30 — forum-style layout (date bar, sidebars) in the DORFic look:
   daylight, white, orange, grey, glass */

:root {
  --ink: #24282c;
  --ink-soft: #6b7178;
  --line: #dde1e5;
  --orange: #ff7a00;
  --orange-dark: #d65f00;
  --orange-soft: #fff0e0;
  --grey: #8d949b;
  --alarm: #d0261c;
  --glass: linear-gradient(180deg, rgba(255,255,255,.88), rgba(243,245,247,.78));
  --gloss-orange: linear-gradient(#ffc285 0%, #ff9a33 48%, #ff7a00 52%, #ffa040 100%);
  --gloss-grey: linear-gradient(#f2f4f6 0%, #c3c9cf 48%, #9aa2aa 52%, #c7cdd2 100%);
  --gloss-red: linear-gradient(#ff9a8f 0%, #f0483d 48%, #d0261c 52%, #e8564c 100%);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; min-height: 100%; }
[hidden] { display: none !important; }

body {
  font: 14px/1.4 "Frutiger", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: #eef0f2 url("img/bg.png") center / cover no-repeat fixed;
}

/* daylight wash + abstract-tech orange accents over the photo */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 78%, rgba(255,122,0,.85) 78% 79.2%, transparent 79.2% 81%, rgba(255,122,0,.45) 81% 81.6%, transparent 81.6%),
    linear-gradient(115deg, transparent 0 8%, rgba(255,122,0,.35) 8% 8.6%, transparent 8.6%),
    linear-gradient(180deg, rgba(255,255,255,.55), rgba(255,255,255,.15) 45%, rgba(255,226,196,.35));
}

p { margin: 0 0 6px; }
p:last-child { margin-bottom: 0; }
ul, ol { list-style: none; margin: 0; padding: 0; }
.mono, .ptime, .ctime, .clock { font-family: ui-monospace, Consolas, monospace; font-variant-numeric: tabular-nums; }
.small { font-size: 12px; }
.note { font-size: 12px; color: var(--ink-soft); }
.note:empty { display: none; }
.warn { color: var(--alarm); }

/* shared glass surface */
.navbar, .box, .footer {
  position: relative;
  background: var(--glass);
  backdrop-filter: blur(12px) saturate(1.2);
  -webkit-backdrop-filter: blur(12px) saturate(1.2);
}

/* ---------- local time ---------- */
.clock { display: block; font-size: 30px; font-weight: bold; line-height: 1; letter-spacing: 1px; }

/* ---------- navbar ---------- */
.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px 12px;
  flex-wrap: wrap;
  padding: 6px 10px;
  border-bottom: 1px solid rgba(120,128,136,.35);
  background: linear-gradient(180deg, rgba(255,255,255,.75), rgba(236,239,242,.7));
}
.crumbs b { color: var(--ink); }
.datenav { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ---------- columns ---------- */
.cols {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr) 250px;
  gap: 8px;
  padding-block: 8px;
}
.side, .content { display: flex; flex-direction: column; gap: 8px; min-width: 0; }

@media (max-width: 860px) {
  .cols { grid-template-columns: 220px minmax(0, 1fr); }
  .side.right { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); align-items: start; }
}
@media (max-width: 600px) {
  .cols { grid-template-columns: minmax(0, 1fr); }
  .side.right { grid-template-columns: 1fr; }
}

/* ---------- boxes: white glass panels with an orange top edge ---------- */
.box {
  overflow: hidden;
  border: 1px solid rgba(120,128,136,.45);
  border-radius: 16px;
  box-shadow: 0 10px 30px rgba(40,46,52,.22), inset 0 0 0 1.5px rgba(255,255,255,.95);
}
.box::before {               /* orange accent strip */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 4px;
  z-index: 2;
  background: linear-gradient(90deg, var(--orange), #ffa64d 70%, rgba(255,166,77,0));
}
.box::after {                /* flat gloss */
  content: "";
  position: absolute;
  left: 0; right: 0; top: 4px;
  height: 36%;
  background: linear-gradient(rgba(255,255,255,.6), rgba(255,255,255,0));
  pointer-events: none;
}
.box > * { position: relative; z-index: 1; }
.box > h2 {
  margin: 0;
  padding: 12px 14px 4px;
  font-size: 15px;
  font-weight: bold;
  color: var(--ink);
}
.box > .sub {
  margin-top: 6px;
  padding: 3px 14px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--ink-soft);
  background: linear-gradient(#f7f8f9, #e9ecef);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.body { padding: 8px 14px 12px; }

.count {
  float: right;
  font: 12px ui-monospace, Consolas, monospace;
  font-weight: normal;
  color: var(--ink-soft);
  padding: 1px 8px;
  border-radius: 999px;
  background: #fff;
  box-shadow: inset 0 0 0 1px var(--line);
}
.count:empty { display: none; }

/* ---------- glossy pill buttons: white/grey, orange for primary ---------- */
button {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  padding: 4px 12px;
  border: 1px solid #9aa1a8;
  border-radius: 999px;
  background: linear-gradient(#ffffff 0%, #f1f3f5 48%, #dfe3e7 52%, #f4f6f8 100%);
  box-shadow: inset 0 1px 0 #fff, 0 1px 3px rgba(30,36,42,.3);
}
button:hover { border-color: var(--orange); }
button:active { transform: translateY(1px); filter: brightness(.96); }
#today, #atest {
  color: #fff;
  border-color: var(--orange-dark);
  background: var(--gloss-orange);
  text-shadow: 0 1px 1px rgba(150,60,0,.5);
}
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; }

input[type="date"], input[type="text"], select {
  font: inherit;
  font-size: 13px;
  color: var(--ink);
  padding: 3px 10px;
  border: 1px solid #b7bdc3;
  border-radius: 999px;
  background: linear-gradient(#f6f7f8, #fff);
  box-shadow: inset 0 2px 3px rgba(30,36,42,.12);
}
input[type="text"] { border-radius: 8px; }
input[type="range"] { accent-color: var(--orange); }
input[type="checkbox"] { accent-color: var(--orange); width: 15px; height: 15px; }
.form { display: grid; gap: 7px; }
.form .row { display: flex; align-items: center; gap: 6px; }
.form .row select, .form .row input[type="range"] { flex: 1; min-width: 0; }
.form .chk { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.form .chk input { margin: 0; }
.play { padding: 2px 9px; font-size: 11px; }

/* ---------- progress bar ---------- */
.bar {
  height: 12px;
  overflow: hidden;
  border: 1px solid #a9b0b6;
  border-radius: 999px;
  background: linear-gradient(#e3e6e9, #fafbfc);
  box-shadow: inset 0 1px 3px rgba(30,36,42,.25);
}
.fill {
  position: relative;
  height: 100%;
  width: 0;
  border-radius: 999px;
  background: var(--gloss-orange);
}
.fill::after {
  content: "";
  position: absolute;
  inset: 0 0 50% 0;
  border-radius: 999px;
  background: rgba(255,255,255,.45);
}

/* ---------- right now ---------- */
.cur {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 14px 14px;
  padding: 10px 12px;
  border: 1px solid #ffb873;
  border-radius: 12px;
  background: linear-gradient(#fffaf4, var(--orange-soft));
  box-shadow: inset 0 1px 0 #fff;
}
.ctime { font-size: 28px; font-weight: bold; line-height: 1; letter-spacing: 1px; }
.cmeta { flex: 1; min-width: 0; display: grid; gap: 5px; }
.ctitle { font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cur[data-state="free"] { border-color: var(--line); background: linear-gradient(#fff, #f3f5f7); }
.cur[data-state="free"] .ctime, .cur[data-state="free"] .ctitle { color: var(--ink-soft); font-weight: normal; }
.cur[data-state="free"] .fill { background: var(--gloss-grey); }
.cur[data-state="alarm"] { border-color: #f0a19b; background: linear-gradient(#fff7f6, #ffe3e0); }
.cur[data-state="alarm"] .ctime, .cur[data-state="alarm"] .ctitle { color: var(--alarm); }
.cur[data-state="alarm"] .fill { background: var(--gloss-red); }

/* ---------- agenda ---------- */
.grid4, #agenda li.ev {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr) 30% 48px;
  align-items: center;
  column-gap: 10px;
}
#agenda { display: grid; gap: 6px; padding: 8px 14px 14px; }
#agenda li.ev {
  padding: 7px 10px;
  border-radius: 10px;
  background: rgba(255,255,255,.85);
  box-shadow: inset 0 0 0 1px var(--line);
}
.grid4 { padding-inline: 24px; }
#agenda .when, #agenda .end { font: 12px ui-monospace, Consolas, monospace; color: var(--ink-soft); }
#agenda .end, .grid4 span:last-child { text-align: right; }
#agenda .what { font-weight: bold; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#agenda li.empty { color: var(--grey); text-align: center; padding: 6px; }
#agenda li.past { opacity: .6; }
#agenda li.past .what::after { content: " \2713"; color: var(--orange-dark); }
#agenda li.now { background: linear-gradient(#fff8f0, #ffe8d1); box-shadow: inset 0 0 0 1px #ffb873, inset 4px 0 0 var(--orange); }
#agenda li.alarm .what { color: var(--alarm); }
#agenda li.alarm .fill { background: var(--gloss-red); }

/* ---------- schedule: menu-style rows ---------- */
.slothead { display: flex; gap: 10px; }
.slothead span:first-child { width: 46px; padding-left: 10px; box-sizing: content-box; }
.slothead span:nth-child(2) { flex: 1; }
.slothead span:last-child { width: 46px; text-align: right; padding-right: 22px; box-sizing: content-box; }

.scroller {
  position: relative;
  max-height: 60vh;
  overflow: auto;
  margin: 8px 14px 14px;
  border: 1px solid #c3c9ce;
  border-radius: 12px;
  background: #fff;
  box-shadow: inset 0 2px 6px rgba(30,36,42,.08);
}
#slots .slot {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 34px;
  padding: 4px 10px;
  border-bottom: 1px solid #eceef0;
  cursor: pointer;
}
#slots .slot:nth-child(even) { background: #f8f9fa; }
#slots .slot:hover { background: #fff6ec; }
#slots .slot.hour { border-top: 1px solid #d4d9dd; }
#slots .t { flex: none; width: 46px; font: 13px ui-monospace, Consolas, monospace; color: var(--ink-soft); }
#slots .t.e { text-align: right; }
#slots .n { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
#slots .n input { width: 100%; }
#slots .slot.busy { background: linear-gradient(#fff8f0, #ffe8d1); }
#slots .slot.busy .n { font-weight: bold; }
#slots .slot.alarm { background: linear-gradient(#fff7f6, #ffe3e0); }
#slots .slot.alarm .n { color: var(--alarm); }
#slots .slot.alarm .n::before {
  content: "ALARM";
  margin-right: 6px;
  padding: 0 7px;
  font-size: 10px;
  letter-spacing: .5px;
  color: #fff;
  border-radius: 999px;
  background: var(--gloss-red);
}
#slots .slot.past { opacity: .5; }
#slots .slot.now {
  opacity: 1;
  background: linear-gradient(#ffd9b3, #ffb466);
  box-shadow: inset 4px 0 0 var(--orange-dark);
}
#slots .slot.now::after {
  content: "\25C4";
  flex: none;
  font: bold 12px ui-monospace, Consolas, monospace;
  color: var(--orange-dark);
}
#slots .del { flex: none; padding: 0 8px; line-height: 20px; border-radius: 6px; }

.status { margin: -6px 16px 12px; font-size: 12px; color: var(--ink-soft); }
.status:empty { display: none; }

/* ---------- pomodoro ---------- */
.pomo .body { display: grid; gap: 8px; }
.pomo-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ptime { font-size: 30px; font-weight: bold; line-height: 1; letter-spacing: 1px; }
.pmode {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: bold;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #fff;
  background: var(--gloss-orange);
  border: 1px solid var(--orange-dark);
  text-shadow: 0 1px 1px rgba(150,60,0,.5);
}
.pomo[data-mode="break"] .ptime { color: var(--ink-soft); }
.pomo[data-mode="break"] .pmode { background: var(--grey); border-color: #737a81; text-shadow: none; }
.pomo[data-mode="break"] .fill { background: var(--gloss-grey); }
.pomo[data-muted] .pmode { background: var(--gloss-red); border-color: #9c1c14; }

/* ---------- alarm ---------- */
.anext b { color: var(--alarm); }
.acount:empty { display: none; }
.acount .mono { font-size: 20px; font-weight: bold; }
.alist {
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid #c3c9ce;
  border-radius: 10px;
  background: #fff;
}
.alist:empty { display: none; }
.alist li { display: flex; gap: 8px; padding: 4px 10px; border-bottom: 1px solid #eceef0; font-size: 13px; }
.alist li:nth-child(even) { background: #f8f9fa; }
.alist li:last-child { border-bottom: 0; }
.alist li .mono { color: var(--alarm); font-weight: bold; }
.alist li.done { opacity: .5; text-decoration: line-through; }

.aring {
  display: grid;
  gap: 6px;
  margin-bottom: 10px;
  padding: 10px;
  text-align: center;
  color: #fff;
  border: 1px solid #9c1c14;
  border-radius: 12px;
  background: var(--gloss-red);
  text-shadow: 0 1px 1px rgba(100,0,0,.5);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 0 0 rgba(208,38,28,.6);
  animation: pulse 1s ease-out infinite;
}
.aring #adismiss { font-weight: bold; text-shadow: none; }
.alarm[data-ringing]::before { background: linear-gradient(90deg, var(--alarm), #ff7a6f 70%, rgba(255,122,111,0)); }
@keyframes pulse { to { box-shadow: inset 0 1px 0 rgba(255,255,255,.5), 0 0 0 10px rgba(208,38,28,0); } }
@media (prefers-reduced-motion: reduce) { .aring { animation: none; } }

/* ---------- stats ---------- */
.stats { width: calc(100% - 28px); margin: 6px 14px 14px; border-collapse: collapse; font-size: 13px; }
.stats th, .stats td { padding: 5px 4px; border-bottom: 1px solid var(--line); text-align: left; }
.stats th { font-weight: normal; color: var(--ink-soft); }
.stats td { text-align: right; font: bold 13px ui-monospace, Consolas, monospace; }
.stats tr:last-child th, .stats tr:last-child td { border-bottom: 0; }

/* ---------- footer ---------- */
.footer {
  padding: 8px 10px;
  font-size: 11px;
  text-align: center;
  color: var(--ink-soft);
  border-top: 1px solid rgba(120,128,136,.35);
}
.footer::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 0;
  height: 3px;
  background: linear-gradient(90deg, rgba(255,166,77,0), #ffa64d 30%, var(--orange));
}
