:root {
  --navy: #0c2d48;
  --navy-2: #133f61;
  --blue: #1d6fa5;
  --cyan: #3bb8c3;
  --green: #1f9d78;
  --amber: #d89024;
  --red: #c84a50;
  --ink: #18242f;
  --muted: #677786;
  --line: #dce4e9;
  --soft: #f2f6f8;
  --white: #ffffff;
  --shadow: 0 14px 40px rgba(19, 63, 97, 0.1);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  color: var(--ink);
  background: #eef3f6;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.58;
}

.hidden {
  display: none !important;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--blue);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.13em;
  text-transform: uppercase;
}

.eyebrow.light {
  color: #8edfe4;
}

.muted {
  color: var(--muted);
}

.login-screen {
  display: grid;
  min-height: 100vh;
  grid-template-columns: minmax(420px, 1.1fr) minmax(420px, 0.9fr);
}

.login-brand-panel {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  padding: 60px;
  color: white;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 184, 195, 0.3), transparent 35%),
    linear-gradient(145deg, #09263e 0%, #124867 65%, #176b79 100%);
}

.login-brand-panel::before,
.login-brand-panel::after {
  position: absolute;
  width: 430px;
  height: 430px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 50%;
  content: "";
}

.login-brand-panel::before {
  right: -180px;
  top: -160px;
}

.login-brand-panel::after {
  bottom: -250px;
  left: -110px;
}

.login-brand-content {
  z-index: 1;
  max-width: 650px;
}

.login-company-logo {
  display: block;
  width: min(250px, 60vw);
  margin-bottom: 34px;
  border-radius: 18px;
  box-shadow: 0 22px 55px rgba(0, 0, 0, 0.2);
}

.login-brand-content h1 {
  max-width: 600px;
  margin: 12px 0 18px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(45px, 6vw, 78px);
  font-weight: 500;
  letter-spacing: -0.04em;
  line-height: 0.98;
}

.login-brand-content > p:not(.eyebrow) {
  max-width: 570px;
  color: #d9ebf1;
  font-size: 18px;
  line-height: 1.65;
}

.logo-mark {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: linear-gradient(145deg, var(--cyan), var(--blue));
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.03em;
  box-shadow: 0 8px 20px rgba(7, 38, 60, 0.25);
}

.logo-mark-large {
  width: 72px;
  height: 72px;
  margin-bottom: 34px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 23px;
}

.login-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 9px;
  margin-top: 40px;
}

