:root {
  --navy-950: #102630;
  --navy-900: #193541;
  --navy-800: #2b4a57;
  --blue-700: #9d7b4d;
  --blue-600: #c5a87c;
  --blue-100: #f1e9dd;
  --blue-50: #fbf8f3;
  --slate-900: #17243a;
  --slate-700: #42526b;
  --slate-500: #718096;
  --slate-300: #cbd5e1;
  --slate-200: #e3e9f1;
  --slate-100: #f1f5f9;
  --slate-50: #f7f9fc;
  --white: #ffffff;
  --green: #0f9f6e;
  --green-soft: #e5f8f1;
  --amber: #d67a0a;
  --amber-soft: #fff3dc;
  --red: #c8394a;
  --red-soft: #ffeaed;
  --shadow-sm: 0 2px 8px rgba(20, 42, 72, 0.06);
  --shadow-md: 0 16px 40px rgba(11, 29, 51, 0.12);
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 22px;
}

* { box-sizing: border-box; }
html { min-height: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--slate-900);
  background: var(--slate-50);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; }
button { cursor: pointer; }
svg { display: block; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.is-hidden { display: none !important; }

.loading-bar {
  position: fixed; inset: 0 auto auto 0; z-index: 1000; height: 3px; width: 0;
  opacity: 0; background: linear-gradient(90deg, #c5a87c, #e4d1af); transition: width .3s, opacity .2s;
}
.loading-bar.is-loading { width: 72%; opacity: 1; }
.loading-bar.is-done { width: 100%; opacity: 0; }

.access-screen {
  position: relative; display: grid; min-height: 100vh; place-items: center; overflow: hidden;
  padding: 40px 24px; background: linear-gradient(142deg, #0e252e 0%, #1a3a46 55%, #345461 100%);
}
.access-screen::before {
  content: ""; position: absolute; inset: 0; opacity: .23;
  background-image: linear-gradient(rgba(255,255,255,.045) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.045) 1px, transparent 1px);
  background-size: 42px 42px; mask-image: linear-gradient(to bottom, black, transparent 88%);
}
.access-decoration { position: absolute; border-radius: 999px; filter: blur(2px); }
.access-decoration-one { width: 430px; height: 430px; right: -170px; top: -140px; background: radial-gradient(circle, rgba(197,168,124,.34), transparent 68%); }
.access-decoration-two { width: 360px; height: 360px; left: -140px; bottom: -140px; background: radial-gradient(circle, rgba(121,157,164,.22), transparent 68%); }
.access-card {
  position: relative; z-index: 1; width: min(100%, 500px); padding: 48px; border: 1px solid rgba(255,255,255,.12);
  border-radius: 26px; color: white; background: rgba(10, 28, 50, .72); box-shadow: 0 30px 80px rgba(0,0,0,.35); backdrop-filter: blur(18px);
}
.brand-mark { display: grid; flex: 0 0 auto; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: #17313c; background: linear-gradient(145deg, #d8bd93, #b08e5f); }
.brand-mark svg { width: 28px; height: 28px; stroke-width: 2.2; }
.brand-mark svg > path:first-child { fill: rgba(255,255,255,.08); }
.brand-mark .brand-line { stroke: #17313c; }
.brand-mark-large { width: 54px; height: 54px; margin-bottom: 28px; border-radius: 15px; }
.brand-mark-large svg { width: 36px; height: 36px; }
.eyebrow { display: block; margin-bottom: 9px; color: var(--blue-600); font-size: 11px; font-weight: 800; letter-spacing: .13em; }
.access-card .eyebrow { color: #d9c49f; }
.access-card h1 { margin: 0; font-size: clamp(32px, 6vw, 45px); line-height: 1.1; letter-spacing: -.04em; }
.access-card h1 span { color: var(--blue-600); }
.access-copy { max-width: 390px; margin: 18px 0 30px; color: #bac7d8; line-height: 1.65; }
.access-form label, .standard-form label, .inline-form label { color: inherit; font-size: 13px; font-weight: 700; }
.access-form > input { margin-top: 9px; color: white; border-color: rgba(255,255,255,.17); background: rgba(255,255,255,.075); }
.access-form .password-label { display: block; margin-top: 15px; }
.secret-field { position: relative; margin-top: 9px; }
input, select {
  width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--slate-200); border-radius: var(--radius-sm); outline: none;
  color: var(--slate-900); background: white; transition: border-color .2s, box-shadow .2s;
}
input:focus, select:focus { border-color: var(--blue-600); box-shadow: 0 0 0 4px rgba(197,168,124,.14); }
.access-form input { padding-right: 48px; color: white; border-color: rgba(255,255,255,.17); background: rgba(255,255,255,.075); }
.access-form input::placeholder { color: #8292a8; }
.icon-button { position: absolute; top: 4px; right: 5px; width: 40px; height: 40px; padding: 9px; border: 0; color: #95a5ba; background: transparent; }
.full-button { width: 100%; margin-top: 14px; }
.primary-button, .secondary-button, .light-button {
  display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; padding: 0 18px; border-radius: 10px;
  border: 1px solid transparent; font-weight: 750; transition: transform .16s, background .16s, box-shadow .16s;
}
.primary-button { color: #18303a; background: var(--blue-600); box-shadow: 0 8px 18px rgba(111,84,47,.2); }
.primary-button:hover { transform: translateY(-1px); background: var(--blue-700); }
.primary-button:disabled { cursor: wait; transform: none; opacity: .62; }
.primary-button svg, .light-button svg { width: 18px; height: 18px; }
.secondary-button { color: var(--slate-700); border-color: var(--slate-200); background: white; }
.secondary-button:hover { background: var(--slate-50); }
.compact-button { min-height: 36px; padding: 0 13px; font-size: 13px; }
.form-message { min-height: 20px; margin: 10px 0 0; color: #ff9da8; font-size: 13px; text-align: center; }
.security-note { display: flex; align-items: center; gap: 9px; margin-top: 23px; color: #8fa0b6; font-size: 12px; }
.security-note svg { width: 18px; height: 18px; }
.access-footer { position: absolute; z-index: 1; bottom: 20px; margin: 0; color: #74879f; font-size: 12px; }

.app-shell { min-height: 100vh; }
.sidebar {
  position: fixed; z-index: 50; inset: 0 auto 0 0; display: flex; width: 250px; flex-direction: column; padding: 25px 18px 20px;
  color: #d4dfec; background: var(--navy-950); box-shadow: 10px 0 40px rgba(7,20,38,.08);
}
.brand { display: flex; align-items: center; gap: 12px; padding: 0 6px; color: white; text-decoration: none; font-size: 19px; }
.brand > span:last-child { display: flex; flex-wrap: wrap; gap: 4px; align-items: baseline; }
.brand small { flex-basis: 100%; margin-top: -1px; color: #778aa1; font-size: 9px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.main-nav { display: grid; gap: 5px; margin-top: 48px; }
.nav-label { padding: 0 13px 8px; color: #5d718a; font-size: 10px; font-weight: 800; letter-spacing: .14em; }
.nav-item {
  display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px 13px; border: 0; border-radius: 10px;
  color: #91a2b7; background: transparent; font-size: 14px; font-weight: 650; text-align: left; transition: color .18s, background .18s;
}
.nav-item svg { width: 20px; height: 20px; }
.nav-item:hover { color: white; background: rgba(255,255,255,.045); }
.nav-item.is-active { color: white; background: linear-gradient(90deg, rgba(197,168,124,.22), rgba(197,168,124,.06)); box-shadow: inset 3px 0 var(--blue-600); }
.sidebar-footer { display: grid; gap: 18px; margin-top: auto; padding: 0 7px; }
.sidebar-footer a { display: flex; align-items: center; gap: 9px; color: #8193a9; font-size: 12px; text-decoration: none; }
.sidebar-footer a:hover { color: white; }
.sidebar-footer svg { width: 18px; height: 18px; }
.environment-chip { display: flex; align-items: center; gap: 7px; color: #71849a; font-size: 11px; }
.environment-chip span, .api-status span { width: 8px; height: 8px; border-radius: 50%; background: #24c18a; box-shadow: 0 0 0 4px rgba(36,193,138,.1); }

.main-content { min-height: 100vh; margin-left: 250px; }
.topbar {
  position: sticky; z-index: 30; top: 0; display: flex; height: 78px; align-items: center; gap: 14px; padding: 0 34px;
  border-bottom: 1px solid rgba(212,221,232,.8); background: rgba(255,255,255,.91); backdrop-filter: blur(14px);
}
.breadcrumb { color: var(--slate-500); font-size: 11px; font-weight: 650; }
.topbar h2 { margin: 2px 0 0; font-size: 20px; letter-spacing: -.02em; }
.topbar-actions { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.user-chip { display: flex; align-items: center; gap: 8px; color: var(--slate-700); font-size: 12px; font-weight: 700; }
.user-avatar { display: grid; width: 31px; height: 31px; place-items: center; border-radius: 50%; color: #17313c; background: var(--blue-600); font-size: 11px; }
.api-status { display: flex; align-items: center; gap: 8px; color: var(--slate-500); font-size: 12px; }
.api-status.warn { color: #9a661d; }
.api-status.warn span { background: #d79a35; box-shadow: 0 0 0 4px rgba(215,154,53,.14); }
.menu-button { display: none; width: 40px; height: 40px; padding: 9px; border: 1px solid var(--slate-200); border-radius: 9px; color: var(--slate-700); background: white; }
.page-container { padding: 32px 34px 60px; }
.view { display: none; animation: fade-in .25s ease; }
.view.is-active { display: block; }
@keyframes fade-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

.hero-panel {
  position: relative; display: flex; min-height: 184px; align-items: center; justify-content: space-between; gap: 30px; overflow: hidden;
  padding: 35px 40px; border-radius: var(--radius-lg); color: white; background: linear-gradient(120deg, #17313c, #294b58 70%, #426572);
  box-shadow: 0 18px 42px rgba(22,52,64,.2);
}
.hero-panel::after { content: ""; position: absolute; width: 280px; height: 280px; right: -40px; border: 48px solid rgba(255,255,255,.06); border-radius: 50%; }
.hero-panel > * { position: relative; z-index: 1; }
.hero-panel .eyebrow { color: #d9c49f; }
.hero-panel h3 { margin: 0; font-size: clamp(25px, 3vw, 34px); letter-spacing: -.035em; }
.hero-panel p { max-width: 620px; margin: 12px 0 0; color: #d7e1e5; line-height: 1.55; }
.light-button { flex: 0 0 auto; color: #18303a; background: var(--blue-600); box-shadow: 0 8px 24px rgba(0,0,0,.13); }
.light-button:hover { transform: translateY(-1px); }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 22px 0; }
.kpi-card { display: grid; min-height: 170px; align-content: start; padding: 21px; border: 1px solid var(--slate-200); border-radius: var(--radius-md); background: white; box-shadow: var(--shadow-sm); }
.kpi-icon { display: grid; width: 38px; height: 38px; margin-bottom: 17px; place-items: center; border-radius: 10px; }
.kpi-icon svg { width: 20px; height: 20px; }
.kpi-icon.blue { color: #2860d8; background: var(--blue-100); }
.kpi-icon.indigo { color: #6a50c8; background: #eee9ff; }
.kpi-icon.green { color: var(--green); background: var(--green-soft); }
.kpi-icon.amber { color: var(--amber); background: var(--amber-soft); }
.kpi-card > span { color: var(--slate-500); font-size: 12px; font-weight: 650; }
.kpi-card strong { margin-top: 3px; font-size: 28px; letter-spacing: -.04em; }
.kpi-card small { margin-top: 5px; color: #91a0b2; font-size: 11px; }
.alert-card { background: linear-gradient(145deg, white, #fffcf5); }

.content-card { border: 1px solid var(--slate-200); border-radius: var(--radius-md); background: white; box-shadow: var(--shadow-sm); }
.section-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; padding: 23px 25px 18px; }
.section-heading h3 { margin: 0; font-size: 17px; letter-spacing: -.02em; }
.section-heading p { margin: 6px 0 0; color: var(--slate-500); font-size: 12px; }
.section-heading .eyebrow { margin-bottom: 5px; }
.text-button { padding: 5px 0; border: 0; color: var(--blue-600); background: none; font-size: 12px; font-weight: 750; }
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
th { padding: 12px 24px; color: var(--slate-500); background: var(--slate-50); font-size: 10px; letter-spacing: .08em; text-align: left; text-transform: uppercase; }
td { padding: 15px 24px; border-top: 1px solid var(--slate-100); color: var(--slate-700); font-size: 13px; }
td strong { display: block; color: var(--slate-900); font-size: 13px; }
td small { color: var(--slate-500); }
.empty-cell { padding: 38px; color: var(--slate-500); text-align: center; }
.status-badge { display: inline-flex; align-items: center; gap: 6px; padding: 5px 9px; border-radius: 999px; font-size: 10px; font-weight: 800; text-transform: uppercase; }
.status-badge.good { color: #087452; background: var(--green-soft); }
.status-badge.warn { color: #a15c00; background: var(--amber-soft); }
.status-badge.danger { color: #a82838; background: var(--red-soft); }

.page-heading { display: flex; align-items: end; justify-content: space-between; margin-bottom: 24px; }
.page-heading h3 { margin: 0; font-size: 27px; letter-spacing: -.035em; }
.page-heading p { margin: 7px 0 0; color: var(--slate-500); font-size: 14px; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(330px, .9fr); gap: 20px; align-items: start; }
.form-card { padding-bottom: 25px; }
.standard-form { padding: 0 25px; }
.field-grid { display: grid; gap: 18px; margin-bottom: 22px; }
.two-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.three-columns { grid-template-columns: 1.5fr .7fr .7fr; }
.standard-form label { display: grid; gap: 8px; color: var(--slate-700); }
.standard-form label > span { margin-left: 4px; color: #9aa7b7; font-size: 10px; font-weight: 500; }
.wide-field { grid-column: span 1; }
.cards-list { display: grid; gap: 10px; max-height: 590px; overflow: auto; padding: 0 20px 20px; }
.card-row { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid var(--slate-100); border-radius: 12px; background: var(--slate-50); }
.card-visual { display: grid; width: 45px; height: 33px; place-items: center; border-radius: 7px; color: white; background: linear-gradient(135deg, #18313c, #4b6974); font-size: 8px; font-weight: 800; letter-spacing: .06em; }
.card-row-content { min-width: 0; }
.card-row-content strong, .card-row-content span { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.card-row-content strong { font-size: 13px; }
.card-row-content span { margin-top: 3px; color: var(--slate-500); font-size: 11px; }
.card-row > small { margin-left: auto; color: var(--slate-500); font-weight: 700; }
.empty-panel { padding: 38px 18px; color: var(--slate-500); text-align: center; font-size: 13px; }

.upload-layout { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 20px; align-items: start; }
.upload-layout .form-card { padding-top: 25px; }
.file-drop { display: grid !important; min-height: 210px; place-items: center; align-content: center; gap: 9px !important; margin: 4px 0 20px; border: 1.5px dashed #aebddb; border-radius: 14px; color: var(--slate-700) !important; background: var(--blue-50); text-align: center; cursor: pointer; transition: border .2s, background .2s; }
.file-drop:hover, .file-drop.is-dragging { border-color: var(--blue-600); background: #edf3ff; }
.file-drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.file-drop strong { font-size: 14px; }
.file-drop small { color: var(--slate-500); font-weight: 500; }
.upload-icon { display: grid; width: 48px; height: 48px; place-items: center; border-radius: 14px; color: var(--blue-600); background: white; box-shadow: var(--shadow-sm); }
.upload-icon svg { width: 24px; height: 24px; }
.form-notice { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 20px; padding: 12px 14px; border-radius: 10px; color: #526681; background: var(--slate-50); font-size: 11px; line-height: 1.5; }
.form-notice svg { flex: 0 0 auto; width: 18px; height: 18px; color: var(--blue-600); }
.process-steps { padding: 25px; border-radius: var(--radius-md); color: white; background: var(--navy-900); box-shadow: var(--shadow-md); }
.process-steps h4 { margin: 0 0 22px; font-size: 15px; }
.process-steps ol { display: grid; gap: 23px; margin: 0; padding: 0; list-style: none; }
.process-steps li { display: flex; gap: 13px; }
.process-steps li > span { display: grid; flex: 0 0 auto; width: 27px; height: 27px; place-items: center; border: 1px solid rgba(255,255,255,.2); border-radius: 50%; color: #a9c2f8; font-size: 11px; }
.process-steps strong, .process-steps small { display: block; }
.process-steps strong { font-size: 12px; }
.process-steps small { margin-top: 4px; color: #8fa3bc; font-size: 10px; line-height: 1.45; }
.confirmation-card { margin-top: 20px; padding-bottom: 26px; border-top: 3px solid var(--blue-600); }
.match-notice { margin: 0 0 20px; padding: 14px 16px; border: 1px solid #dfcfb4; border-radius: 11px; color: #654f2f; background: var(--blue-50); font-size: 12px; line-height: 1.5; }
.match-notice strong { display: block; margin-bottom: 3px; color: var(--navy-900); }
.replacement-box { margin: 4px 0 22px; padding: 18px; border: 1px solid var(--slate-200); border-radius: 13px; }
.replacement-box legend { padding: 0 8px; color: var(--slate-700); font-size: 13px; font-weight: 750; }
.radio-row { display: flex; gap: 24px; margin-bottom: 4px; }
.radio-row label { display: flex; grid-template-columns: auto 1fr; gap: 8px; align-items: center; font-size: 13px; }
.radio-row input { width: 16px; height: 16px; }
.replacement-box .field-grid { margin: 18px 0 0; }
.confirmation-actions { display: flex; justify-content: flex-end; gap: 12px; }

.report-search-card { padding: 22px 25px; }
.inline-form { display: grid; grid-template-columns: auto minmax(170px, 360px) auto; gap: 13px; align-items: center; }
.inline-form input { height: 44px; }
.result-area { margin-top: 22px; animation: fade-in .25s ease; }
.report-header { display: flex; align-items: center; justify-content: space-between; gap: 18px; margin-bottom: 15px; padding: 24px; border-radius: 15px; color: white; background: linear-gradient(120deg, var(--navy-900), #426572); }
.report-header h3 { margin: 0; }
.report-header p { margin: 6px 0 0; color: #bfd0e7; font-size: 12px; }
.report-total { font-size: 25px; font-weight: 800; }
.report-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px; }
.report-section { padding: 22px; border: 1px solid var(--slate-200); border-radius: 14px; background: white; box-shadow: var(--shadow-sm); }
.report-section.full { grid-column: 1 / -1; }
.report-section h4 { margin: 0 0 15px; font-size: 14px; }
.report-section p { margin: 0; color: var(--slate-700); font-size: 13px; line-height: 1.6; }
.alert-list { display: grid; gap: 9px; }
.alert-item { padding: 12px 13px; border-left: 3px solid var(--amber); border-radius: 8px; background: #fffaf0; }
.alert-item.critical { border-color: var(--red); background: #fff4f5; }
.alert-item strong { display: block; font-size: 11px; }
.alert-item span { display: block; margin-top: 4px; color: var(--slate-700); font-size: 12px; line-height: 1.45; }
.mini-metrics { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.mini-metric { padding: 13px; border-radius: 10px; background: var(--slate-50); }
.mini-metric span, .mini-metric strong { display: block; }
.mini-metric span { color: var(--slate-500); font-size: 10px; }
.mini-metric strong { margin-top: 5px; font-size: 15px; }
.toast { position: fixed; z-index: 200; right: 24px; bottom: 24px; max-width: 360px; padding: 13px 17px; border-radius: 11px; color: white; background: var(--navy-900); box-shadow: var(--shadow-md); font-size: 13px; transform: translateY(25px); opacity: 0; pointer-events: none; transition: .25s; }
.toast.is-visible { transform: none; opacity: 1; }
.toast.error { background: #9d2636; }
.toast.success { background: #087452; }

@media (max-width: 1100px) {
  .kpi-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .split-layout, .upload-layout { grid-template-columns: 1fr; }
  .process-steps ol { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 820px) {
  .sidebar { transform: translateX(-100%); transition: transform .25s; }
  .sidebar.is-open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-button { display: block; }
  .topbar { padding: 0 18px; }
  .page-container { padding: 24px 18px 45px; }
  .api-status { display: none; }
  .hero-panel { align-items: flex-start; flex-direction: column; padding: 30px; }
  .process-steps ol { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .access-card { padding: 34px 25px; }
  .kpi-grid, .two-columns, .three-columns, .report-grid { grid-template-columns: 1fr; }
  .kpi-card { min-height: 150px; }
  .hero-panel { min-height: 260px; }
  .page-heading h3 { font-size: 23px; }
  .field-grid .wide-field { grid-column: auto; }
  .inline-form { grid-template-columns: 1fr; }
  .mini-metrics { grid-template-columns: 1fr; }
  .report-header { align-items: flex-start; flex-direction: column; }
  .topbar-actions { gap: 8px; }
  .topbar h2 { font-size: 17px; }
}
