/*
 * DupZero 3.1 Corporate Signal Theme
 * Bright green drives actions and verified states; Tianyan yellow provides
 * brand recognition and emphasis. Neutral surfaces keep dense data readable.
 */
:root {
  --primary: #20C978;
  --primary-dark: #0D9152;
  --primary-soft: #EAFBF2;
  --primary-subtle: #F5FEF9;
  --blue: #20C978;
  --accent: #FFC928;
  --accent-strong: #F2B900;
  --accent-dark: #8A6500;
  --accent-soft: #FFF8D9;
  --cyan: #18A9A6;
  --cyan-soft: #EBFAF8;
  --duplicate: #E5A900;
  --duplicate-soft: #FFF8DE;
  --unique: #16A862;
  --unique-soft: #EAFBF2;
  --info-soft: #EAFBF2;
  --bg: #F6F8F4;
  --card: #FFFFFF;
  --text: #172033;
  --muted: #526071;
  --muted-2: #8B97A5;
  --border: #E1E7DE;
  --border-strong: #CBD5CA;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-sm: 0 1px 2px rgba(23, 32, 51, .035), 0 6px 18px rgba(23, 32, 51, .025);
  --shadow-md: 0 12px 34px rgba(23, 32, 51, .09);
  --shadow-lg: 0 24px 70px rgba(23, 32, 51, .15);
  --focus-ring: 0 0 0 3px rgba(32, 201, 120, .15);
}

* { scrollbar-color: #C4CEC2 transparent; }

body,
.app-main {
  background: var(--bg);
  color: var(--text);
}

::selection {
  background: #FFF0A6;
  color: #314034;
}

:where(a, button, input, select, textarea):focus-visible {
  outline-color: var(--primary);
}

/* Brand shell ----------------------------------------------------------- */
.sidebar {
  position: fixed;
  overflow: hidden;
  border-right-color: #DDE5DA;
  background: #FFFFFF;
  box-shadow: 7px 0 26px rgba(23, 32, 51, .035);
}

.sidebar::before {
  position: absolute;
  z-index: 2;
  top: 0;
  right: 0;
  left: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--accent) 0 34%, var(--primary) 34% 100%);
  content: "";
}

.sidebar .brand {
  border-bottom-color: #E7ECE4;
}

