:root {
  --bg: #eef3fb;
  --sidebar: #1f2937;
  --sidebar-soft: #2a3647;
  --paper: #ffffff;
  --paper-muted: #f8fbff;
  --line: #d7e0ee;
  --text: #243041;
  --muted: #66758d;
  --accent: #4c7cf0;
  --accent-strong: #315fcb;
  --accent-soft: #e8f0ff;
  --danger: #c2415d;
  --shadow: 0 18px 40px rgba(28, 55, 112, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  color: var(--text);
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background:
    radial-gradient(circle at top left, rgba(76, 124, 240, 0.1), transparent 24%),
    linear-gradient(180deg, #f4f8ff 0%, #eef4fc 100%);
}

.login-body {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
textarea {
  font: inherit;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
}

.site-nav,
.hero-actions,
.button-stack,
.toolbar,
.doc-links,
.panel-head,
.page-head,
.actions {
  display: flex;
  gap: 0.85rem;
}

.sidebar {
  background:
    linear-gradient(180deg, var(--sidebar) 0%, #182230 100%);
  color: #e8eefc;
  padding: 1.5rem 1rem;
  display: grid;
  align-content: start;
  gap: 1.5rem;
  border-right: 1px solid rgba(255, 255, 255, 0.06);
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.5rem 0.75rem 1rem;
}

.brand span {
  font-size: 1.35rem;
  font-weight: 700;
  color: #fff;
}

.brand small {
  color: #9fb2d7;
}

.sidebar-group {
  display: grid;
  gap: 0.5rem;
}

.sidebar-label,
.topbar-kicker {
  margin: 0;
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #8ea3cb;
}

.sidebar-note {
  padding: 1rem 0.75rem;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.sidebar-note strong {
  color: #fff;
}

.sidebar-note span,
.muted,
.note,
.field-meta small,
.field-meta span,
.empty-state {
  color: var(--muted);
}

.site-nav {
  flex-direction: column;
}

.site-nav a,
.button,
.table-link {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.8rem 1rem;
  background: rgba(255, 255, 255, 0.48);
  transition: transform 0.18s ease, background 0.18s ease, border-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.site-nav a {
  border-color: rgba(255, 255, 255, 0.06);
  background: transparent;
  color: #d9e5ff;
}

.site-nav a:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.08);
}

.button:hover,
.table-link:hover {
  transform: translateY(-1px);
}

.site-nav a[aria-current="page"] {
  background: linear-gradient(135deg, rgba(76, 124, 240, 0.28) 0%, rgba(76, 124, 240, 0.16) 100%);
  border-color: rgba(127, 166, 255, 0.22);
  color: #fff;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  cursor: pointer;
  color: var(--text);
}

.button-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-strong) 100%);
  border-color: transparent;
}

.button-primary:hover {
  color: #fff;
  background: linear-gradient(135deg, #5e8cf5 0%, #3a66cf 100%);
  box-shadow: 0 12px 24px rgba(49, 95, 203, 0.22);
}

.button-secondary {
  background: #fff;
}

.button-secondary:hover {
  color: var(--accent-strong);
  background: #f1f6ff;
  border-color: #bfd0f1;
}

.table-link {
  color: var(--text);
  background: #fff;
}

.table-link:hover {
  background: #f4f8ff;
  border-color: #c3d4f3;
}

.table-link.destructive {
  color: var(--danger);
}

.table-link.destructive:hover {
  color: #fff;
  background: var(--danger);
  border-color: var(--danger);
}

.nav-link-content,
.action-icon,
.quick-action-icon {
  display: inline-flex;
  align-items: center;
}

.nav-link-content {
  gap: 0.75rem;
}

.nav-icon,
.action-icon,
.quick-action-icon {
  justify-content: center;
  width: 1.1rem;
  height: 1.1rem;
}

.nav-icon svg,
.action-icon svg,
.quick-action-icon svg {
  width: 100%;
  height: 100%;
}

.action-icon {
  width: 1rem;
  height: 1rem;
}

.workspace {
  padding: 1.2rem;
  display: grid;
  align-content: start;
  gap: 1rem;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 72px;
  padding: 1rem 1.25rem;
  background: rgba(255, 255, 255, 0.74);
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.topbar strong {
  font-size: 1.05rem;
}

.topbar-user,
.topbar-user-meta {
  display: flex;
  align-items: center;
}

.topbar-user {
  gap: 0.85rem;
}

.topbar-user-meta {
  flex-direction: column;
  align-items: flex-end;
  gap: 0.15rem;
}

.topbar-user-meta small {
  color: var(--muted);
}

.page-content {
  display: grid;
  gap: 1.5rem;
}

.hero,
.panel,
.metric-card {
  background: var(--paper);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: 1.8fr 1fr;
  gap: 1.5rem;
  padding: 1.6rem;
  border-radius: 22px;
}

.hero-status,
.quick-actions {
  display: grid;
  gap: 0.9rem;
}

.hero-status {
  align-content: start;
}

.status-tile {
  padding: 1rem 1.1rem;
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f6faff 100%);
  border: 1px solid var(--line);
}

.status-tile small {
  display: block;
  margin-bottom: 0.4rem;
  color: var(--muted);
}

.status-tile strong {
  line-height: 1.45;
}

.status-card,
.metric-card,
.panel {
  border-radius: 20px;
}

.status-card,
.metric-card,
.panel,
.flash-message,
.field-card,
.upload-box,
.table-shell,
.record-row,
.image-card {
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid var(--line);
}

.status-card,
.metric-card,
.panel {
  padding: 1.35rem;
}

.status-card dl,
.meta-list,
.record-list,
.placeholder-grid,
.image-grid,
.field-meta,
.photo-actions,
.slot-grid,
.attention-metrics {
  display: grid;
  gap: 0.85rem;
}

.eyebrow {
  margin: 0 0 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 700;
}

h1,
h2 {
  margin: 0;
  line-height: 1.1;
}

h1 {
  font-size: clamp(1.8rem, 3.5vw, 2.8rem);
  max-width: 16ch;
}

h2 {
  font-size: 1.15rem;
}

.lead {
  max-width: 62ch;
  color: var(--muted);
  font-size: 1rem;
  line-height: 1.65;
}

.lead.compact {
  max-width: 70ch;
}

.hero-actions,
.button-stack,
.doc-links,
.actions,
.page-head {
  flex-wrap: wrap;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.metric-card {
  display: grid;
  gap: 0.35rem;
  background: linear-gradient(180deg, #ffffff 0%, #f9fbff 100%);
}

.progress-card {
  display: grid;
  gap: 1rem;
}

.progress-head {
  display: grid;
  gap: 0.25rem;
}

.progress-head strong {
  font-size: 2rem;
  color: var(--accent-strong);
}

.progress-head small,
.progress-meta span {
  color: var(--muted);
}

.progress-track {
  width: 100%;
  height: 0.9rem;
  border-radius: 999px;
  background: #e4ecf9;
  overflow: hidden;
}

.progress-fill {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #6aa3ff 0%, #315fcb 100%);
}

.progress-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.attention-metrics {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.attention-item {
  display: grid;
  gap: 0.55rem;
  padding: 1rem;
  border-radius: 16px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, #ffffff 0%, #fbfcff 100%);
}

.attention-item strong {
  font-size: 1.4rem;
}

.attention-list .record-row {
  align-items: flex-start;
}

.metric-value {
  font-size: 2rem;
  font-weight: 700;
  color: var(--accent-strong);
}

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

.panel-full {
  grid-column: 1 / -1;
}

.single-column {
  grid-template-columns: 1fr;
}

.panel-head,
.page-head {
  align-items: center;
  justify-content: space-between;
}

.panel-head {
  margin-bottom: 1.25rem;
}

.record-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 16px;
  transition: transform 0.18s ease, border-color 0.18s ease, background 0.18s ease;
}

.record-row:hover {
  transform: translateY(-1px);
  background: #f7fbff;
  border-color: #c9d8f1;
}

.status-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  margin-top: 0.5rem;
}

.status-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 1.7rem;
  padding: 0.2rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.status-badge-ready {
  color: #0f5132;
  background: #e8f6ee;
  border: 1px solid #a9ddbe;
}

.status-badge-empty {
  color: #9f1239;
  background: #fff1f4;
  border: 1px solid #f3b4c3;
}

.quick-actions {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.quick-action-card {
  display: grid;
  gap: 0.6rem;
  padding: 1rem 1.05rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, #ffffff 0%, #f7fbff 100%);
  transition: transform 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.quick-action-card:hover {
  transform: translateY(-1px);
  border-color: #bfd0f1;
  box-shadow: 0 12px 26px rgba(49, 95, 203, 0.1);
}

.quick-action-icon {
  width: 2.2rem;
  height: 2.2rem;
  border-radius: 12px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  padding: 0.45rem;
}

.quick-action-card strong {
  font-size: 1rem;
}

.quick-action-card small {
  color: var(--muted);
  line-height: 1.45;
}

.placeholder-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.placeholder-grid span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3rem;
  padding: 0.75rem 1rem;
  border-radius: 14px;
  background: var(--accent-soft);
  border: 1px dashed rgba(76, 124, 240, 0.28);
  color: var(--accent-strong);
}

.flash-message {
  padding: 1rem 1.2rem;
  border-radius: 16px;
  background: linear-gradient(180deg, #ecfbf2 0%, #e4f7eb 100%);
  border: 1px solid #bfe6cb;
  color: #0f5132;
  box-shadow: 0 10px 22px rgba(15, 81, 50, 0.08);
}

.flash-message-error {
  background: linear-gradient(180deg, #fff4f6 0%, #ffecef 100%);
  border-color: #f0b7c4;
  color: #9f1239;
  box-shadow: 0 10px 22px rgba(159, 18, 57, 0.08);
}

.toolbar {
  margin-bottom: 1.25rem;
}

.search-input,
input,
textarea {
  width: 100%;
  border: 1px solid #ced8e8;
  border-radius: 12px;
  padding: 0.9rem 1rem;
  background: #fff;
}

input:focus,
textarea:focus {
  outline: none;
  border-color: #87a9f7;
  box-shadow: 0 0 0 4px rgba(76, 124, 240, 0.12);
}

textarea {
  resize: vertical;
  min-height: 7rem;
}

.table-shell {
  overflow-x: auto;
  border-radius: 16px;
  background: #fff;
}

.record-table {
  width: 100%;
  border-collapse: collapse;
}

.record-table th,
.record-table td {
  text-align: left;
  padding: 1rem;
  border-bottom: 1px solid #e8eef7;
  vertical-align: top;
}

.record-table th {
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
  background: #f8fbff;
}

.login-shell {
  width: min(100%, 460px);
}

.login-card {
  padding: 1.25rem;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(215, 224, 238, 0.95);
  box-shadow: 0 28px 64px rgba(28, 55, 112, 0.14);
  backdrop-filter: blur(12px);
}

.login-form-panel {
  display: grid;
  align-content: center;
  gap: 1rem;
  padding: 1.9rem;
  border-radius: 22px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(247, 250, 255, 0.98) 100%);
  border: 1px solid #dde6f4;
}

.login-form-head {
  display: grid;
  gap: 0.45rem;
}

.login-form-head .eyebrow {
  margin-bottom: 0;
}

.login-form-head h1 {
  font-size: 1.6rem;
  max-width: none;
}

.login-form {
  display: grid;
  gap: 1rem;
}

.login-button {
  width: 100%;
  min-height: 3.35rem;
}

.editor-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.95fr);
  gap: 1rem;
}

.sidebar-stack {
  display: grid;
  gap: 1rem;
  align-content: start;
}

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

.field-card {
  padding: 1rem;
  border-radius: 16px;
  display: grid;
  gap: 0.65rem;
}

.sticky-action-bar {
  position: sticky;
  top: 1rem;
  z-index: 5;
  margin-bottom: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.85rem;
  padding: 1rem 1.1rem;
  border: 1px solid #c9d8f1;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(245, 249, 255, 0.96) 0%, rgba(236, 243, 255, 0.96) 100%);
  box-shadow: 0 14px 28px rgba(49, 95, 203, 0.12);
  backdrop-filter: blur(10px);
}

.sticky-action-meta {
  display: grid;
  gap: 0.2rem;
}

.sticky-action-meta strong {
  font-size: 0.96rem;
}

.sticky-action-meta small {
  color: var(--muted);
}

.sticky-action-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
}

.field-full {
  grid-column: 1 / -1;
}

.field-card label {
  font-weight: 700;
}

.upload-box {
  display: grid;
  gap: 0.65rem;
  padding: 1rem;
  border-radius: 16px;
  background: var(--paper-muted);
  cursor: pointer;
}

.upload-box span {
  font-weight: 600;
}

.upload-box small {
  color: var(--muted);
}

.upload-box-camera {
  background: linear-gradient(180deg, #edf4ff 0%, #e6f0ff 100%);
  border-color: #cddcff;
}

.upload-box input[type="file"] {
  padding: 0;
  border: 0;
  background: transparent;
}

.slot-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  margin-bottom: 1rem;
}

.slot-card {
  display: grid;
  gap: 0.75rem;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, #fcfdff 0%, #f7faff 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
}

.slot-head {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 0.75rem;
}

.slot-head strong {
  display: block;
}

.slot-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 92px;
  padding: 0.35rem 0.65rem;
  border-radius: 999px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.slot-badge-ready {
  color: #0f5132;
  background: #e8f6ee;
  border: 1px solid #a9ddbe;
}

.slot-badge-empty {
  color: #9f1239;
  background: #fff1f4;
  border: 1px solid #f3b4c3;
}

.slot-preview {
  width: 100%;
  height: 210px;
  object-fit: cover;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #eef3fb;
}

.slot-meta {
  display: grid;
  gap: 0.2rem;
  padding: 0.1rem 0;
}

.slot-caption-preview {
  font-style: normal;
  color: var(--accent-strong);
  font-size: 0.84rem;
}

.slot-empty {
  min-height: 210px;
  display: grid;
  place-items: center;
  padding: 1rem;
  border-radius: 12px;
  border: 1px dashed #cfd9eb;
  background:
    linear-gradient(180deg, rgba(232, 240, 255, 0.7) 0%, rgba(248, 251, 255, 0.95) 100%);
  color: var(--muted);
  text-align: center;
}

.slot-caption {
  display: grid;
  gap: 0.35rem;
}

.slot-caption label {
  font-size: 0.9rem;
  font-weight: 600;
}

.compact-head {
  margin-top: 1.25rem;
}

.dropzone {
  position: relative;
  min-height: 122px;
  border: 1.5px dashed #c7d6ee;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

.dropzone.drag-over {
  border-color: #7ca2ff;
  background: #eef4ff;
  box-shadow: 0 0 0 4px rgba(76, 124, 240, 0.12);
  transform: translateY(-1px);
}

.drop-hint {
  font-style: normal;
  color: var(--accent-strong);
  font-size: 0.86rem;
}

.doc-links.vertical {
  display: grid;
}

.doc-links a {
  color: var(--accent-strong);
  display: inline-grid;
  gap: 0.2rem;
  width: 100%;
  padding: 0.55rem 0.85rem;
  border-radius: 12px;
  border: 1px solid #d2dff7;
  background: #f7fbff;
  transition: border-color 0.18s ease, background 0.18s ease, transform 0.18s ease;
}

.doc-links a:hover {
  transform: translateY(-1px);
  background: #edf4ff;
  border-color: #b9cdf1;
}

.doc-links a small {
  color: var(--muted);
  font-size: 0.78rem;
}

.image-grid {
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.image-card {
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.image-card img {
  width: 100%;
  height: 180px;
  object-fit: cover;
  display: block;
}

.image-card-body,
.image-card > button {
  margin: 0.9rem;
}

.image-card-body {
  display: grid;
  gap: 0.25rem;
}

@media (max-width: 960px) {
  .app-shell,
  .hero,
  .editor-grid,
  .panel-grid,
  .metrics {
    grid-template-columns: 1fr;
  }

  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    padding-bottom: 1rem;
  }

  .form-grid {
    grid-template-columns: 1fr;
  }

  .slot-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  .attention-metrics {
    grid-template-columns: 1fr 1fr;
  }

  .sticky-action-bar {
    position: static;
  }
}

@media (max-width: 720px) {
  .record-row,
  .page-head,
  .topbar {
    flex-direction: column;
    align-items: stretch;
  }

  .topbar-user,
  .topbar-user-meta {
    align-items: stretch;
  }

  .record-table th,
  .record-table td {
    padding: 0.75rem;
  }

  .slot-grid,
  .photo-actions {
    grid-template-columns: 1fr;
  }

  .attention-metrics {
    grid-template-columns: 1fr;
  }

  .login-card,
  .login-form-panel {
    padding: 1.2rem;
  }

  .slot-head {
    flex-direction: column;
    align-items: stretch;
  }

  .slot-badge {
    width: fit-content;
  }

  .slot-preview,
  .slot-empty {
    min-height: 180px;
    height: 180px;
  }

  .sticky-action-buttons,
  .status-badges {
    width: 100%;
  }
}
