:root {
  color-scheme: light;
  --bg: #eef3f7;
  --panel: #ffffff;
  --panel-soft: #f7fafc;
  --text: #171c22;
  --muted: #647184;
  --border: #d6dee8;
  --ink: #102a43;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --blue: #2563eb;
  --danger: #b42318;
  --shadow: 0 18px 48px rgba(26, 35, 51, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 34%),
    linear-gradient(315deg, rgba(37, 99, 235, 0.11), transparent 38%),
    var(--bg);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: wait;
  opacity: 0.7;
}

svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 2;
}

.app-shell {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 18px;
  width: min(1220px, calc(100vw - 32px));
  min-height: calc(100vh - 32px);
  margin: 16px auto;
}

.side-panel,
.workspace {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.side-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
  padding: 18px;
}

.brand-row {
  display: grid;
  grid-template-columns: 48px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 8px;
  color: #ffffff;
  background: var(--ink);
  font-size: 1.45rem;
  font-weight: 800;
}

.brand-row h1,
.top-bar h2 {
  margin: 0;
  font-size: 1.35rem;
  line-height: 1.15;
  letter-spacing: 0;
}

.brand-row p,
.eyebrow {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

.status-panel {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.metric {
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.metric span,
.section-heading {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.metric strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-size: 1.55rem;
  line-height: 1;
}

.panel-block {
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.section-heading,
.detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.section-heading.roomy {
  margin-bottom: 12px;
}

.detail-row {
  margin-top: 10px;
  color: var(--muted);
  font-size: 0.9rem;
}

.detail-row strong {
  color: var(--text);
  text-align: right;
}

.workspace {
  display: grid;
  grid-template-rows: auto auto minmax(0, 1fr);
  overflow: hidden;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 82px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
}

.eyebrow {
  margin: 0 0 4px;
  font-size: 0.74rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.icon-button {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 8px;
  color: var(--blue);
  background: rgba(37, 99, 235, 0.1);
}

.icon-button:hover {
  background: rgba(37, 99, 235, 0.16);
}

.icon-button.small {
  width: 34px;
  height: 34px;
}

.error-banner {
  margin: 14px 20px 0;
  padding: 12px 14px;
  border: 1px solid rgba(180, 35, 24, 0.35);
  border-radius: 8px;
  color: var(--danger);
  background: rgba(180, 35, 24, 0.08);
  line-height: 1.4;
}

.work-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 18px;
  overflow: auto;
  padding: 20px;
}

.work-panel {
  min-width: 0;
}

.entry-form {
  display: grid;
  gap: 10px;
  margin-bottom: 16px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  background: #ffffff;
  outline: none;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 96px;
  resize: vertical;
  padding: 11px 12px;
  line-height: 1.4;
}

input:focus,
select:focus,
textarea:focus {
  border-color: rgba(37, 99, 235, 0.72);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.inline-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 120px;
  gap: 10px;
}

.button-primary {
  min-height: 42px;
  border: 0;
  border-radius: 8px;
  color: #ffffff;
  background: var(--teal);
  font-weight: 750;
}

.button-primary:hover {
  background: var(--teal-dark);
}

.item-list {
  display: grid;
  gap: 10px;
}

.record,
.empty-state {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel-soft);
}

.record {
  display: grid;
  gap: 8px;
  padding: 12px;
}

.record.task.done {
  opacity: 0.78;
}

.record-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: start;
}

.record-actions {
  display: flex;
  gap: 6px;
}

.record h3 {
  margin: 0;
  font-size: 1rem;
  line-height: 1.3;
  letter-spacing: 0;
  overflow-wrap: anywhere;
}

.record.task.done h3 {
  text-decoration: line-through;
}

.record p {
  margin: 0;
  color: #344054;
  line-height: 1.45;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.record-meta {
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.empty-state {
  padding: 14px;
  color: var(--muted);
  line-height: 1.4;
}

@media (max-width: 900px) {
  .app-shell,
  .work-grid {
    grid-template-columns: 1fr;
  }

  .app-shell {
    width: min(100vw - 20px, 700px);
    margin: 10px auto;
  }

  .work-grid {
    padding: 16px;
  }
}

@media (max-width: 520px) {
  .status-panel,
  .inline-fields {
    grid-template-columns: 1fr;
  }
}
