:root {
  --navy: #062b55;
  --navy-2: #073a6c;
  --green: #079a55;
  --green-dark: #057b44;
  --green-light: #e5f7ed;
  --ink: #0b2340;
  --muted: #67768a;
  --line: #dce3eb;
  --bg: #f3f5f8;
  --white: #fff;
  --blue: #086cf0;
  --orange: #e89a55;
  --red: #df6d67;
  --violet: #8a6ad7;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "DM Sans", sans-serif;
  color: var(--ink);
  background: var(--bg);
  font-size: 14px;
}
button, select, input { font: inherit; }
button { cursor: pointer; }
.hidden { display: none !important; }
.app-shell { min-height: 100vh; }

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: 260px;
  padding: 32px 18px 22px;
  display: flex;
  flex-direction: column;
  z-index: 20;
  background: linear-gradient(180deg, #06294f 0%, #073965 100%);
  color: #d7e1e5;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 10px 36px;
  color: white;
  text-decoration: none;
  font: 750 17px/1.2 Manrope, sans-serif;
}
.brand-mark {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 12px;
  background: transparent;
  color: white;
  font-size: 12px;
  letter-spacing: -.4px;
}
.main-nav { display: flex; flex-direction: column; gap: 4px; }
.nav-label {
  margin: 16px 13px 8px;
  color: #79909b;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.25px;
}
.nav-item {
  position: relative;
  height: 42px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-radius: 8px;
  color: #bfd0d7;
  text-decoration: none;
  font-weight: 500;
  font-size: 13px;
}
.nav-item > span:first-child, .nav-item svg { width: 19px; height: 19px; flex: 0 0 19px; }
.nav-item svg { fill: none; stroke: currentColor; stroke-width: 1.8; }
.nav-item:hover { background: #0d477a; color: white; }
.nav-item.active { background: #0874f9; color: white; box-shadow: 0 8px 20px #001d3d42; }
.nav-item.active::before {
  content: "";
  position: absolute;
  left: -17px;
  width: 3px;
  height: 24px;
  border-radius: 0 3px 3px 0;
  background: #79b8ff;
}
.nav-badge {
  width: auto !important;
  height: auto !important;
  margin-left: auto;
  padding: 3px 6px;
  border-radius: 10px;
  background: #1ca77d;
  color: white;
  font-size: 8px !important;
  text-transform: uppercase;
}
.sidebar-footer {
  margin-top: auto;
  padding: 19px 10px 0;
  border-top: 1px solid #294858;
}
.privacy-note { display: flex; gap: 10px; align-items: flex-start; color: #b9c9d0; }
.privacy-note > svg { width: 17px; fill: none; stroke: #40c9a1; flex: 0 0 17px; }
.privacy-note div { display: flex; flex-direction: column; }
.privacy-note strong { font-size: 10px; margin-bottom: 3px; }
.privacy-note small { max-width: 150px; color: #819aa5; font-size: 9px; line-height: 1.35; }

.main-content { min-width: 0; margin-left: 260px; }
.topbar {
  height: 76px;
  padding: 0 38px;
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--bg);
  border-bottom: 0;
}
.topbar-spacer { flex: 1; }
.menu-button {
  display: none;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #657883;
  place-items: center;
}
.menu-button svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.environment-pill, .development-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 9px;
  border-radius: 99px;
  color: #39725f;
  background: #eef8f4;
  font-size: 10px;
  font-weight: 600;
}
.environment-pill i { width: 6px; height: 6px; border-radius: 50%; background: #20ad82; }
.divider { height: 28px; width: 1px; margin: 0 9px; background: var(--line); }
.profile { display: flex; align-items: center; gap: 10px; }
.avatar {
  width: 35px;
  height: 35px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid #cad4df;
  background: #fff;
  color: var(--navy);
  font-size: 11px;
  font-weight: 700;
}
.profile-copy { display: flex; flex-direction: column; line-height: 1.3; }
.profile-copy strong { color: #0b1e35; font-size: 13px; }
.profile-copy small { color: var(--muted); font-size: 10px; }

.page { max-width: 1650px; margin: auto; padding: 28px 38px 52px; }
.page-heading {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 25px;
  margin-bottom: 28px;
}
.eyebrow { margin: 0 0 8px; color: #839299; font-size: 10px; font-weight: 700; letter-spacing: 1.35px; }
.page-heading h1 { margin: 0 0 5px; color: #0a2140; font: 800 29px Manrope, sans-serif; }
.page-heading p:last-child { margin: 0; color: var(--muted); }
.heading-actions { display: flex; gap: 9px; }
.primary-button, .secondary-button {
  height: 42px;
  padding: 0 17px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 8px;
  font-weight: 600;
  transition: .15s;
}
.primary-button { border: 0; background: var(--blue); color: white; box-shadow: 0 7px 16px #086cf02b; }
.primary-button:hover:not(:disabled) { background: #075bc7; transform: translateY(-1px); }
.secondary-button { border: 1px solid #dbe4e7; background: white; color: #53666f; }
.secondary-button:hover:not(:disabled) { border-color: #bdcdd3; background: #fafcfc; }
.primary-button svg, .secondary-button svg { width: 17px; fill: none; stroke: currentColor; stroke-width: 2; }
button:disabled, select:disabled, input:disabled { cursor: not-allowed; opacity: .5; }

.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 18px; }
.stat-card, .panel {
  background: #fff;
  border: 1px solid #e4ebed;
  border-radius: 14px;
  box-shadow: 0 4px 14px #1934510a;
}
.stat-card { position: relative; min-width: 0; overflow: hidden; padding: 19px 20px 18px; }
.stat-card::after { content: ""; position: absolute; inset: 0 auto 0 0; width: 3px; background: var(--accent); }
.accent-green { --accent: var(--green); }
.accent-blue { --accent: var(--blue); }
.accent-orange { --accent: var(--orange); }
.accent-red { --accent: var(--red); }
.stat-top { display: flex; align-items: center; justify-content: space-between; margin-bottom: 17px; }
.stat-icon { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 8px; background: #edf8f5; color: var(--accent); }
.stat-icon svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.stat-card > p { margin: 0 0 7px; color: #61737d; font-size: 12px; }
.stat-card h2 { margin: 0 0 5px; color: #0b2340; font: 800 25px Manrope, sans-serif; }
.stat-card > small { color: #99a4aa; font-size: 10px; }
.status-pill { padding: 4px 7px; border-radius: 12px; color: #39735f; background: #edf8f4; font-size: 9px; font-weight: 700; }
.status-pill.warning { color: #a9662f; background: #fff3e8; }
.status-pill.danger { color: #b45d58; background: #fdeeed; }
.dashboard-grid { display: grid; grid-template-columns: 1.22fr .78fr; gap: 18px; margin-bottom: 18px; }
.panel { padding: 22px; }
.panel-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 15px; }
.panel-heading h3, .honest-panel h3 { margin: 0 0 4px; font: 700 15px Manrope, sans-serif; }
.panel-heading p { margin: 0; color: #84929a; font-size: 11px; }
.secure { display: flex; align-items: center; gap: 5px; padding: 5px 8px; border-radius: 12px; background: #f0f8f5; color: #548274; font-size: 9px; white-space: nowrap; }
.secure svg { width: 12px; fill: none; stroke: currentColor; }

.dropzone {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 17px;
  border: 1.5px dashed #a9c9ed;
  border-radius: 10px;
  background: #f8fbff;
  cursor: pointer;
  transition: .18s;
  outline: none;
}
.dropzone:hover, .dropzone.drag, .dropzone:focus-visible { border-color: var(--blue); background: #f1f7ff; box-shadow: 0 0 0 3px #086cf012; }
.compact-dropzone { min-height: 145px; margin: 18px 0 0; }
.large-dropzone { min-height: 220px; }
.upload-art { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 12px; background: #e7f1ff; color: var(--blue); }
.upload-art.large { width: 58px; height: 58px; }
.upload-art svg { width: 25px; fill: none; stroke: currentColor; stroke-width: 1.7; }
.upload-art.large svg { width: 30px; }
.dropzone strong { font-size: 13px; }
.dropzone p { margin: 5px 0; color: #84929a; font-size: 11px; }
.dropzone button { padding: 0; border: 0; background: none; color: var(--blue); text-decoration: underline; font-weight: 600; }
.dropzone small { color: #9ba8ae; font-size: 9px; }
.file-input { display: none; }
.honest-panel { padding: 24px 26px; }
.panel-kicker { display: block; margin-bottom: 8px; color: #86969d; font-size: 9px; font-weight: 700; letter-spacing: 1px; }
.check-list { display: grid; gap: 10px; margin: 19px 0; padding: 0; list-style: none; }
.check-list li { display: flex; gap: 8px; align-items: center; color: #4c616b; font-size: 11px; }
.check-list svg { width: 15px; fill: none; stroke: var(--green); stroke-width: 2.3; }
.honest-panel > p { margin: 0; color: #8a989f; font-size: 10px; line-height: 1.5; }
.text-button { display: flex; align-items: center; gap: 6px; border: 0; background: transparent; color: #158d6b; font-size: 10px; font-weight: 600; }
.text-button svg { width: 13px; fill: none; stroke: currentColor; }

.import-panel { margin-bottom: 16px; }
.processing { margin-top: 20px; padding: 14px 15px; border-radius: 9px; background: #f5faf8; }
.processing-copy { display: flex; justify-content: space-between; margin-bottom: 9px; font-size: 11px; }
.processing-copy span { color: var(--green-dark); font-weight: 700; }
.processing-bar { height: 6px; overflow: hidden; border-radius: 99px; background: #dceae5; }
.processing-bar span { display: block; width: 0; height: 100%; border-radius: inherit; background: var(--green); transition: width .15s; }
.processing small { display: block; margin-top: 8px; color: #84959d; font-size: 9px; }
.result-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 16px; }
.result-stats article { display: flex; align-items: center; gap: 12px; padding: 14px 16px; background: white; border: 1px solid var(--line); border-radius: 9px; }
.result-stats div { display: flex; flex-direction: column; }
.result-stats small { color: #86959c; font-size: 9px; }
.result-stats strong { margin-top: 2px; color: #29414c; font: 700 18px Manrope, sans-serif; }
.result-dot { width: 9px; height: 9px; flex: 0 0 9px; border-radius: 50%; box-shadow: 0 0 0 5px #eef5f2; }
.result-dot.valid { background: var(--green); }
.result-dot.item { background: var(--blue); box-shadow: 0 0 0 5px #edf3fb; }
.result-dot.duplicate { background: var(--orange); box-shadow: 0 0 0 5px #fff3e8; }
.result-dot.canceled { background: var(--violet); box-shadow: 0 0 0 5px #f2effa; }
.result-dot.invalid { background: var(--red); box-shadow: 0 0 0 5px #fceeed; }
.results-panel { padding-bottom: 10px; }
.results-heading { align-items: center; }
.table-tools { display: flex; gap: 8px; }
.search-field { width: 260px; height: 36px; display: flex; align-items: center; gap: 7px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: white; }
.search-field svg { width: 15px; fill: none; stroke: #809099; }
.search-field input { width: 100%; min-width: 0; border: 0; outline: 0; color: #465b65; font-size: 10px; }
.table-tools select { height: 36px; padding: 0 10px; border: 1px solid var(--line); border-radius: 7px; background: white; color: #5d7079; font-size: 10px; }
.empty-results { min-height: 280px; display: flex; flex-direction: column; align-items: center; justify-content: center; color: #829198; text-align: center; }
.empty-results > svg { width: 31px; margin-bottom: 12px; fill: none; stroke: #9bb0b8; }
.empty-results strong { margin-bottom: 5px; color: #516771; font-size: 12px; }
.empty-results p { margin: 0; font-size: 10px; }
.table-wrap { overflow-x: auto; margin: 18px -22px 0; border-top: 1px solid var(--line); }
table { width: 100%; min-width: 1380px; border-collapse: collapse; }
th { padding: 10px 13px; border-bottom: 1px solid var(--line); color: #8c9aa1; font-size: 8px; font-weight: 700; letter-spacing: .45px; text-align: left; white-space: nowrap; }
td { max-width: 240px; padding: 11px 13px; border-bottom: 1px solid #eef2f3; color: #5e717a; font-size: 9px; vertical-align: top; }
td strong { display: block; overflow: hidden; color: #2b414c; font-size: 9px; text-overflow: ellipsis; white-space: nowrap; }
td small { display: block; overflow: hidden; margin-top: 2px; color: #8e9ba1; font-size: 8px; text-overflow: ellipsis; white-space: nowrap; }
.money-cell { text-align: right; white-space: nowrap; }
.table-status { display: inline-flex; align-items: center; gap: 5px; padding: 5px 7px; border-radius: 12px; font-size: 8px; font-weight: 600; white-space: nowrap; }
.table-status::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.table-status.authorized { color: #197e61; background: #eaf7f3; }
.table-status.canceled { color: #a0602e; background: #fff3e8; }
.table-status.other { color: #7658bb; background: #f2eefb; }
.pagination-row { display: flex; align-items: center; justify-content: space-between; padding-top: 12px; }
.pagination-row small { color: #84949b; font-size: 9px; }
.page-button { padding: 6px 10px; border: 1px solid var(--line); background: white; color: #516771; font-size: 9px; }
.page-button:first-child { border-radius: 6px 0 0 6px; }
.page-button:last-child { margin-left: -1px; border-radius: 0 6px 6px 0; }
.issues-panel { margin-top: 16px; }
.issue-list { display: grid; gap: 8px; margin-top: 16px; }
.issue-row { display: grid; grid-template-columns: minmax(170px, .7fr) minmax(260px, 1.3fr) auto; gap: 15px; align-items: center; padding: 11px 13px; border: 1px solid #f0e1df; border-radius: 8px; background: #fffafa; }
.issue-row strong { overflow: hidden; color: #4d626b; font-size: 10px; text-overflow: ellipsis; white-space: nowrap; }
.issue-row span { color: #8a7474; font-size: 9px; }
.issue-kind { padding: 4px 7px; border-radius: 10px; background: #f8e8e6; color: #a85b55 !important; font-weight: 600; white-space: nowrap; }

.empty-page { min-height: 620px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-page .upload-art { margin-bottom: 18px; }
.empty-page h1 { margin: 0 0 8px; font: 800 28px Manrope, sans-serif; }
.empty-page > p:not(.eyebrow) { max-width: 530px; margin: 0 0 20px; color: var(--muted); }
.toast {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 200;
  max-width: 420px;
  padding: 14px 18px;
  display: flex;
  align-items: center;
  gap: 11px;
  border-radius: 10px;
  background: #143847;
  color: #fff;
  box-shadow: 0 15px 30px #122c3955;
  opacity: 0;
  transform: translateY(100px);
  transition: .3s;
  pointer-events: none;
}
.toast.show { opacity: 1; transform: translateY(0); }
.toast > svg { width: 20px; flex: 0 0 20px; fill: none; stroke: #48d0a6; }
.toast div { display: flex; flex-direction: column; }
.toast strong { font-size: 11px; }
.toast small { margin-top: 2px; color: #b7c9d0; font-size: 9px; line-height: 1.35; }

@media (max-width: 1180px) {
  .stats-grid { grid-template-columns: repeat(2, 1fr); }
  .dashboard-grid { grid-template-columns: 1fr; }
  .result-stats { grid-template-columns: repeat(3, 1fr); }
  .results-heading { align-items: flex-start; flex-direction: column; }
  .table-tools { width: 100%; }
  .search-field { flex: 1; }
}
@media (max-width: 760px) {
  .sidebar { transform: translateX(-100%); transition: .25s; }
  .sidebar.open { transform: translateX(0); box-shadow: 20px 0 50px #102d3c44; }
  .main-content { margin-left: 0; }
  .menu-button { display: grid; }
  .topbar { padding: 0 18px; }
  .profile-copy, .divider, .environment-pill { display: none; }
  .page { padding: 26px 18px; }
  .page-heading { align-items: flex-start; flex-direction: column; }
  .heading-actions { width: 100%; }
  .heading-actions button { flex: 1; }
  .stats-grid, .result-stats { grid-template-columns: 1fr 1fr; }
  .dropzone { padding: 25px 18px; flex-direction: column; text-align: center; }
  .table-tools { flex-direction: column; }
  .search-field, .table-tools select { width: 100%; }
  .issue-row { grid-template-columns: 1fr; gap: 5px; }
}
@media (max-width: 480px) {
  .stats-grid, .result-stats { grid-template-columns: 1fr; }
  .primary-button, .secondary-button { padding: 0 12px; }
}


.logout-form {
  margin: 0;
}

.logout-form input {
  display: none;
}

.logout-button {
  min-height: 36px;
  padding: 0 13px;
  border: 1px solid var(--border, #d8e1e4);
  border-radius: 8px;
  background: #fff;
  color: var(--text-muted, #66757c);
  font: 700 13px "DM Sans", sans-serif;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease, background 0.15s ease;
}

.logout-button:hover {
  border-color: #176b5a;
  background: #f4faf8;
  color: #176b5a;
}

@media (max-width: 620px) {
  .profile-copy {
    display: none;
  }

  .logout-button {
    padding-inline: 10px;
  }
}
