:root {
  color-scheme: light;
  --ink: #111418;
  --muted: #5c6670;
  --line: #d8dee3;
  --panel: #ffffff;
  --soft: #f3f5f7;
  --accent: #0f6b5f;
  --accent-ink: #ffffff;
  --warn: #a43e24;
  --amber: #b98217;
  --blue: #285e9d;
  --shadow: 0 16px 45px rgba(16, 24, 32, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: #eef2f4;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 700;
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
select {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  padding: 10px 12px;
}

label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.shell {
  min-height: 100vh;
}

.lock-screen {
  display: none;
  min-height: 100vh;
  padding: max(24px, env(safe-area-inset-top)) 18px max(24px, env(safe-area-inset-bottom));
  place-content: center;
  gap: 22px;
  background:
    linear-gradient(120deg, rgba(15, 107, 95, 0.12), rgba(40, 94, 157, 0.1)),
    #eef2f4;
}

.locked .lock-screen {
  display: grid;
}

.locked .workspace {
  display: none;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: 430px;
}

.mark {
  display: grid;
  flex: 0 0 56px;
  width: 56px;
  height: 56px;
  place-items: center;
  border-radius: 14px;
  background: #101820;
  color: #fff;
  font-size: 1.6rem;
  font-weight: 900;
}

.brand-block h1,
.topbar h1 {
  margin: 0;
  font-size: 1.7rem;
  line-height: 1.05;
}

.brand-block p,
.auth-message {
  margin: 6px 0 0;
  color: var(--muted);
}

.auth-panel {
  display: grid;
  width: min(100%, 430px);
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.auth-panel h2 {
  margin: 0;
  font-size: 1.08rem;
}

.hidden {
  display: none !important;
}

.check-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.check-row input {
  width: 18px;
  min-height: 18px;
}

.ghost {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
}

.danger {
  color: var(--warn);
}

.workspace {
  display: grid;
  gap: 14px;
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: max(14px, env(safe-area-inset-top)) 14px max(18px, env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  background: rgba(238, 242, 244, 0.94);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.top-actions {
  display: flex;
  gap: 8px;
}

.icon-button {
  display: grid;
  width: 44px;
  height: 44px;
  min-height: 44px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--ink);
  font-weight: 900;
}

.file-button {
  cursor: pointer;
}

.file-button input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.summary-grid article,
.capture-band,
.item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.summary-grid article {
  padding: 13px;
}

.summary-grid span {
  display: block;
  font-size: 1.45rem;
  font-weight: 900;
}

.summary-grid p {
  margin: 3px 0 0;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
}

.capture-band {
  padding: 12px;
}

.capture-form {
  display: grid;
  gap: 12px;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
  scrollbar-width: none;
}

.tabs::-webkit-scrollbar {
  display: none;
}

.tab {
  flex: 0 0 auto;
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  padding: 0 14px;
}

.tab.active {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--accent-ink);
}

.search-row {
  display: grid;
}

.list-view {
  display: grid;
  gap: 10px;
  padding-bottom: 10px;
}

.item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 13px;
}

.item-kicker {
  color: var(--muted);
  font-size: 0.72rem;
  font-weight: 900;
  text-transform: uppercase;
}

.item h3 {
  margin: 4px 0;
  overflow-wrap: anywhere;
  font-size: 1rem;
  line-height: 1.25;
}

.item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.84rem;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.item-actions {
  display: flex;
  gap: 8px;
}

.item-actions button,
.item-actions a {
  display: grid;
  min-width: 40px;
  min-height: 40px;
  place-items: center;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--soft);
  color: var(--ink);
  font-size: 0.75rem;
  font-weight: 900;
  text-decoration: none;
}

.item-actions .approve {
  background: rgba(15, 107, 95, 0.12);
  color: var(--accent);
}

.item-actions .reject,
.item-actions .delete {
  background: rgba(164, 62, 36, 0.1);
  color: var(--warn);
}

.state-blocked {
  border-left: 4px solid var(--warn);
}

.state-waiting {
  border-left: 4px solid var(--amber);
}

.state-active {
  border-left: 4px solid var(--blue);
}

.empty {
  padding: 24px 16px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
  text-align: center;
}

@media (min-width: 720px) {
  .workspace {
    padding-inline: 24px;
  }

  .summary-grid {
    grid-template-columns: repeat(4, 1fr);
  }

  .capture-form {
    grid-template-columns: 1fr 1.3fr 1fr auto;
    align-items: end;
  }

  .capture-form > label,
  .capture-form > .form-row {
    min-width: 0;
  }

  .capture-form button {
    min-width: 150px;
  }
}

@media (max-width: 520px) {
  .item {
    grid-template-columns: 1fr;
  }

  .item-actions {
    justify-content: flex-start;
  }
}
