@import url("./rose-pine.css");

:root { --accent: var(--rp-pine); --on-accent: #fff; }

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  display: flex; flex-direction: column; height: 100dvh; overflow: hidden;
  background: var(--rp-base); color: var(--rp-text);
  font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: none; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
* { scrollbar-width: thin; scrollbar-color: var(--rp-hl-high) transparent; }
kbd {
  display: inline-block; min-width: 1.6em; padding: 0 5px; border: 1px solid var(--border); border-radius: 4px;
  background: var(--rp-overlay); color: var(--rp-gold); font: 600 0.72rem/1.6 ui-monospace, monospace; text-align: center;
}
.mono { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }

/* Controls */
.button {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: 6px; color: var(--rp-subtle); font-size: 0.82rem; font-weight: 500; white-space: nowrap;
}
.button:hover { background: var(--rp-overlay); color: var(--rp-text); }
.button.primary { background: var(--accent); border-color: transparent; color: var(--on-accent); font-weight: 600; }
.button.advance { color: var(--rp-foam); border-color: color-mix(in srgb, var(--rp-foam) 45%, transparent); }
.button.danger { color: var(--rp-love); }
.button.small { height: 24px; padding: 0 8px; font-size: 0.75rem; }
.input {
  width: 100%; height: 32px; padding: 0 10px; border: 1px solid var(--border); border-radius: 6px;
  background: var(--rp-overlay); outline: none;
}
.input:focus { border-color: var(--accent); }
.input::placeholder { color: var(--rp-muted); }
textarea.input { height: auto; min-height: 90px; padding: 8px 10px; resize: vertical; font-family: ui-monospace, monospace; font-size: 0.8rem; }
.field { display: flex; flex-direction: column; gap: 4px; }
.field > span { color: var(--rp-subtle); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; }
.form-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 12px; }
.check { display: flex; align-items: center; gap: 6px; color: var(--rp-subtle); }

/* Layout */
.app { display: flex; flex: 1; min-height: 0; }
.sidebar { width: 210px; flex-shrink: 0; padding: 18px 12px; background: var(--rp-surface); border-right: 1px solid var(--border); overflow-y: auto; }
.brand { padding: 0 10px 16px; font-weight: 700; color: var(--rp-pine); letter-spacing: 0.02em; }
.nav { display: flex; flex-direction: column; gap: 2px; }
.nav a {
  display: flex; align-items: center; gap: 8px; padding: 6px 10px; border-radius: 6px; color: var(--rp-subtle); text-decoration: none;
}
.nav a:hover { background: var(--rp-overlay); color: var(--rp-text); }
.nav a.active { background: var(--rp-overlay); color: var(--rp-text); font-weight: 600; }
.nav .count { margin-left: auto; color: var(--rp-muted); font-size: 0.75rem; }
.nav .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--rp-iris); }
.sidebar-section { margin: 20px 10px 6px; color: var(--rp-muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.main { flex: 1; min-width: 0; overflow-y: auto; }
.page-header, .content { max-width: 980px; margin: 0 auto; padding-inline: 36px; }
.page-header { display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; padding-top: 28px; padding-bottom: 14px; }
h1 { font-size: 1.45rem; font-weight: 700; }
.sub { color: var(--rp-subtle); font-size: 0.82rem; }
.header-actions { display: flex; gap: 8px; align-items: center; }
.content { padding-bottom: 60px; }
.columns { display: grid; grid-template-columns: minmax(0, 1fr) 290px; gap: 28px; align-items: start; }

/* Groups and rows */
.group { margin-top: 18px; }
.group-title { display: flex; align-items: baseline; gap: 8px; padding: 0 0 6px; border-bottom: 1px solid var(--border); color: var(--rp-subtle); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; }
.group-title .meta { margin-left: auto; text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--rp-muted); }
.row { display: flex; align-items: center; gap: 10px; padding: 7px 8px; border-bottom: 1px solid var(--border); border-radius: 4px; }
.row.cursor { background: var(--rp-overlay); }
.row.done .title { color: var(--rp-muted); text-decoration: line-through; }
.row .title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.row .chip { color: var(--rp-muted); font-size: 0.75rem; white-space: nowrap; }
.row .chip.deadline { color: var(--rp-gold); }
.box { width: 17px; height: 17px; flex-shrink: 0; border: 1.5px solid var(--rp-muted); border-radius: 50%; display: grid; place-items: center; }
.box:hover { border-color: var(--accent); }
.done .box { background: var(--accent); border-color: var(--accent); }
.done .box::after { content: ""; width: 5px; height: 9px; border: solid var(--on-accent); border-width: 0 2px 2px 0; transform: rotate(45deg) translate(-1px, -1px); }
.badge { padding: 1px 7px; border-radius: 10px; background: var(--rp-overlay); color: var(--rp-subtle); font-size: 0.72rem; white-space: nowrap; }
.icon-btn { width: 26px; height: 26px; border-radius: 5px; color: var(--rp-muted); }
.icon-btn:hover { background: var(--rp-overlay); color: var(--rp-text); }
.empty { padding: 14px 8px; color: var(--rp-muted); }
.quick { margin-top: 4px; }

/* Status */
.st { display: inline-block; box-sizing: border-box; width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; background: var(--rp-muted); }
.st.green { background: var(--rp-foam); }
.st.orange { background: var(--rp-gold); }
.st.red { background: var(--rp-love); }
.st.done { background: var(--rp-pine); }
.name-cell { display: flex; align-items: center; gap: 8px; }
.st.empty { padding: 0; background: transparent; border: 1.5px dashed var(--rp-muted); }
.aside { position: sticky; top: 10px; padding: 14px; border: 1px solid var(--border); border-radius: 8px; background: var(--rp-surface); }
.aside h2 { font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--rp-subtle); margin-bottom: 8px; }
.traj { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 0.82rem; }
.traj:last-child { border-bottom: none; }
.traj .name { display: flex; align-items: center; gap: 6px; font-weight: 600; }
.traj .line { color: var(--rp-subtle); }
.lever { color: var(--rp-text); padding-left: 12px; }
.lever.refused { color: var(--rp-muted); text-decoration: line-through; }

