@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Manrope:wght@500;600;700&display=swap');

:root {
  color-scheme: dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #F1EEE8;
  background: #101417;
  --bg: #101417;
  --surface: #0C2238;
  --surface-soft: #12293E;
  --surface-deep: #0A1A2A;
  --text: #F1EEE8;
  --muted: #89949E;
  --line: rgba(137, 148, 158, .28);
  --line-strong: rgba(137, 148, 158, .44);
  --sand: #C8B79F;
  --sand-soft: #E0D5C4;
  --ice: #AFC7D8;
  --success: #68A98A;
  --shadow: 0 18px 45px rgba(0, 0, 0, .16);
}

* { box-sizing: border-box; }
html { min-width: 320px; background: var(--bg); }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 78% 6%, rgba(175,199,216,.07) 0, transparent 30%),
    linear-gradient(145deg, #101417 0%, #0E141A 48%, #111922 100%);
}
button, input, textarea { font: inherit; }
button, input, textarea { transition: border-color .18s ease, background .18s ease, color .18s ease, transform .18s ease; }
svg { width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
h1, h2, p { margin-top: 0; }
h1, h2, .brand-title { font-family: Manrope, Inter, sans-serif; }

.app-layout {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: 1rem;
  width: min(100%, 108rem);
  min-height: 100vh;
  margin: 0 auto;
  padding: 1rem;
}

.sidebar {
  position: sticky;
  top: 1rem;
  display: flex;
  flex-direction: column;
  align-self: start;
  min-height: calc(100vh - 2rem);
  padding: .9rem;
  border: 1px solid var(--line);
  border-radius: 1.25rem;
  background: rgba(12,34,56,.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.brand { display: flex; align-items: center; gap: .68rem; padding: .2rem .2rem .9rem; }
.brand-mark, .page-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  color: #101417;
  background: var(--sand);
  border: 1px solid rgba(255,255,255,.08);
}
.brand-mark { width: 2.15rem; height: 2.15rem; border-radius: .7rem; }
.brand-mark svg { width: 1.2rem; height: 1.2rem; }
.brand-title { margin-bottom: .04rem; color: var(--text); font-size: .9rem; font-weight: 700; letter-spacing: -.02em; }
.brand-subtitle { margin-bottom: 0; color: var(--muted); font-size: .65rem; }

.nav-list { display: grid; gap: .18rem; }
.nav-item {
  display: flex;
  align-items: center;
  gap: .56rem;
  min-height: 3rem;
  padding: .45rem .55rem;
  border: 1px solid transparent;
  border-radius: .78rem;
  color: #C2CAD1;
}
.nav-item.active {
  color: var(--sand-soft);
  background: rgba(200,183,159,.10);
  border-color: rgba(200,183,159,.28);
}
.nav-icon { display: grid; place-items: center; width: 1.6rem; height: 1.6rem; color: currentColor; }
.nav-item strong, .nav-item small { display: block; }
.nav-item strong { margin-bottom: .04rem; font-size: .76rem; font-weight: 700; }
.nav-item small { color: var(--muted); font-size: .61rem; }
.nav-item.active small { color: #B4B7B6; }
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: .5rem; padding: .8rem .4rem .15rem; color: var(--muted); font-size: .66rem; line-height: 1.35; }
.status-dot { width: .45rem; height: .45rem; border-radius: 50%; background: var(--success); box-shadow: 0 0 0 3px rgba(104,169,138,.11); }

.workspace { min-width: 0; padding: .08rem .08rem 1.1rem; }
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1.35rem; min-height: 4.7rem; padding: .05rem .25rem .62rem; }
.page-heading { display: flex; align-items: center; gap: .78rem; min-width: 0; }
.page-icon { width: 2.55rem; height: 2.55rem; border-radius: 50%; }
.page-icon svg { width: 1.25rem; height: 1.25rem; }
.eyebrow, .section-kicker { margin-bottom: .24rem; color: var(--sand); font-size: .61rem; font-weight: 700; letter-spacing: .12em; }
h1 { margin-bottom: .12rem; color: var(--text); font-size: clamp(1.45rem, 1.9vw, 1.85rem); line-height: 1; letter-spacing: -.04em; }
.subtitle { margin-bottom: 0; color: var(--muted); font-size: .72rem; }

.topbar-actions { display: flex; align-items: center; gap: .55rem; }
.search-box { display: flex; align-items: center; gap: .45rem; width: min(24vw, 18rem); min-width: 12rem; height: 2.35rem; padding: 0 .75rem; border: 1px solid var(--line); border-radius: .78rem; background: rgba(12,34,56,.72); color: var(--muted); }
.search-box svg { width: .92rem; height: .92rem; }
.search-box input { width: 100%; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: .74rem; }
.search-box input::placeholder { color: var(--muted); opacity: 1; }
.search-box input:disabled { cursor: default; opacity: 1; }
.icon-button { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; padding: 0; border: 1px solid var(--line); border-radius: .78rem; background: rgba(12,34,56,.72); color: #C5CDD4; }
.icon-button:disabled { opacity: 1; cursor: default; }
.avatar { display: grid; place-items: center; width: 2.35rem; height: 2.35rem; border: 1px solid rgba(200,183,159,.35); border-radius: 50%; background: var(--surface); color: var(--sand-soft); font-size: .68rem; font-weight: 700; letter-spacing: .03em; }

.filter-card, .table-card, .detail-card {
  border: 1px solid var(--line);
  background: rgba(12,34,56,.90);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}

.filter-card { padding: .85rem .95rem .72rem; border-radius: 1rem; }
.section-intro { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.section-intro h2, .table-heading h2, .detail-heading h2 { margin-bottom: 0; color: var(--text); font-size: .9rem; letter-spacing: -.02em; }
.capture-form { display: grid; grid-template-columns: minmax(22rem, 1.85fr) minmax(12rem, .72fr) auto; align-items: end; gap: .62rem; }
.field label { display: block; margin-bottom: .34rem; color: #C7CDD2; font-size: .68rem; font-weight: 600; }
.field label span { color: var(--muted); font-weight: 500; }
textarea, input[type="date"] { width: 100%; border: 1px solid var(--line-strong); border-radius: .7rem; background: #101417; color: var(--text); }
textarea { min-height: 2.35rem; max-height: 5.2rem; resize: vertical; padding: .58rem .72rem; line-height: 1.12; }
input[type="date"] { height: 2.35rem; padding: 0 .72rem; color-scheme: dark; }
textarea::placeholder { color: #66717B; }
textarea:focus, input[type="date"]:focus { outline: 2px solid var(--ice); outline-offset: 1px; border-color: var(--ice); }
.form-actions { display: flex; gap: .5rem; }
.button { height: 2.35rem; padding: 0 .9rem; border-radius: .66rem; font-size: .72rem; font-weight: 700; cursor: pointer; white-space: nowrap; }
.button.secondary { border: 1px solid var(--line-strong); background: #101417; color: #D5D9DC; }
.button.primary { border: 1px solid var(--sand); background: var(--sand); color: #101417; }
.button:hover { transform: translateY(-1px); }
.button.secondary:hover { border-color: var(--ice); color: var(--text); }
.button.primary:hover { background: var(--sand-soft); border-color: var(--sand-soft); }
.button:focus-visible { outline: 2px solid var(--ice); outline-offset: 2px; }
.confirmation { min-height: .65rem; margin: .32rem 0 0; color: #8EC4A7; font-size: .68rem; font-weight: 600; }

.table-card { min-height: 18.5rem; margin-top: .72rem; overflow: hidden; border-radius: 1rem; }
.table-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .78rem .95rem .66rem; }
.task-count { color: var(--muted); font-size: .7rem; }
.table-scroll { overflow-x: auto; }
.task-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.task-table th { padding: .62rem .9rem; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); background: rgba(16,20,23,.55); color: #99A5AF; font-size: .62rem; font-weight: 700; letter-spacing: .06em; text-align: left; text-transform: uppercase; }
.task-table td { padding: .78rem .9rem; border-bottom: 1px solid rgba(137,148,158,.18); color: #C7CED4; font-size: .75rem; vertical-align: middle; }
.task-table tbody tr:last-child td { border-bottom: 0; }
.task-table th:nth-child(1), .task-table td:nth-child(1) { width: 50%; }
.task-table th:nth-child(2), .task-table td:nth-child(2) { width: 20%; }
.task-table th:nth-child(3), .task-table td:nth-child(3) { width: 17%; }
.task-table th:nth-child(4), .task-table td:nth-child(4) { width: 13%; }
.task-title { margin: 0; color: var(--text); font-size: .79rem; font-weight: 600; overflow-wrap: anywhere; }
.task-date { color: #B4BEC6; }
.status-badge, .soft-badge { display: inline-flex; align-items: center; min-height: 1.5rem; padding: .18rem .5rem; border-radius: 999px; font-size: .63rem; font-weight: 700; }
.status-badge { background: rgba(175,199,216,.13); color: var(--ice); border: 1px solid rgba(175,199,216,.22); }
.soft-badge { background: rgba(200,183,159,.10); color: var(--sand-soft); border: 1px solid rgba(200,183,159,.20); }
.action-pill { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; border: 1px solid var(--line); border-radius: .62rem; background: #101417; color: var(--ice); }
.action-pill svg { width: .9rem; height: .9rem; }
.empty-state { min-height: 11.4rem; display: flex; align-items: flex-start; padding: 1.15rem .95rem; margin: 0; color: var(--muted); font-size: .73rem; border-top: 1px solid var(--line); }
.hidden { display: none; }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1.72fr) minmax(17rem, .88fr); gap: .72rem; margin-top: .72rem; }
.detail-card { min-height: 14rem; padding: .92rem .95rem; border-radius: 1rem; }
.detail-heading { display: flex; align-items: start; justify-content: space-between; gap: 1rem; padding-bottom: .72rem; border-bottom: 1px solid var(--line); }
.detail-content { padding-top: .9rem; }
.detail-title { margin-bottom: .3rem; color: var(--text); font-size: .92rem; font-weight: 700; letter-spacing: -.02em; }
.detail-meta { margin-bottom: 0; color: var(--muted); font-size: .73rem; }
.summary-list { margin: .3rem 0 0; }
.summary-list div { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .58rem 0; border-bottom: 1px solid rgba(137,148,158,.18); }
.summary-list div:last-child { border-bottom: 0; }
.summary-list dt { color: #A6B0B8; font-size: .71rem; }
.summary-list dd { margin: 0; color: var(--sand-soft); font-size: .78rem; font-weight: 700; }

@media (max-width: 74rem) {
  .app-layout { grid-template-columns: 12.25rem minmax(0, 1fr); gap: .9rem; }
  .capture-form { grid-template-columns: minmax(16rem, 1.5fr) minmax(12rem, .8fr); }
  .form-actions { grid-column: 1 / -1; justify-content: flex-end; }
  .search-box { width: 13.5rem; }
}

@media (max-width: 58rem) {
  .app-layout { display: block; padding: .8rem; }
  .sidebar { position: static; min-height: auto; margin-bottom: .9rem; }
  .nav-list { grid-template-columns: repeat(3, 1fr); }
  .sidebar-foot { display: none; }
  .topbar { align-items: flex-start; flex-direction: column; gap: .9rem; }
  .topbar-actions { width: 100%; }
  .search-box { width: auto; flex: 1; }
  .capture-form { grid-template-columns: 1fr; }
  .form-actions { grid-column: auto; justify-content: stretch; }
  .button { flex: 1; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 42rem) {
  .nav-list { grid-template-columns: 1fr; }
  .nav-item:not(.active) { display: none; }
  .page-icon { width: 2.45rem; height: 2.45rem; }
  .topbar-actions .icon-button, .topbar-actions .avatar { display: none; }
  .task-table { min-width: 42rem; }
}