.login-flow span {
  padding: 9px 13px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.login-flow i {
  color: #8edfe4;
}

.login-form-panel {
  display: grid;
  place-items: center;
  padding: 45px;
  background: #f5f8fa;
}

.login-card {
  width: min(440px, 100%);
  padding: 45px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: white;
  box-shadow: var(--shadow);
}

.login-card h2 {
  margin: 0;
  font-size: 34px;
}

.login-card > .muted {
  margin: 8px 0 30px;
}

label {
  display: grid;
  gap: 7px;
  color: #334452;
  font-size: 12px;
  font-weight: 750;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cad6dd;
  border-radius: 10px;
  outline: none;
  background: white;
  color: var(--ink);
  transition: 0.18s ease;
}

input,
select {
  min-height: 42px;
  padding: 0 12px;
}

textarea {
  min-height: 100px;
  padding: 11px 12px;
  line-height: 1.5;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(29, 111, 165, 0.12);
}

.login-card label + label {
  margin-top: 18px;
}

.login-card .btn {
  margin-top: 24px;
}

.login-hint {
  margin: 18px 0 0;
  color: var(--muted);
  font-size: 12px;
  text-align: center;
}

.product-image-preview {
  display: grid;
  min-height: 150px;
  place-items: center;
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 12px;
  background: #f7fafb;
}

.product-image-preview img {
  max-width: 240px;
  max-height: 180px;
  object-fit: contain;
}

.app-shell {
  display: grid;
  min-height: 100vh;
  grid-template-columns: 250px 1fr;
}

.sidebar {
  position: sticky;
  top: 0;
  display: flex;
  height: 100vh;
  flex-direction: column;
  padding: 22px 16px;
  color: #e7f0f5;
  background:
    linear-gradient(rgba(255, 255, 255, 0.02), rgba(255, 255, 255, 0)),
    var(--navy);
}

.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 2px 8px 25px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-logo {
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  border-radius: 10px;
  object-fit: contain;
  background: white;
}

.sidebar-brand strong,
.sidebar-brand span {
  display: block;
}

.sidebar-brand strong {
  font-size: 14px;
}

.sidebar-brand span {
  margin-top: 2px;
  color: #99b3c5;
  font-size: 11px;
}

.main-nav {
  display: grid;
  gap: 5px;
  margin-top: 22px;
}

.main-nav button {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 43px;
  padding: 0 12px;
  border: 0;
  border-radius: 10px;
  color: #bbccd8;
  background: transparent;
  font-size: 13px;
  font-weight: 700;
  text-align: left;
}

.main-nav button:hover {
  color: white;
  background: rgba(255, 255, 255, 0.07);
}

.main-nav button.active {
  color: white;
  background: linear-gradient(90deg, rgba(59, 184, 195, 0.25), rgba(59, 184, 195, 0.08));
  box-shadow: inset 3px 0 var(--cyan);
}

.nav-icon {
  width: 20px;
  color: #65ccd3;
  font-size: 18px;
  text-align: center;
}

.nav-badge {
  margin-left: auto;
  padding: 2px 7px;
  border-radius: 999px;
  color: white;
  background: #d66d3f;
  font-size: 10px;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: auto;
  padding: 15px 10px 3px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.sidebar-footer strong,
.sidebar-footer small {
  display: block;
}

.sidebar-footer strong {
  font-size: 11px;
}

.sidebar-footer small {
  margin-top: 2px;
  color: #8eabba;
  font-size: 9px;
}

.live-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #63d5a8;
  box-shadow: 0 0 0 4px rgba(99, 213, 168, 0.12);
}

.workspace {
  min-width: 0;
}

.topbar {
  position: sticky;
  z-index: 10;
  top: 0;
  display: flex;
  min-height: 86px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 30px;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(12px);
}

.topbar h1 {
  margin: 0;
  font-size: 23px;
  letter-spacing: -0.02em;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.security-alert-button {
  position: relative;
  display: flex;
  min-height: 50px;
  align-items: center;
  gap: 9px;
  padding: 6px 13px 6px 10px;
  border: 1px solid #efc5c8;
  border-radius: 12px;
  color: #8d3038;
  background: #fff6f6;
  text-align: left;
}

.security-alert-button:hover {
  border-color: #d98c93;
  background: #fdebed;
}

.security-alert-icon {
  font-size: 20px;
}

.security-alert-copy {
  display: grid;
  gap: 1px;
}

.security-alert-copy strong,
.security-alert-copy small {
  display: block;
}

.security-alert-copy strong {
  font-size: 11px;
}

.security-alert-copy small {
  color: #a66a70;
  font-size: 9px;
}

.security-alert-badge {
  display: grid;
  min-width: 22px;
  height: 22px;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  color: white;
  background: #bc3f49;
  font-size: 10px;
  font-weight: 900;
}

.user-chip {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 10px;
  padding: 6px 10px 6px 7px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
  text-align: left;
}

.user-chip > span:first-child {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 auto;
  place-items: center;
  border-radius: 9px;
  color: white;
  background: var(--navy-2);
  font-size: 13px;
  font-weight: 900;
}

.user-chip strong,
.user-chip small {
  display: block;
  max-width: 118px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-chip strong {
  font-size: 11px;
}

.user-chip small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 9px;
}

.user-chip i {
  margin-left: auto;
  color: var(--muted);
}

.main-content {
  padding: 28px 30px 50px;
}

.page-actions,
.section-heading,
.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.section-heading {
  align-items: flex-end;
  margin-bottom: 16px;
}

.section-heading h2,
.section-heading h3 {
  margin: 0;
}

.section-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.btn {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  font-size: 12px;
  font-weight: 800;
  transition: 0.15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn.primary {
  color: white;
  background: linear-gradient(135deg, var(--blue), #17557e);
  box-shadow: 0 7px 18px rgba(29, 111, 165, 0.2);
}

.btn.secondary {
  border-color: #c7d7df;
  color: var(--navy);
  background: white;
}

.btn.success {
  color: white;
  background: var(--green);
}

.btn.warning {
  color: white;
  background: var(--amber);
}

.btn.danger {
  color: white;
  background: var(--red);
}

.btn.ghost {
  color: var(--blue);
  background: #eaf4fa;
}

.btn.small {
  min-height: 31px;
  padding: 0 10px;
  font-size: 10px;
}

.btn.wide {
  width: 100%;
}

.icon-btn {
  width: 38px;
  height: 38px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: white;
}

.mobile-only {
  display: none;
}

.kpi-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.kpi-card {
  position: relative;
  overflow: hidden;
  min-height: 148px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 25px rgba(27, 62, 84, 0.05);
}

.dashboard-kpi {
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.dashboard-kpi:hover {
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
  box-shadow: 0 14px 32px rgba(27, 62, 84, 0.12);
  transform: translateY(-2px);
}

.dashboard-kpi:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent);
  outline-offset: 3px;
}

.kpi-card::after {
  position: absolute;
  right: -25px;
  bottom: -40px;
  width: 100px;
  height: 100px;
  border-radius: 50%;
  background: var(--tint, #eef7f8);
  content: "";
}

.kpi-icon {
  display: grid;
  width: 37px;
  height: 37px;
  place-items: center;
  border-radius: 10px;
  color: var(--accent, var(--blue));
  background: var(--tint, #eef7f8);
  font-weight: 900;
}

.kpi-card strong {
  display: block;
  margin-top: 20px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 29px;
  font-weight: 600;
}

.kpi-card p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, 0.7fr);
  gap: 18px;
  margin-top: 18px;
}

.dashboard-credit {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 20px;
  padding: 16px 8px 2px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 11px;
  text-align: center;
}

.dashboard-credit strong {
  color: var(--blue-dark);
  font-weight: 800;
}

.dashboard-credit-divider {
  color: var(--cyan);
  font-weight: 900;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: white;
  box-shadow: 0 8px 25px rgba(27, 62, 84, 0.04);
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid #e7edf1;
}

.panel-head h3 {
  margin: 0;
  font-size: 14px;
}

.panel-head p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 10px;
}

.panel-body {
  padding: 18px 20px;
}

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11px;
}

th,
td {
  padding: 12px 13px;
  border-bottom: 1px solid #e7edf1;
  text-align: left;
  vertical-align: middle;
}

th {
  color: #60717f;
  background: #f8fafb;
  font-size: 9px;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  white-space: nowrap;
}

tbody tr:hover {
  background: #f8fbfc;
}

td strong {
  display: block;
  color: #213340;
}

td small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.money {
  font-variant-numeric: tabular-nums;
  font-weight: 800;
  white-space: nowrap;
}

.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 9px;
  font-weight: 850;
  white-space: nowrap;
}