/* Tables */
table { width: 100%; border-collapse: collapse; margin-top: 10px; font-size: 0.85rem; }
th { text-align: left; color: var(--rp-muted); font-size: 0.7rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; padding: 6px 8px; border-bottom: 1px solid var(--border); }
td { padding: 7px 8px; border-bottom: 1px solid var(--border); vertical-align: top; }
tr.click { cursor: pointer; }
tr.click:hover, tr.cursor { background: var(--rp-overlay); }
.num { text-align: right; font-variant-numeric: tabular-nums; }

/* Week */
.day-head { display: flex; align-items: center; gap: 10px; }
.day-head .meta { margin-left: auto; }
.today-mark { color: var(--rp-foam); }
.past { opacity: 0.6; }

/* Panels and dialogs */
.panel { margin-top: 18px; padding: 16px; border: 1px solid var(--border); border-radius: 8px; background: var(--rp-surface); }
.panel h2 { font-size: 0.95rem; margin-bottom: 12px; }
.actions-row { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.overlay { position: fixed; inset: 0; background: var(--backdrop); display: grid; place-items: start center; padding-top: 12vh; z-index: 10; }
.dialog { width: min(560px, 92vw); max-height: 76vh; overflow-y: auto; padding: 18px; border-radius: 10px; background: var(--rp-surface); box-shadow: var(--shadow); }
.dialog h2 { font-size: 1rem; margin-bottom: 12px; }
.help-grid { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; font-size: 0.85rem; }

/* Statusbar */
.statusbar { display: flex; align-items: center; gap: 14px; height: 26px; padding: 0 12px; border-top: 1px solid var(--border); background: var(--rp-surface); font-size: 0.75rem; color: var(--rp-subtle); }
.status-mode { font-weight: 700; color: var(--rp-pine); font-family: ui-monospace, monospace; }
.status-mode.insert { color: var(--rp-gold); }
.status-msg { flex: 1; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.status-msg.error { color: var(--rp-love); }
.status-hints { display: flex; gap: 12px; }

@media (max-width: 760px) {
  .sidebar { display: none; }
  .page-header, .content { padding-inline: 16px; }
  .columns { grid-template-columns: 1fr; }
  .status-hints { display: none; }
}
