:root {
  --green: #90B94C;
  --orange: #FC923B;
  --text: #030712;
  --white: #FFFFFF;
  --bg: #F2F4F6;
  --line: rgba(3, 7, 18, 0.12);
  --muted: rgba(3, 7, 18, 0.62);
  --ink-soft: rgba(3, 7, 18, 0.06);
  --shadow: 0 15px 45px rgba(3, 7, 18, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 14px;
  letter-spacing: 0;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
}

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

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

.login-brand {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 17px;
  font-weight: 820;
}

.login-brand svg {
  width: 20px;
  height: 20px;
  color: var(--green);
}

.login-field {
  display: grid;
  gap: 6px;
}

.login-field span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 760;
}

.login-field input {
  width: 100%;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  color: var(--text);
  padding: 0 10px;
  outline: 0;
}

.login-field input:focus {
  border-color: var(--green);
  background: var(--white);
}

.login-error {
  margin: 0;
  color: #B42318;
  font-size: 12px;
  font-weight: 760;
}

.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 40px;
  border: 0;
  border-radius: 6px;
  background: var(--green);
  color: var(--text);
  padding: 0 12px;
  font-weight: 820;
}

.login-button:disabled {
  cursor: progress;
  opacity: 0.68;
}

.workspace {
  display: grid;
  gap: 14px;
  padding: 18px;
}

.dashboard-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.csv-export-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  color: var(--text);
  padding: 0 12px;
  font-weight: 820;
  box-shadow: none;
  white-space: nowrap;
}

.csv-export-button:disabled {
  cursor: progress;
  opacity: 0.72;
}

.csv-export-button svg {
  width: 15px;
  height: 15px;
}

.export-spinner {
  animation: export-spinner 800ms linear infinite;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--orange);
  font-size: 10px;
  font-weight: 820;
  text-transform: uppercase;
}

h1,
h2 {
  margin: 0;
  color: var(--text);
  line-height: 1;
}

h1 {
  font-size: 29px;
}

h2 {
  font-size: 21px;
  overflow-wrap: anywhere;
}

.stats-grid {
  display: flex;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 8px;
}

.metric-card,
.feed-panel,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.metric-card {
  display: grid;
  grid-template-columns: 28px minmax(0, auto) auto;
  align-items: center;
  gap: 7px;
  min-height: 42px;
  box-shadow: none;
  padding: 6px 10px 6px 6px;
}

.metric-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 6px;
  background: rgba(144, 185, 76, 0.18);
}

.metric-icon svg {
  width: 15px;
  height: 15px;
}

.metric-card span,
.capture-field-label,
.info-item span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 680;
}

.metric-card strong {
  min-width: 22px;
  font-size: 22px;
  line-height: 1;
  text-align: right;
}

.content-grid {
  display: grid;
  grid-template-columns: minmax(315px, 1fr) minmax(270px, 330px);
  gap: 14px;
  align-items: start;
}

.feed-panel {
  overflow: hidden;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 150px;
  gap: 8px;
  border-bottom: 1px solid var(--line);
  padding: 11px;
}

.search-box,
.location-filter {
  display: flex;
  align-items: center;
  min-height: 33px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
}

.search-box {
  gap: 6px;
  padding: 0 9px;
}

.location-filter {
  width: 100%;
  outline: 0;
  color: var(--text);
  padding: 0 8px;
  font: inherit;
  font-weight: 760;
}

.search-box svg {
  width: 14px;
  height: 14px;
}

.search-box input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.capture-list {
  display: grid;
  max-height: calc(100vh - 172px);
  overflow: auto;
}

.capture-row {
  display: grid;
  grid-template-columns:
    54px
    minmax(120px, 0.9fr)
    minmax(210px, 1.35fr)
    minmax(135px, 0.9fr)
    minmax(105px, 0.72fr)
    minmax(70px, auto);
  align-items: center;
  gap: 9px;
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--white);
  padding: 9px 10px;
  text-align: left;
}

.capture-row.selected {
  background: rgba(144, 185, 76, 0.14);
}

.capture-row img,
.capture-thumb-placeholder {
  width: 54px;
  height: 54px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--bg);
}

.capture-thumb-placeholder,
.detail-placeholder {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-weight: 820;
}

.capture-field {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.capture-field-value {
  font-size: 13px;
}

.capture-title .capture-field-value {
  font-weight: 820;
}

.capture-field-label {
  line-height: 1;
  text-transform: uppercase;
}

.capture-field-value {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-panel {
  position: sticky;
  top: 18px;
  overflow: hidden;
}

.detail-panel.empty,
.empty-state {
  display: grid;
  place-items: center;
  min-height: 240px;
  color: var(--muted);
  text-align: center;
}

.detail-hero {
  position: relative;
  height: 195px;
  overflow: hidden;
  background: var(--text);
}

.detail-hero.photo-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  grid-template-rows: minmax(0, 1fr);
}

.detail-hero img {
  display: block;
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-placeholder {
  min-width: 0;
  min-height: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-size: 26px;
}

.hero-badge {
  position: absolute;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 33px;
  border-radius: 6px;
  background: var(--white);
  padding: 0 9px;
  font-weight: 820;
  font-size: 12px;
}

.hero-badge svg {
  width: 12px;
  height: 12px;
}

.detail-body {
  display: grid;
  gap: 14px;
  padding: 14px;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.info-item {
  display: grid;
  grid-template-columns: 16px 1fr;
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--bg);
  padding: 9px;
}

.info-item svg {
  width: 14px;
  height: 14px;
}

.info-item strong {
  display: block;
  margin-top: 3px;
  font-size: 12px;
  overflow-wrap: anywhere;
}

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

  .detail-panel {
    position: static;
  }
}

@media (max-width: 860px) {
  .capture-row {
    grid-template-columns: 54px minmax(0, 1fr) minmax(0, 1fr);
    align-items: start;
  }

  .capture-title {
    grid-column: 2;
  }

  .capture-disposal {
    grid-column: 3;
  }

  .capture-location {
    grid-column: 2;
  }

  .capture-user {
    grid-column: 3;
  }

  .capture-received {
    grid-column: 2 / span 2;
  }
}

@media (max-width: 680px) {
  .workspace {
    padding: 11px;
  }

  h1 {
    font-size: 23px;
  }

  .stats-grid,
  .filter-bar,
  .info-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-summary {
    align-items: stretch;
    flex-direction: column;
  }

  .csv-export-button {
    width: 100%;
  }

  .capture-row {
    grid-template-columns: 44px 1fr;
    align-items: start;
  }

  .capture-field {
    grid-column: 2;
  }

  .capture-field-label {
    display: none;
  }

  .capture-row img,
  .capture-thumb-placeholder {
    width: 44px;
    height: 44px;
  }

}

@keyframes export-spinner {
  to {
    transform: rotate(360deg);
  }
}