.status::before {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  content: "";
}

.status.draft {
  color: #697884;
  background: #edf1f3;
}

.status.pending {
  color: #b16d11;
  background: #fff1dc;
}

.status.approved,
.status.po {
  color: #197b5e;
  background: #e1f5ee;
}

.status.sent {
  color: #176c9a;
  background: #e3f2fa;
}

.status.lost,
.status.cancelled {
  color: #a83d43;
  background: #fae7e8;
}

.flow-list {
  display: grid;
  gap: 15px;
}

.flow-row {
  display: grid;
  grid-template-columns: 110px 1fr 28px;
  align-items: center;
  gap: 10px;
}

.flow-row-button {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid transparent;
  border-radius: 10px;
  appearance: none;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background 150ms ease, border-color 150ms ease, transform 150ms ease;
}

.flow-row-button:hover {
  border-color: #cfe0e8;
  background: #f5fafc;
  transform: translateX(2px);
}

.flow-row-button:focus-visible {
  outline: 3px solid rgba(31, 141, 174, 0.22);
  outline-offset: 2px;
}

.flow-row span {
  color: #435563;
  font-size: 10px;
  font-weight: 750;
}

.flow-row strong {
  font-size: 11px;
  text-align: right;
}

.detail-summary-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 16px;
  margin-top: 10px;
}