.brand-logo-frame {
  border-color: #CDEBDA;
  border-radius: 12px;
  background: linear-gradient(145deg, #FFFFFF, #F2FCF7);
  box-shadow: 0 5px 15px rgba(20, 158, 90, .12);
}

.brand-logo-frame::after {
  width: 9px;
  height: 9px;
  border-color: #FFFFFF;
  background: var(--accent);
  box-shadow: 0 0 0 1px rgba(138, 101, 0, .08);
}

.brand-logo-frame .brand-mark {
  border-radius: 8px;
  background: linear-gradient(145deg, #25D482, #0FA15A);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.brand-copy strong,
.auth-brand-panel .brand-word {
  color: #152231;
}

.brand-copy small,
.auth-brand-panel .brand-subtitle {
  color: #718073;
}

.sidebar-nav::-webkit-scrollbar-thumb { background: #CED8CC; }

.nav-section { color: #8B978A; }

.nav-item {
  color: #516052;
  border: 1px solid transparent;
}

.nav-item .icon { color: #849186; }

.nav-item:hover {
  border-color: #F4EAB8;
  background: #FFFCEE;
  color: #28372C;
}

.nav-item:hover .icon { color: #9C7800; }

.nav-item.active {
  border-color: #CDEFD9;
  background: linear-gradient(90deg, #E8FAF0, #F5FCF8);
  color: #087142;
  box-shadow: inset 3px 0 var(--primary);
}

.nav-item.active .icon { color: var(--primary-dark); }

.nav-item.active::after {
  position: absolute;
  right: 10px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 201, 40, .16);
  content: "";
}

.sidebar-status,
.sidebar-user { border-color: #E5EBE2; }

.sidebar-status strong,
.sidebar-user strong { color: #26372D; }

.sidebar-status span,
.sidebar-user a span { color: #849087; }

.sidebar-capability .status-indicator {
  background: linear-gradient(180deg, var(--accent), var(--primary));
}

/* The generic .sidebar-user span rule in the base stylesheet must never
   replace the avatar grid. Both shell avatars now use the same component. */
.sidebar-user > .avatar,
.topbar-profile > .avatar {
  display: grid;
  overflow: hidden;
  align-items: center;
  justify-items: center;
  line-height: 1;
  text-overflow: clip;
}

.avatar {
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 9px;
  box-shadow: 0 3px 10px rgba(23, 32, 51, .10);
}

.avatar-tone-0 { background: #14AE65; }
.avatar-tone-1 { background: #D69B00; }
.avatar-tone-2 { background: #159D9A; }
.avatar-tone-3 { background: #56845E; }
.avatar-tone-4 { background: #E2A817; color: #3E3000; }
.avatar-tone-5 { background: #D65372; }

/* Top bar --------------------------------------------------------------- */
.topbar {
  border-bottom-color: #E0E7DD;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 3px 18px rgba(23, 32, 51, .035);
  backdrop-filter: blur(14px);
}

.topbar-context strong { color: #2D3C31; }

.global-search {
  border-color: #D7E0D5;
  background: #F8FAF7;
}

.global-search:focus-within {
  border-color: #70D8A7;
  background: #FFFFFF;
  box-shadow: var(--focus-ring);
}

.global-search:focus-within > .icon { color: var(--primary-dark); }

.shortcut {
  border-color: #E1E7DE;
  color: #849087;
  background: #FFFFFF;
}

.topbar-scope-chip {
  border-color: #CBEBD8;
  background: #F0FBF5;
  color: #0B7D49;
}

.topbar-scope-chip::before {
  background: var(--accent);
  box-shadow: 0 0 0 3px rgba(255, 201, 40, .14);
}

.topbar-profile { color: #2D3C31; }

.icon-btn:hover,
.more-btn:hover,
.btn-ghost:hover {
  background: #FFF9DD;
  color: #745900;
}

/* Page hierarchy and actions ------------------------------------------ */
.content { max-width: 1560px; }

.page-title h1 { color: #14231B; }
.page-title p { color: #59675C; }

.eyebrow,
.section-kicker,
.result-overline {
  color: var(--primary-dark);
}

.eyebrow::before,
.section-kicker::before {
  display: inline-block;
  width: 14px;
  height: 3px;
  margin-right: 7px;
  border-radius: 99px;
  background: var(--accent);
  vertical-align: middle;
  content: "";
}

.btn-primary {
  border-color: var(--primary);
  background: var(--primary);
  color: #FFFFFF;
  box-shadow: 0 5px 14px rgba(20, 174, 101, .17);
}

.btn-primary:hover {
  border-color: var(--primary-dark);
  background: var(--primary-dark);
  box-shadow: 0 7px 18px rgba(13, 145, 82, .20);
}

.btn-accent {
  border-color: #F0BA13;
  background: var(--accent);
  color: #3A2D00;
  box-shadow: 0 5px 14px rgba(229, 169, 0, .18);
}

.btn-accent:hover {
  border-color: #DCA900;
  background: #F3BD16;
  color: #2F2500;
}

.btn-secondary:hover {
  border-color: #B9C6B8;
  background: #F7FAF6;
}

.text-link { color: var(--primary-dark); }
.text-link:hover { color: #07633A; }

/* Surfaces, dashboards and charts ------------------------------------- */
.card,
.stat-card,
.summary-tile,
.executive-metric {
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.card-header { border-bottom-color: #EEF1EC; }
.card-header h2,
.card-header h3,
.check-intro h2 { color: #223128; }

.executive-metric {
  overflow: hidden;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.executive-metric::before {
  position: absolute;
  top: 0;
  right: 0;
  left: 0;
  height: 3px;
  background: var(--metric-accent, var(--primary));
  content: "";
}

.executive-metric:nth-child(1) { --metric-accent: var(--primary); }
.executive-metric:nth-child(2) { --metric-accent: var(--accent); }
.executive-metric:nth-child(3) { --metric-accent: #16A862; }
.executive-metric:nth-child(4) { --metric-accent: #E5A900; }

.executive-metric:hover {
  border-color: #CFE2D2;
  box-shadow: 0 12px 28px rgba(23, 32, 51, .075);
  transform: translateY(-2px);
}

.metric-icon,
.stat-icon,
.activity-icon,
.record-icon,
.upload-icon,
.check-intro-icon {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.metric-icon.neutral {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.metric-icon.success { background: var(--primary-soft); color: var(--primary-dark); }
.quality-dot.primary { background: var(--primary); }
.quality-dot.warning { background: var(--accent-strong); }
.progress-line i,
.bar-track i,
.progress-bar i { background: var(--bar, var(--primary)); }

.segmented { background: #F0F4EF; }
.segmented .active { color: #17603D; box-shadow: 0 1px 3px rgba(23, 32, 51, .10); }

/* Forms and workflows -------------------------------------------------- */
.input,
.select,
.textarea,
.country-trigger {
  border-color: var(--border-strong);
}

.input:focus,
.select:focus,
.textarea:focus,
.country-trigger:focus {
  border-color: #62D59E;
  box-shadow: var(--focus-ring);
}

.checkbox input { accent-color: var(--primary); }

.country-options button:hover,
.country-options button[aria-selected="true"],
.settings-nav a.active {
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.filter-chip {
  border: 1px solid #CDEFD9;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.result-capabilities .icon,
.check-security .icon { color: var(--primary-dark); }

.type-option input:checked + label,
.policy-card input:checked + label {
  border-color: #60D49C;
  background: var(--primary-soft);
  color: var(--primary-dark);
  box-shadow: 0 0 0 2px rgba(32, 201, 120, .08);
}

.upload-zone:hover,
.upload-zone.dragging {
  border-color: #60D49C;
  background: var(--primary-subtle);
}

.step.active::before {
  border-color: var(--primary);
  background: var(--primary);
}

.profile-summary { border-top-color: var(--accent); }
.api-token-box button { color: var(--primary-dark); }

.drawer-hero {
  border-color: #D9E8DA;
  background: linear-gradient(135deg, #F5FCF8, #FFFBE9);
}

.inline-alert {
  border-color: #CDEFD9;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.error-code { color: #D7E9DB; }

/* Data tables ---------------------------------------------------------- */
.table-card {
  position: relative;
  border-top: 3px solid var(--primary);
}

.table-card::after {
  position: absolute;
  top: -3px;
  right: 0;
  width: 96px;
  height: 3px;
  background: var(--accent);
  content: "";
}

.data-table th {
  border-bottom-color: #DDE5DA;
  background: #F5F8F4;
  color: #607064;
}

.data-table td { border-bottom-color: #EBF0E9; }
.data-table tbody tr:hover { background: #FFFCEF; }

.status-queued,
.status-uploaded,
.status-mapping,
.status-preview {
  color: #0B7D49;
  background: var(--primary-soft);
}

.status-duplicate,
.status-warning,
.status-processing,
.status-flagged,
.status-needs-review {
  color: #8A6500;
  background: var(--accent-soft);
}

.page-btn:hover { background: #FFF8D9; }
.page-btn.active { background: var(--primary); color: #FFFFFF; }

.dropdown-menu a:hover,
.dropdown-menu button:hover { background: #FFFCEE; }

/* Authentication ------------------------------------------------------ */
.auth-page {
  min-height: 100vh;
  background: #F5F8F3;
}

.auth-layout {
  min-height: 100vh;
  grid-template-columns: minmax(560px, 1.08fr) minmax(460px, .92fr);
  background: #F5F8F3;
}

.auth-brand-panel {
  position: relative;
  overflow: hidden;
  padding: 42px clamp(48px, 5vw, 82px);
  border-right: 1px solid #DCE5D9;
  background:
    radial-gradient(circle at 88% 14%, rgba(255, 201, 40, .30), transparent 26%),
    radial-gradient(circle at 12% 88%, rgba(32, 201, 120, .18), transparent 31%),
    linear-gradient(140deg, #FBFDF9 0%, #EFF9F3 55%, #FFF9DE 100%);
}

.auth-brand-panel::before {
  height: 5px;
  background: linear-gradient(90deg, var(--accent) 0 36%, var(--primary) 36% 100%);
}

.auth-brand-panel::after {
  position: absolute;
  right: -170px;
  bottom: -210px;
  display: block;
  width: 520px;
  height: 520px;
  border: 1px solid rgba(32, 201, 120, .18);
  border-radius: 50%;
  box-shadow:
    0 0 0 52px rgba(255, 255, 255, .20),
    0 0 0 104px rgba(255, 201, 40, .06);
  content: "";
}

.auth-brand-panel .brand-logo-frame {
  width: 48px;
  height: 48px;
  flex-basis: 48px;
}

.auth-brand-panel .brand-word { font-size: 19px; }
.auth-brand-panel .brand-subtitle { color: #718073; font-size: 12px; }

.auth-brand-copy {
  max-width: 620px;
  margin: auto 0 34px;
}

.eyebrow-light {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary-dark);
}

.eyebrow-light::before {
  width: 24px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
  content: "";
}

.auth-brand-copy h1 {
  max-width: 620px;
  margin: 20px 0 20px;
  color: #12251B;
  font-size: clamp(42px, 4vw, 62px);
  font-weight: 720;
  line-height: 1.09;
  letter-spacing: -2.4px;
}

.auth-highlight {
  position: relative;
  z-index: 1;
  color: #0A7E49;
  white-space: nowrap;
}

.auth-highlight::after {
  position: absolute;
  z-index: -1;
  right: -3px;
  bottom: 4px;
  left: -3px;
  height: 10px;
  border-radius: 3px;
  background: rgba(255, 201, 40, .72);
  content: "";
}

.auth-brand-copy p {
  max-width: 560px;
  color: #53665A;
  font-size: 14px;
  line-height: 1.85;
}

.auth-assurance {
  display: grid;
  max-width: 650px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin-top: 30px;
  padding: 0;
  border: 0;
  background: transparent;
}

.auth-assurance > div {
  display: block;
  min-height: 132px;
  padding: 17px;
  border: 1px solid rgba(210, 222, 207, .92);
  border-radius: 13px;
  background: rgba(255, 255, 255, .76);
  box-shadow: 0 10px 30px rgba(23, 32, 51, .045);
  backdrop-filter: blur(8px);
}

.auth-assurance > div > span,
.auth-assurance > div:nth-child(2) > span,
.auth-assurance > div:nth-child(3) > span {
  width: 38px;
  height: 38px;
  margin-bottom: 13px;
  border-radius: 9px;
  background: var(--primary-soft);
  color: var(--primary-dark);
}

.auth-assurance > div:nth-child(2) > span {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.auth-assurance > div:nth-child(3) > span {
  background: #EDF8F6;
  color: #147C78;
}

.auth-assurance strong { color: #24352A; font-size: 13px; }
.auth-assurance small { color: #758279; font-size: 11.5px; line-height: 1.55; }
.auth-footnote { color: #66756A; }

.auth-form-panel {
  position: relative;
  padding: 58px;
  background:
    linear-gradient(rgba(32, 201, 120, .025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 201, 120, .025) 1px, transparent 1px),
    #F8FAF7;
  background-size: 32px 32px;
}

.auth-form-panel::before {
  position: absolute;
  top: 0;
  right: 0;
  width: 128px;
  height: 5px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  content: "";
}

.auth-form-wrap {
  width: min(440px, 100%);
  padding: 38px;
  border: 1px solid #DFE7DC;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 24px 70px rgba(23, 32, 51, .105);
}

.auth-form-head { margin-bottom: 28px; }
.auth-form-head h2 { color: #15251C; font-size: 28px; }
.auth-form-head p { color: #657268; }

.auth-form .input {
  height: 46px;
  border-radius: 9px;
  background: #FBFCFA;
}

.auth-form .input:focus { background: #FFFFFF; }

.auth-form .btn-primary {
  position: relative;
  border-radius: 9px;
  box-shadow: 0 8px 20px rgba(20, 174, 101, .22);
}

.auth-form .btn-primary::after {
  position: absolute;
  right: 16px;
  width: 18px;
  height: 3px;
  border-radius: 99px;
  background: var(--accent);
  content: "";
}

.auth-security-note {
  border-top-color: #E7ECE4;
  color: #849087;
}

.auth-security-note .icon { color: var(--primary-dark); }
.auth-support { color: #738077; }
.auth-copyright { color: #89958C; }
.auth-mobile-brand { display: none; }

@media (max-width: 1260px) {
  .auth-layout { grid-template-columns: minmax(500px, 1fr) minmax(430px, .88fr); }
  .auth-assurance { grid-template-columns: 1fr; max-width: 520px; }
  .auth-assurance > div {
    display: grid;
    min-height: 72px;
    grid-template-columns: 38px 1fr;
    align-items: center;
    gap: 12px;
    padding: 13px 15px;
  }
  .auth-assurance > div > span,
  .auth-assurance > div:nth-child(2) > span,
  .auth-assurance > div:nth-child(3) > span { margin-bottom: 0; }
}

@media (max-width: 1100px) and (min-width: 769px) {
  .nav-item.active::after { display: none; }
}

@media (max-width: 900px) {
  .auth-layout { grid-template-columns: minmax(400px, .86fr) minmax(420px, 1fr); }
  .auth-brand-panel { padding: 40px; }
  .auth-brand-copy h1 { font-size: 40px; }
  .auth-assurance { display: none; }
}

@media (max-width: 768px) {
  .sidebar { overflow: visible; }
  .nav-item.active::after { display: block; }
  .auth-layout { display: block; }
  .auth-brand-panel { display: none; }
  .auth-form-panel {
    min-height: 100vh;
    justify-content: flex-start;
    padding: 28px 20px 36px;
    background: linear-gradient(160deg, #F1FAF5, #FFFBE8);
  }
  .auth-mobile-brand {
    display: flex;
    width: min(440px, 100%);
    align-items: center;
    gap: 11px;
    margin: 0 auto 22px;
    color: #17251C;
  }
  .auth-mobile-brand .brand-logo-frame {
    width: 43px;
    height: 43px;
    flex-basis: 43px;
  }
  .auth-mobile-brand strong,
  .auth-mobile-brand small { display: block; }
  .auth-mobile-brand strong { font-size: 17px; }
  .auth-mobile-brand small { margin-top: 3px; color: #718073; font-size: 11px; }
  .auth-form-wrap {
    margin: 0 auto;
    padding: 30px 24px;
    border-radius: 15px;
    box-shadow: 0 18px 50px rgba(23, 32, 51, .09);
  }
  .auth-copyright { position: static; margin: 24px 0 0; text-align: center; }
}

@media (max-width: 520px) {
  .auth-form-head h2 { font-size: 24px; }
  .auth-form-wrap { padding: 26px 20px; }
}
