:root {
  --bg: #eef3f1;
  --panel: #ffffff;
  --ink: #182229;
  --muted: #64737d;
  --line: #d5dde2;
  --accent: #0d6b59;
  --accent-2: #8a5b15;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Arial, Helvetica, sans-serif;
}

.app-shell {
  width: min(1180px, calc(100vw - 28px));
  margin: 0 auto;
  padding: 24px 0;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-panel {
  width: min(420px, 100%);
  display: grid;
  gap: 14px;
  padding: 22px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.login-panel p {
  color: var(--muted);
}

.topbar,
.toolbar,
.filters,
.selection-bar,
.stats {
  display: flex;
  gap: 12px;
}

.topbar {
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
}

.topbar p,
.upload-panel p {
  color: var(--muted);
  margin-top: 4px;
}

nav {
  display: flex;
  gap: 8px;
}

.top-actions {
  display: grid;
  gap: 10px;
  justify-items: end;
}

.session-box {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.session-box button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  padding: 7px 10px;
  cursor: pointer;
}

.status {
  min-height: 22px;
  width: min(1180px, calc(100vw - 28px));
  margin: 10px auto;
  color: var(--accent);
}

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

.tab,
#reset {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 10px 14px;
  cursor: pointer;
}

.tab.active,
#reset {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.toolbar {
  margin-bottom: 12px;
}

#q,
.filters input,
.filters select,
.entry-grid input,
.entry-grid select,
.notes-field textarea {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 0 12px;
  background: white;
  color: var(--ink);
}

#q {
  flex: 1;
  border: 2px solid var(--accent);
}

.filters {
  margin-bottom: 14px;
}

.filters input,
.filters select {
  flex: 1;
}

.filters select {
  min-width: 160px;
}

.selection-bar {
  align-items: center;
  margin-bottom: 14px;
  color: var(--muted);
}

.selection-bar strong {
  color: var(--ink);
}

.selection-bar button,
.card-actions button {
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--panel);
  color: var(--ink);
  padding: 8px 10px;
  cursor: pointer;
}

.selection-bar button:first-of-type,
.card-actions button:first-child {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
}

.results {
  display: grid;
  gap: 10px;
}

.empty {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  color: var(--muted);
}

.card,
.stats article,
.upload-panel,
.entry-panel,
.drop-panel {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.card {
  padding: 14px;
}

.card.is-uploaded {
  border-left: 5px solid var(--accent);
}

.card.is-pending {
  border-left: 5px solid #b5c0c7;
}

.card header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.check-cell {
  display: grid;
  place-items: center;
  width: 26px;
  padding-top: 2px;
}

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

.card h2 {
  font-size: 18px;
}

.meta {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 12px;
  color: var(--muted);
}

.pill {
  border-radius: 6px;
  padding: 6px 10px;
  background: #edf8f5;
  color: var(--accent);
  white-space: nowrap;
}

.pill.pending {
  background: #f1f4f6;
  color: #5d6a73;
}

.card-actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
  margin-top: 12px;
}

.card-actions button:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 14px;
}

.stats article,
.upload-panel,
.entry-panel,
.drop-panel {
  padding: 16px;
}

.stats strong {
  display: block;
  font-size: 26px;
  color: var(--accent);
}

.stats span {
  color: var(--muted);
}

code {
  color: var(--accent-2);
}

.entry-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 14px;
}

.entry-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 14px;
}

label span {
  display: block;
  margin-bottom: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.notes-field {
  display: block;
  margin-top: 12px;
}

.notes-field textarea {
  width: 100%;
  height: auto;
  padding: 10px 12px;
  resize: vertical;
}

.drop-panel {
  display: flex;
  flex-direction: column;
}

.drop-zone {
  display: grid;
  place-items: center;
  min-height: 190px;
  margin-top: 14px;
  padding: 20px;
  border: 2px dashed var(--line);
  border-radius: 8px;
  text-align: center;
  cursor: pointer;
  background: #f8faf9;
}

.drop-zone input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.drop-zone strong {
  color: var(--accent);
  font-size: 18px;
}

.drop-zone span {
  max-width: 260px;
  color: var(--muted);
  line-height: 1.35;
}

.file-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.file-item {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
}

.submit-button {
  margin-top: auto;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: white;
  padding: 12px 14px;
  cursor: pointer;
}

@media (max-width: 760px) {
  .topbar,
  .toolbar,
  .filters,
  .selection-bar {
    display: block;
  }

  nav,
  #reset,
  .filters input,
  .filters select {
    margin-top: 8px;
  }

  .top-actions,
  .session-box {
    justify-items: stretch;
    align-items: stretch;
  }

  #q,
  .filters input,
  .filters select,
  .selection-bar button,
  #reset {
    width: 100%;
  }

  .selection-bar button {
    margin-top: 8px;
  }

  .stats,
  .meta,
  .entry-layout,
  .entry-grid {
    grid-template-columns: 1fr;
  }
}