.detail-summary-line span {
  color: var(--muted);
  font-weight: 700;
}

.bar {
  overflow: hidden;
  height: 8px;
  border-radius: 999px;
  background: #e9eff2;
}

.bar i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.filter-bar {
  flex-wrap: wrap;
  margin-bottom: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}

.filter-group {
  display: flex;
  flex: 1;
  min-width: 250px;
  gap: 10px;
}

.filter-group input,
.filter-group select {
  min-height: 38px;
}

.import-progress {
  margin-top: 18px;
  padding: 16px;
  border: 1px solid #b9d8e9;
  border-radius: 14px;
  background: #f4fbff;
}

.import-progress-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.import-progress-head strong,
.import-progress-head small {
  display: block;
}

.import-progress-head small {
  margin-top: 4px;
  color: var(--muted);
}

.import-progress-track {
  overflow: hidden;
  height: 10px;
  margin-top: 13px;
  border-radius: 999px;
  background: #dceaf1;
}

.import-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
  transition: width 180ms ease;
}

.import-progress-summary {
  margin-top: 9px;
  color: var(--blue-dark);
  font-size: 11px;
  font-weight: 800;
}

.search-input {
  min-width: 230px;
}

.action-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.empty-state {
  padding: 55px 30px;
  color: var(--muted);
  text-align: center;
}

.empty-state strong {
  display: block;
  margin-bottom: 6px;
  color: var(--ink);
  font-size: 15px;
}

.form-page {
  display: grid;
  gap: 18px;
}

.form-section {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}

.form-section h3 {
  margin: 0 0 4px;
  font-size: 15px;
}

.form-section > p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 11px;
}

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

.form-grid .span-2 {
  grid-column: span 2;
}

.form-grid .span-3 {
  grid-column: span 3;
}

.form-grid .span-4 {
  grid-column: 1 / -1;
}

.customer-autocomplete {
  position: relative;
  display: grid;
  gap: 6px;
}

.customer-autocomplete > small {
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.customer-suggestion-menu {
  position: absolute;
  z-index: 60;
  top: 46px;
  right: 0;
  left: 0;
  display: none;
  max-height: 310px;
  overflow-y: auto;
  border: 1px solid #bfd1db;
  border-radius: 11px;
  background: white;
  box-shadow: 0 18px 40px rgba(22, 53, 70, 0.2);
}

.customer-suggestion-menu.open {
  display: block;
}

.customer-suggestion-option {
  display: block;
  width: 100%;
  padding: 11px 13px;
  border: 0;
  border-bottom: 1px solid #e4ecef;
  color: var(--ink);
  text-align: left;
  background: white;
}

.customer-suggestion-option:hover,
.customer-suggestion-option:focus {
  background: #edf7fb;
}

.customer-suggestion-option strong,
.customer-suggestion-option small {
  display: block;
}

.customer-suggestion-option small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 10px;
  font-weight: 600;
}

.customer-suggestion-empty {
  padding: 13px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 600;
}

