:root {
  --primary: #25C6E3;
  --primary-dark: #1398b0;
  --bg: #f5f7fb;
  --card: #ffffff;
  --text: #18202f;
  --muted: #6b7280;
  --border: #e5e7eb;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #f97316;
  --blue: #2563eb;
  --shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Inter, Segoe UI, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
}

.app {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  background: #0f172a;
  color: white;
  padding: 24px 18px;
  position: sticky;
  top: 0;
  height: 100vh;
}

.logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 34px;
}

.logo-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  color: #06202a;
}

.logo-title { font-weight: 800; font-size: 17px; }
.logo-subtitle { color: #94a3b8; font-size: 12px; margin-top: 2px; }

.nav a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  color: #cbd5e1;
  text-decoration: none;
  margin-bottom: 6px;
  font-size: 14px;
}

.nav a.active,
.nav a:hover {
  background: rgba(37, 198, 227, 0.14);
  color: white;
}

.sidebar-footer {
  position: absolute;
  bottom: 24px;
  left: 18px;
  right: 18px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(255,255,255,0.06);
  color: #cbd5e1;
  font-size: 12px;
  line-height: 1.45;
}

.main { padding: 28px; }

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 28px;
  gap: 18px;
}

.page-title h1 {
  margin: 0;
  font-size: 28px;
}

.page-title p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.btn {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 16px;
  font-weight: 700;
  cursor: pointer;
  background: white;
  color: var(--text);
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.04);
  text-decoration: none;
}

.btn.primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #052631;
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
  margin-bottom: 22px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1.35fr 0.65fr;
  gap: 18px;
  margin-bottom: 22px;
}

.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
}

.metric-label {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 8px;
}

.metric-value {
  font-size: 26px;
  font-weight: 800;
}

.metric-note {
  font-size: 12px;
  margin-top: 8px;
  color: var(--muted);
}

.positive { color: var(--green); }
.negative { color: var(--red); }
.warning { color: var(--orange); }
.muted { color: var(--muted); }

.section-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.section-title h2 {
  margin: 0;
  font-size: 18px;
}

.screen { margin-bottom: 36px; }

.screen-label {
  display: inline-flex;
  color: var(--primary-dark);
  background: #e0faff;
  border: 1px solid #bae6fd;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  margin-bottom: 14px;
}

.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 700;
  background: #eef2ff;
  color: #3730a3;
}

