:root {
  color-scheme: light;
  --ink: #172432;
  --muted: #5d6e7a;
  --rule: #dbe3e7;
  --panel: #fff;
  --paper: #f4f7f7;
  --accent: #086c5b;
  --accent-light: #e6f2ee;
  --danger: #a63332;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  --fc-border-color: var(--rule);
  --fc-button-bg-color: #fff;
  --fc-button-border-color: var(--rule);
  --fc-button-text-color: var(--ink);
  --fc-button-hover-bg-color: var(--accent-light);
  --fc-button-hover-border-color: var(--rule);
  --fc-button-active-bg-color: var(--accent);
  --fc-button-active-border-color: var(--accent);
  --fc-today-bg-color: var(--accent-light);
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--accent); }
button, input, select, textarea { font: inherit; }
button, .button, input, select, textarea {
  border: 1px solid var(--rule);
  border-radius: 7px;
  background: white;
  color: var(--ink);
  padding: .55rem .75rem;
}
button, .button { cursor: pointer; text-decoration: none; font-weight: 600; }
button:hover, .button:hover { background: var(--accent-light); }
button:disabled { opacity: .55; cursor: default; }
button.primary { color: white; background: var(--accent); border-color: var(--accent); }
button.primary:hover { background: #045546; }
button.danger { color: var(--danger); }
:focus-visible { outline: 2px solid #137e72; outline-offset: 2px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(1.6rem, 3vw, 2.45rem); letter-spacing: -.045em; }
h2 { font-size: 1.12rem; }
h3 { font-size: .98rem; }
p { line-height: 1.55; }
small, .muted { color: var(--muted); }
pre, .copy-text { overflow-wrap: anywhere; white-space: pre-wrap; margin: 0; }
pre { max-height: 19rem; overflow: auto; padding: .8rem; border-radius: 6px; background: var(--paper); }
.app-shell { display: grid; grid-template-columns: 210px minmax(0, 1fr); min-height: 100vh; }
.sidebar { position: sticky; top: 0; height: 100vh; background: white; border-right: 1px solid var(--rule); padding: 2rem 1rem; }
.brand { font-size: 1.3rem; font-weight: 760; letter-spacing: -.04em; margin: 0 .65rem 2rem; }
.nav { display: grid; gap: .35rem; }
.nav a { color: var(--muted); padding: .7rem .75rem; border-radius: 7px; text-decoration: none; font-weight: 650; }
.nav a[aria-current] { background: var(--accent-light); color: var(--accent); }
.sidebar .logout { margin: 1.4rem .55rem; }
.workspace { max-width: 1600px; width: 100%; padding: clamp(1rem, 3.2vw, 3rem); margin: auto; align-self: start; }
.stack { display: grid; gap: 1rem; align-content: start; }
.toolbar, .heading, .row { display: flex; flex-wrap: wrap; gap: .6rem; align-items: center; }
.heading { justify-content: space-between; margin-bottom: 1.4rem; }
.toolbar { margin-bottom: 1rem; }
.toolbar input[type=search] { flex: 1 1 230px; }
.panel, .card, dialog { background: var(--panel); border: 1px solid var(--rule); border-radius: 11px; }
.panel, .card { padding: 1rem; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(245px, 100%), 1fr)); gap: .85rem; }
.metrics { grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); }
.metric strong { display: block; font-size: 2rem; margin-top: .45rem; color: var(--accent); }
.grid-2 { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 1rem; align-items: start; }
.table-wrap { overflow-x: auto; background: white; border: 1px solid var(--rule); border-radius: 9px; }
table { border-collapse: collapse; width: 100%; text-align: left; }
th, td { padding: .72rem .85rem; border-bottom: 1px solid var(--rule); vertical-align: middle; }
th { font-size: .82rem; color: var(--muted); background: #f8faf9; white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
td { max-width: 24rem; overflow-wrap: anywhere; }
.pager { justify-content: flex-end; margin-top: .85rem; }
.thumb { width: 100%; aspect-ratio: 16/9; border-radius: 7px; object-fit: cover; background: #ebf0f1; }
video { width: 100%; max-height: 460px; background: #111b23; border-radius: 8px; }
.avatar { width: 52px; height: 52px; object-fit: cover; border-radius: 50%; background: var(--accent-light); }
.avatar.fallback { display: grid; place-content: center; font-weight: 750; font-size: 1.2rem; color: var(--accent); }
.badge { display: inline-block; padding: .25rem .55rem; background: var(--accent-light); border-radius: 6px; color: #075747; font-size: .8rem; }
.badge.failed, .error { color: var(--danger); }
.empty { color: var(--muted); padding: 1.25rem; background: white; border-radius: 8px; }
label.field { display: grid; gap: .34rem; color: var(--muted); font-size: .88rem; }
label.field > * { width: 100%; }
textarea { resize: vertical; min-height: 5rem; }
fieldset { border: 1px solid var(--rule); border-radius: 8px; min-width: 0; }
legend { font-weight: 700; }
.form-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: .8rem; }
.form-grid .wide { grid-column: 1 / -1; }
dialog { width: min(800px, calc(100vw - 2rem)); max-height: 90vh; padding: 1.25rem; box-shadow: 0 18px 60px #17243228; }
dialog::backdrop { background: #17243260; }
.dialog-head { justify-content: space-between; margin-bottom: 1rem; }
#notice { position: fixed; bottom: 1rem; right: 1rem; z-index: 20; max-width: min(32rem, calc(100vw - 2rem)); }
#notice:not(:empty) { color: white; background: #19363a; border-radius: 8px; padding: .8rem 1rem; box-shadow: 0 5px 25px #0002; }
.login { min-height: 100vh; display: grid; place-items: center; padding: 1rem; }
.login form { width: min(390px, 100%); padding: 2rem; }
.kanban { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(205px, 1fr); gap: .8rem; overflow: auto; padding-bottom: .65rem; }
.lane { background: #eaf0ef; padding: .75rem; min-height: 175px; border-radius: 8px; }
.lane .card { cursor: grab; }
.calendar-shell { background: white; border: 1px solid var(--rule); border-radius: 10px; padding: .7rem; }
.fc .fc-toolbar-title { font-size: clamp(1rem, 2vw, 1.45rem); }
.fc .fc-button { font-size: .85rem; }
.fc .fc-event { cursor: pointer; }
.list-item { padding: .45rem 0; border-bottom: 1px solid var(--rule); }
.list-item:last-child { border: 0; }
.docs { padding: 2rem; display: grid; gap: 1rem; }
@media (max-width: 800px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { height: auto; position: static; padding: .7rem 1rem; border-right: 0; border-bottom: 1px solid var(--rule); }
  .brand { margin: .1rem 0 .65rem; }
  .nav { display: flex; flex-wrap: wrap; gap: .25rem; }
  .nav a { padding: .45rem .55rem; }
  .sidebar .logout { position: absolute; top: .5rem; right: 1rem; margin: 0; }
  .grid-2 { grid-template-columns: 1fr; }
  .fc .fc-toolbar { flex-wrap: wrap; gap: .45rem; }
}
@media (max-width: 440px) { .form-grid { grid-template-columns: 1fr; } }