.inline-check {
  display: flex;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.inline-check input {
  width: auto;
  min-height: auto;
}

.item-toolbar {
  display: flex;
  align-items: end;
  gap: 10px;
  margin-bottom: 14px;
}

.item-toolbar label {
  flex: 1;
}

.item-table input,
.item-table select {
  min-width: 85px;
  min-height: 34px;
  padding: 0 8px;
  border-radius: 7px;
  font-size: 10px;
}

.item-table .description-cell {
  min-width: 190px;
}

.totals-box {
  display: grid;
  width: min(410px, 100%);
  gap: 8px;
  margin: 18px 0 0 auto;
  padding: 16px;
  border-radius: 12px;
  background: var(--soft);
}

.total-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  color: #50616e;
  font-size: 11px;
}

.total-row.grand {
  margin-top: 3px;
  padding-top: 10px;
  border-top: 1px solid #cad5da;
  color: var(--navy);
  font-size: 15px;
  font-weight: 900;
}

.form-footer {
  position: sticky;
  bottom: 15px;
  z-index: 5;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.approval-card-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.approval-card {
  padding: 19px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}

.approval-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.approval-card h3 {
  margin: 8px 0 4px;
  font-size: 14px;
}

.approval-card p {
  margin: 0;
  color: var(--muted);
  font-size: 11px;
}

.approval-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 18px 0;
  padding: 13px;
  border-radius: 10px;
  background: var(--soft);
}

.approval-meta small,
.approval-meta strong {
  display: block;
}

.approval-meta small {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.approval-meta strong {
  margin-top: 3px;
  font-size: 10px;
}

.report-summary {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 18px;
}

.report-summary.six {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.report-summary.eight {
  grid-template-columns: repeat(8, minmax(0, 1fr));
}

.report-summary.ten {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.report-summary > div {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: white;
}

.report-summary small,
.report-summary strong {
  display: block;
}

.report-summary small {
  color: var(--muted);
  font-size: 9px;
  text-transform: uppercase;
}

.report-summary strong {
  margin-top: 7px;
  font-size: 20px;
}

.report-panel {
  margin-top: 18px;
}

.report-filter-stack .filter-group {
  width: 100%;
  flex-wrap: wrap;
}

.report-filter-stack input {
  min-width: 230px;
}

.report-scope-note {
  margin-bottom: 14px;
  padding: 11px 14px;
  border: 1px solid #b9d8e9;
  border-radius: 11px;
  color: #31566c;
  background: #f4fbff;
  font-size: 10px;
}

.report-filter-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.6fr) repeat(6, minmax(120px, 1fr)) auto;
  min-width: 100%;
}

.report-filter-grid input,
.report-filter-grid select,
.report-filter-grid button {
  width: 100%;
  min-width: 0;
}

.report-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 2px 0 18px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: white;
}

.report-tab {
  flex: 0 0 auto;
  min-height: 36px;
  padding: 8px 13px;
  border: 0;
  border-radius: 9px;
  color: #536b79;
  background: transparent;
  font-size: 10px;
  font-weight: 800;
  cursor: pointer;
}

.report-tab:hover {
  color: var(--blue-dark);
  background: #f2f7f9;
}