.tag.blue { background: #dbeafe; color: #1d4ed8; }
.tag.green { background: #dcfce7; color: #166534; }
.tag.orange { background: #ffedd5; color: #9a3412; }
.tag.gray { background: #f1f5f9; color: #475569; }

.progress-list { display: grid; gap: 14px; }

.progress-row {
  display: grid;
  grid-template-columns: 120px 1fr 70px;
  align-items: center;
  gap: 12px;
  font-size: 13px;
}

.bar {
  height: 10px;
  border-radius: 99px;
  background: #e5e7eb;
  overflow: hidden;
}

.bar span {
  display: block;
  height: 100%;
  background: var(--primary);
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  width: min(420px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 28px;
}

.login-logo { margin-bottom: 20px; }

.login-card h1 {
  margin: 0 0 18px;
  font-size: 24px;
}

label {
  display: block;
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 6px;
  font-weight: 700;
}

input {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 14px;
  font: inherit;
}

select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 14px;
  font: inherit;
  background: white;
}

textarea {
  min-height: 64px;
  resize: vertical;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
}

td {
  padding: 13px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.upload-zone {
  border: 2px dashed #bae6fd;
  background: #f0faff;
  border-radius: 20px;
  padding: 34px;
  text-align: center;
  margin-bottom: 18px;
}

.upload-zone input {
  max-width: 420px;
  margin-left: auto;
  margin-right: auto;
}

.upload-zone p {
  color: var(--muted);
  font-size: 14px;
}

.upload-icon {
  width: 58px;
  height: 58px;
  border-radius: 18px;
  background: white;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 800;
  margin-bottom: 12px;
  box-shadow: var(--shadow);
}

.notice {
  color: #166534;
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

.empty {
  color: var(--muted);
  text-align: center;
}

.filters,
.inline-form {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 10px;
  align-items: start;
}

.checkbox-label {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  color: var(--text);
}

.checkbox-label input {
  width: auto;
  margin: 0;
}

.actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.currency-switcher {
  display: flex;
  gap: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 3px;
  background: #f8fafc;
}

.currency-switcher .btn {
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 700;
  border-radius: 5px;
  border: none;
  background: transparent;
  color: #64748b;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

.currency-switcher .btn.primary {
  background: #25C6E3;
  color: #fff;
}

.topbar-search {
  display: flex;
  gap: 6px;
  align-items: center;
}

.topbar-search input {
  width: 200px;
  padding: 6px 10px;
  font-size: 13px;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  background: #f8fafc;
  margin: 0;
}

.topbar-search input:focus {
  outline: none;
  border-color: #25C6E3;
  background: #fff;
}

.topbar-search .btn {
  padding: 6px 10px;
  font-size: 13px;
}

.pagination {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: center;
  padding: 16px 0 4px;
}

.inline-action {
  display: inline;
}

.description-cell {
  max-width: 320px;
}

.problem-row td {
  background: #fff7ed;
}

.tag.red {
  background: #fee2e2;
  color: #991b1b;
}

.btn.danger {
  color: var(--red);
}

.detail-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 18px;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-bottom: 14px;
}

.readonly-field {
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 11px 12px;
  margin-bottom: 14px;
  background: #f8fafc;
}

.upload-zone.compact {
  padding: 20px;
}

.attachment-actions form {
  margin: 0;
}

.zip-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 18px;
}

.zip-item {
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  background: #f8fafc;
}

.zip-item strong {
  display: block;
  margin-bottom: 6px;
}

.zip-item span {
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 1100px) {
  .detail-layout { grid-template-columns: 1fr; }
  .zip-box { grid-template-columns: 1fr; }
}

.full-width { width: 100%; }

.alert {
  color: #991b1b;
  background: #fee2e2;
  border: 1px solid #fecaca;
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 14px;
}

@media (max-width: 1100px) {
  .app { grid-template-columns: 1fr; }
  .sidebar { position: relative; height: auto; }
  .sidebar-footer { position: static; margin-top: 24px; }
  .grid-4, .grid-2 { grid-template-columns: 1fr; }
}

/* --- Breadcrumb navigation --- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.breadcrumb a {
  color: var(--primary-dark);
  text-decoration: none;
  font-weight: 600;
}

.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb-sep { color: var(--border); font-size: 16px; line-height: 1; }
.breadcrumb-current { font-weight: 700; color: var(--text); }

/* --- Review completeness bar --- */
.completeness-bar {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 20px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  position: relative;
  overflow: hidden;
}

.completeness-bar::before {
  content: '';
  position: absolute;
  inset: 0 auto 0 0;
  width: var(--progress, 0%);
  background: rgba(37, 198, 227, 0.09);
  pointer-events: none;
}

.completeness-label { font-weight: 700; font-size: 15px; position: relative; }
.completeness-meta { color: var(--muted); font-size: 13px; position: relative; flex: 1; }

/* --- Mini trend bars --- */
.trend-bar-mini {
  display: inline-block;
  width: 80px;
  height: 6px;
  border-radius: 99px;
  background: #e5e7eb;
  overflow: hidden;
  vertical-align: middle;
}

.trend-bar-mini span {
  display: block;
  height: 100%;
  background: var(--primary);
  border-radius: 99px;
}

/* --- Clickable table rows --- */
tr.clickable { cursor: pointer; }
tr.clickable:hover td { background: #f0f9ff; }

/* --- Attachment two-row card --- */
.attachment {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 12px 14px;
  margin-bottom: 10px;
  background: #fafafa;
}

.attachment-top {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.attachment-icon {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: white;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  flex-shrink: 0;
}

.attachment-name {
  font-weight: 700;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
  color: var(--text);
  text-decoration: none;
}

.attachment-name:hover { color: var(--primary-dark); text-decoration: underline; }

.attachment-bottom {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding-left: 44px;
}

.attachment-meta { color: var(--muted); font-size: 12px; }
.attachment-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* --- Compact file drop zone --- */
.file-drop {
  border: 2px dashed #bae6fd;
  background: #f0faff;
  border-radius: 14px;
  padding: 14px 16px;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  cursor: pointer;
  transition: background 0.12s;
}

.file-drop:hover { background: #e0f5ff; }

.file-drop-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  background: white;
  border: 1px solid #bae6fd;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}

.file-drop-label { font-weight: 700; font-size: 13px; color: var(--primary-dark); }
.file-drop-hint { font-size: 12px; color: var(--muted); margin-top: 2px; }
.file-drop input[type="file"] { display: none; }

/* --- Progress total note --- */
.progress-total { font-size: 12px; color: var(--muted); margin: 12px 0 0; }