.report-tab.active {
  color: white;
  background: linear-gradient(135deg, var(--blue), #238dab);
  box-shadow: 0 6px 15px rgba(22, 91, 123, 0.2);
}

.report-dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.report-chart-card,
.report-insight-card {
  min-width: 0;
}

.report-chart-card.wide {
  grid-column: span 1;
}

.report-chart-list {
  display: grid;
  gap: 10px;
}

.report-chart-row {
  display: grid;
  grid-template-columns: minmax(95px, 0.8fr) minmax(120px, 2fr) minmax(62px, auto);
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 5px 4px;
  border: 0;
  border-radius: 8px;
  color: inherit;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.report-chart-row:hover {
  background: #f5fafc;
}

.report-chart-label {
  overflow: hidden;
  color: #405766;
  font-size: 9px;
  font-weight: 750;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.report-chart-track {
  overflow: hidden;
  height: 10px;
  border-radius: 999px;
  background: #e8eff2;
}

.report-chart-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

.report-chart-row strong {
  font-size: 9px;
  text-align: right;
  white-space: nowrap;
}

.report-insight-card {
  grid-column: 1 / -1;
}

.report-insights {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 12px;
  padding: 18px 20px;
}

.report-insights > div {
  padding: 14px;
  border: 1px solid #dce8ed;
  border-radius: 11px;
  background: #f9fcfd;
}

.report-insights small,
.report-insights strong,
.report-insights span {
  display: block;
}

.report-insights small {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.report-insights strong {
  margin-top: 7px;
  color: #203946;
  font-size: 12px;
}

.report-insights span {
  margin-top: 4px;
  color: #6a7d88;
  font-size: 9px;
}

.po-detail-card {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin: 0 0 18px;
  padding: 14px;
  border: 1px solid #9fd9c8;
  border-radius: 12px;
  background: #effaf6;
}

.po-detail-card small,
.po-detail-card strong {
  display: block;
}

.po-detail-card small {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.po-detail-card strong {
  margin-top: 5px;
  font-size: 10px;
}

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

.personal-settings-grid {
  display: grid;
  grid-template-columns: minmax(230px, 0.7fr) minmax(0, 1.8fr);
  gap: 18px;
  align-items: start;
}

.profile-identity-card {
  text-align: center;
}

.profile-identity-card .eyebrow {
  text-align: left;
}

.profile-identity-card h3 {
  margin-top: 14px;
}

.profile-photo-preview {
  display: grid;
  width: 118px;
  height: 118px;
  margin: 18px auto 8px;
  overflow: hidden;
  place-items: center;
  border: 5px solid white;
  border-radius: 28px;
  color: white;
  background: linear-gradient(145deg, var(--navy-2), var(--blue));
  box-shadow: 0 12px 28px rgba(15, 64, 96, 0.2);
  font-size: 30px;
  font-weight: 900;
}

.profile-photo-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.settings-card {
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: white;
}

.settings-card h3 {
  margin: 0 0 8px;
}

.settings-card p,
.settings-card li {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.65;
}

.settings-card code {
  padding: 3px 6px;
  border-radius: 5px;
  background: #edf2f5;
  font-size: 10px;
}

.modal-backdrop {
  position: fixed;
  z-index: 100;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 25px;
  background: rgba(4, 20, 31, 0.58);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(820px, 100%);
  max-height: calc(100vh - 50px);
  overflow: auto;
  border-radius: 18px;
  background: white;
  box-shadow: 0 25px 70px rgba(3, 24, 39, 0.25);
}

.modal.wide {
  width: min(1050px, 100%);
}

.modal-head {
  position: sticky;
  z-index: 2;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 18px 22px;
  border-bottom: 1px solid var(--line);
  background: white;
}

.modal-head h2 {
  margin: 0;
  font-size: 18px;
}

.modal-body {
  padding: 22px;
}

.modal-footer {
  position: sticky;
  bottom: 0;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 14px 22px;
  border-top: 1px solid var(--line);
  background: white;
}

.detail-hero {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 20px;
  margin-bottom: 18px;
  padding: 20px;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--navy), #1c6179);
}

.detail-hero h2 {
  margin: 4px 0 7px;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 25px;
  font-weight: 500;
}

.detail-hero p {
  margin: 0;
  color: #cfe3eb;
  font-size: 11px;
}

.detail-amount {
  align-self: center;
  text-align: right;
}

.detail-amount small,
.detail-amount strong {
  display: block;
}

.detail-amount small {
  color: #a9cad7;
  font-size: 9px;
  text-transform: uppercase;
}

.detail-amount strong {
  margin-top: 4px;
  font-size: 21px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 18px;
}

.detail-field {
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fbfcfd;
}

.detail-field small,
.detail-field strong {
  display: block;
}

.detail-field small {
  color: var(--muted);
  font-size: 8px;
  text-transform: uppercase;
}

.detail-field strong {
  margin-top: 5px;
  font-size: 10px;
}

.terms-block {
  margin-top: 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fbfcfd;
  white-space: pre-line;
  font-size: 11px;
  line-height: 1.65;
}

.timeline {
  display: grid;
  gap: 13px;
  margin-top: 14px;
}

.timeline-row {
  display: grid;
  grid-template-columns: 12px 1fr auto;
  gap: 10px;
  align-items: start;
}

.timeline-row > i {
  width: 9px;
  height: 9px;
  margin-top: 4px;
  border: 2px solid white;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 2px #bcd3df;
}

.timeline-row strong,
.timeline-row small {
  display: block;
}

.timeline-row strong {
  font-size: 10px;
}

.timeline-row small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 9px;
}

.timeline-row time {
  color: var(--muted);
  font-size: 8px;
}

.toast-root {
  position: fixed;
  z-index: 200;
  right: 22px;
  bottom: 22px;
  display: grid;
  gap: 9px;
}

.toast {
  min-width: 260px;
  max-width: 390px;
  padding: 13px 16px;
  border-left: 4px solid var(--green);
  border-radius: 9px;
  color: white;
  background: #17394d;
  box-shadow: var(--shadow);
  font-size: 11px;
  animation: toast-in 0.22s ease;
}

.toast.error {
  border-color: var(--red);
}

@keyframes toast-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
}

@media (max-width: 1100px) {
  .kpi-grid,
  .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .form-grid .span-3,
  .form-grid .span-4 {
    grid-column: 1 / -1;
  }

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

  .report-summary.six,
  .report-summary.eight,
  .report-summary.ten {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

  .report-filter-grid input {
    grid-column: span 2;
  }

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

@media (max-width: 850px) {
  .login-screen {
    grid-template-columns: 1fr;
  }

  .login-brand-panel {
    min-height: 380px;
    padding: 45px 28px;
  }

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

  .sidebar {
    position: fixed;
    z-index: 50;
    left: -270px;
    width: 250px;
    transition: 0.2s ease;
  }

  .sidebar.open {
    left: 0;
    box-shadow: 20px 0 50px rgba(0, 0, 0, 0.2);
  }

  .mobile-only {
    display: inline-grid;
    place-items: center;
  }

  .topbar {
    padding: 14px 18px;
  }

  .topbar > div:first-child {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 10px;
  }

  .topbar .eyebrow {
    display: none;
  }

  .topbar h1 {
    font-size: 18px;
  }

  .user-chip {
    min-width: 0;
  }

  .user-chip > span:nth-child(2),
  .user-chip i {
    display: none;
  }

  .security-alert-button {
    min-width: 46px;
    justify-content: center;
    padding: 7px;
  }

  .security-alert-copy {
    display: none;
  }

  .security-alert-badge {
    position: absolute;
    top: -6px;
    right: -6px;
  }

  .main-content {
    padding: 20px 16px 40px;
  }

  .approval-card-grid,
  .settings-grid,
  .personal-settings-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 620px) {
  .login-form-panel {
    padding: 24px 16px;
  }

  .login-card {
    padding: 28px 22px;
  }

  .topbar-actions .btn {
    display: none;
  }

  .kpi-grid,
  .form-grid,
  .report-summary,
  .report-summary.six,
  .report-summary.eight,
  .report-summary.ten,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .report-filter-grid,
  .report-dashboard-grid,
  .report-insights {
    grid-template-columns: 1fr;
  }

  .report-filter-grid input {
    grid-column: auto;
  }

  .report-chart-row {
    grid-template-columns: minmax(80px, 1fr) minmax(90px, 1.5fr) auto;
  }

  .po-detail-card {
    grid-template-columns: 1fr;
  }

  .form-grid .span-2,
  .form-grid .span-3,
  .form-grid .span-4 {
    grid-column: auto;
  }

  .page-actions,
  .section-heading,
  .item-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-group {
    min-width: 100%;
    flex-direction: column;
  }

  .approval-meta {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    grid-template-columns: 1fr;
  }

  .detail-amount {
    text-align: left;
  }
}
