:root {
  color-scheme: light;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", sans-serif;
  --glass-blur: 18px;
  --glass-surface: rgba(255, 255, 255, .58);
  --glass-surface-strong: rgba(255, 255, 255, .72);
  --glass-surface-soft: rgba(255, 255, 255, .42);
  --glass-border: rgba(255, 255, 255, .58);
  --glass-border-soft: rgba(255, 255, 255, .34);
  --glass-shadow: 0 12px 36px rgba(15, 23, 42, .12);
  --glass-inset: inset 0 1px 0 rgba(255, 255, 255, .7);
  --accent: #1375f7;
  background: #dce7f5;
  color: #172033;
}

* { box-sizing: border-box; }
html, body { max-width: 100%; overflow-x: hidden; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(1100px 640px at 12% -8%, rgba(56, 189, 248, .34), transparent 62%),
    radial-gradient(900px 560px at 102% 6%, rgba(129, 140, 248, .28), transparent 58%),
    radial-gradient(980px 720px at 50% 112%, rgba(45, 212, 191, .26), transparent 60%),
    linear-gradient(180deg, #eef4fb, #e2ebf7 55%, #dce7f5);
  background-attachment: fixed;
}
button, input, select { font: inherit; }
button { cursor: pointer; border: 0; }
:focus-visible { outline: 2px solid rgba(19, 117, 247, .6); outline-offset: 2px; }
::selection { background: rgba(19, 117, 247, .22); }

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(15, 23, 42, .16), rgba(15, 23, 42, .08)),
    url("../images/login-background.jpg?v=2026102602") center / cover no-repeat;
}

.login-card {
  width: min(420px, 100%);
  padding: 36px;
  border-radius: 24px;
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  box-shadow: 0 24px 70px rgba(1, 19, 38, .26), var(--glass-inset);
  -webkit-backdrop-filter: blur(22px) saturate(170%);
  backdrop-filter: blur(22px) saturate(170%);
  display: grid;
  gap: 15px;
}
.login-card h1 { margin: 0; font-size: 28px; letter-spacing: -.4px; }
.auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 4px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .38);
  border: 1px solid var(--glass-border-soft);
}
.login-card > button {
  width: 100%;
  padding: 12px;
  border-radius: 12px;
  background: linear-gradient(135deg, #1d6ae8, #1064dd 55%, #0b53c4);
  color: #fff;
  font-weight: 700;
  box-shadow: 0 10px 24px rgba(19, 117, 247, .3), inset 0 1px 0 rgba(255, 255, 255, .24);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.login-card > button:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 14px 30px rgba(19, 117, 247, .36), inset 0 1px 0 rgba(255, 255, 255, .24); }
.auth-tabs button { padding: 9px; border-radius: 9px; background: transparent; color: #47566d; font-weight: 650; }
.auth-tabs button.active { background: rgba(255, 255, 255, .88); color: #1064dd; box-shadow: 0 2px 10px rgba(15, 23, 42, .1); }
.auth-tabs button:hover { background: rgba(255, 255, 255, .6); color: #1064dd; }

.muted { color: #5a6a80; margin: 0; }
.form-field { display: grid; gap: 6px; font-size: 13px; color: #475569; }
.form-field input, .form-field select {
  width: 100%;
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 11px;
  background: rgba(255, 255, 255, .52);
  box-shadow: inset 0 1px 2px rgba(15, 23, 42, .05);
  transition: border-color .16s ease, background .16s ease, box-shadow .16s ease;
}
.form-field input:focus, .form-field select:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(19, 117, 247, .18);
  background: rgba(255, 255, 255, .82);
  box-shadow: 0 0 0 4px rgba(19, 117, 247, .1);
}

.app-shell {
  width: 100%;
  max-width: 100vw;
  height: 100vh;
  min-height: 100vh;
  overflow: hidden;
  display: grid;
  grid-template-columns: 216px minmax(0, 1fr);
}
.sidebar {
  min-width: 0;
  background: rgba(255, 255, 255, .5);
  color: #252b32;
  border-right: 1px solid var(--glass-border);
  padding: 16px 12px;
  box-shadow: 8px 0 32px rgba(15, 23, 42, .06);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100%;
}
.brand { display: flex; align-items: center; gap: 9px; min-height: 62px; padding: 0 10px 14px; }
.brand-logo {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  display: block;
  border-radius: 7px;
  object-fit: contain;
  background: rgba(255, 255, 255, .75);
}
.brand-copy { display: grid; gap: 1px; }
.brand-copy strong { font-size: 17px; letter-spacing: -.2px; color: #121820; }
.brand-copy small { color: #6f7783; font-size: 11px; }
.sidebar nav { flex: 1; min-height: 0; overflow-y: auto; display: block; }
.sidebar a, .sidebar button.nav-group {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 16px;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 10px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #303740;
  font-size: 14px;
  text-decoration: none;
  transition: background .16s ease, color .16s ease, border-color .16s ease, box-shadow .16s ease;
}
.sidebar a:hover, .sidebar button.nav-group:hover { background: rgba(255, 255, 255, .58); border-color: var(--glass-border-soft); color: #0b6ed3; }
.sidebar a.active, .sidebar button.nav-group.active {
  background: rgba(19, 117, 247, .13);
  border-color: rgba(19, 117, 247, .2);
  color: #0b5fd0;
  font-weight: 650;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .5);
}
.sidebar button.nav-group { width: 100%; border: 0; background: transparent; text-align: left; cursor: pointer; font: inherit; }
.nav-icon { color: #0080ff; font-size: 16px; text-align: center; }
.nav-label { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-chevron { color: #9aa1aa; font-family: system-ui, sans-serif; font-size: 21px; line-height: 1; transition: transform .18s ease; }
.sidebar a.active .nav-chevron, .sidebar button.nav-group.active .nav-chevron { color: rgba(0, 128, 255, .68); }
.nav-chevron.expanded { transform: rotate(90deg); }
.sidebar-footer {
  flex: 0 0 auto;
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 64px;
  margin-top: 12px;
  padding: 10px 12px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .38);
  background: linear-gradient(135deg, rgba(29, 106, 232, .92) 0%, rgba(16, 86, 209, .9) 100%);
  color: #fff;
  box-shadow: 0 14px 30px rgba(19, 117, 247, .26), inset 0 1px 0 rgba(255, 255, 255, .3);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}
.footer-avatar { display: grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(255,255,255,.2); font-weight: 700; }
.footer-user { display: grid; min-width: 0; }
.footer-user strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 13px; }
.footer-user small { opacity: .82; font-size: 11px; }
.logout { padding: 7px 9px; border-radius: 9px; background: rgba(255,255,255,.2); color: #fff; font-size: 12px; transition: background .16s ease; }
.logout:hover { background: rgba(255,255,255,.32); }

.main {
  width: 100%;
  min-width: 0;
  height: 100%;
  padding: 28px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.page { display: grid; gap: 22px; width: 100%; max-width: min(1400px, 100%); margin: auto; }
.page-header { display: flex; justify-content: space-between; align-items: flex-end; }
.page-header h2, .panel h3 { margin: 0; }
.page-header p { margin: 7px 0 0; color: #5a6a80; }

.kpi-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 15px; }
.kpi-card {
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 20px;
  display: grid;
  gap: 9px;
  box-shadow: var(--glass-shadow), var(--glass-inset);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  transition: transform .18s ease, box-shadow .18s ease;
}
.kpi-card span { color: #5a6a80; font-size: 13px; }
.kpi-card strong { font-size: 23px; }
.kpi-card:hover { transform: translateY(-2px); box-shadow: 0 18px 44px rgba(15, 23, 42, .16), var(--glass-inset); }

.panel-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 15px; }
.panel {
  background: var(--glass-surface);
  border: 1px solid var(--glass-border);
  border-radius: 18px;
  padding: 20px;
  display: grid;
  gap: 13px;
  align-content: start;
  box-shadow: var(--glass-shadow), var(--glass-inset);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
}
.trend-row, .expense-row { display: grid; grid-template-columns: 42px 1fr auto; align-items: center; gap: 11px; font-size: 13px; }
.trend-track, .expense-track { height: 10px; border-radius: 999px; background: #eaf0f7; overflow: hidden; }
.trend-bar { height: 100%; border-radius: inherit; background: #1769aa; }
.expense-bar { height: 100%; border-radius: inherit; background: #18a999; }

.user-form { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)) auto; gap: 13px; align-items: end; }
.user-form button, .permission-form button {
  padding: 10px 14px;
  border-radius: 11px;
  background: linear-gradient(135deg, #1d6ae8, #1064dd 55%, #0b53c4);
  color: #fff;
  font-weight: 650;
  box-shadow: 0 8px 20px rgba(19, 117, 247, .26), inset 0 1px 0 rgba(255, 255, 255, .24);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.user-form button:hover, .permission-form button:hover { filter: brightness(1.05); transform: translateY(-1px); box-shadow: 0 12px 26px rgba(19, 117, 247, .32), inset 0 1px 0 rgba(255, 255, 255, .24); }
.user-card { gap: 16px; }
.user-meta { display: flex; justify-content: space-between; gap: 15px; }
.user-meta span { color: #5a6a80; font-size: 13px; }
.permission-form { display: flex; flex-wrap: wrap; align-items: center; gap: 11px; }
.module-permission-group {
  display: grid;
  grid-template-columns: 82px 1fr;
  align-items: center;
  gap: 9px;
  padding: 8px 10px;
  border: 1px solid var(--glass-border-soft);
  border-radius: 13px;
  background: rgba(255, 255, 255, .34);
}
.module-permission-title { color: #475569; font-size: 13px; font-weight: 700; }
.module-permission-options { display: flex; flex-wrap: wrap; gap: 7px; }
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 11px;
  border: 1px solid var(--glass-border-soft);
  border-radius: 11px;
  background: rgba(255, 255, 255, .5);
}
.department-field {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 11px;
  border: 1px solid var(--glass-border-soft);
  border-radius: 11px;
  background: rgba(255, 255, 255, .5);
  color: #475569;
  font-size: 13px;
}
.department-field input { width: 170px; padding: 8px 10px; border: 1px solid rgba(203, 213, 225, .72); border-radius: 9px; background: rgba(255, 255, 255, .6); }
.user-actions { margin-left: auto; display: flex; gap: 8px; }
.user-delete-button { background: linear-gradient(135deg, rgba(192, 57, 43, .92), rgba(169, 50, 38, .92)) !important; box-shadow: 0 8px 18px rgba(169, 50, 38, .24), inset 0 1px 0 rgba(255, 255, 255, .2) !important; }
.user-delete-button:hover { filter: brightness(1.05); }
.permission-form button:disabled { cursor: not-allowed; opacity: .55; }
.empty-state {
  background: var(--glass-surface-soft);
  border: 1px dashed rgba(151, 168, 193, .55);
  border-radius: 20px;
  padding: 60px 30px;
  text-align: center;
  color: #5a6a80;
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(140%);
  backdrop-filter: blur(var(--glass-blur)) saturate(140%);
}
.empty-state h2 { color: #172033; }

.subnav { margin: 2px 0 4px 24px; border-left: 1px solid #e4e9ef; }
.subnav a {
  display: block;
  min-height: 44px;
  padding: 0 16px;
  color: #667081;
  font-size: 14px;
  line-height: 44px;
}
.subnav a:hover, .subnav a.active { background: transparent; color: #0080ff; font-weight: 650; }
.subnav a.active { border-left: 2px solid #0080ff; margin-left: -1px; }

.channel-page { min-width: 0; }
.page-header button { flex: 0 0 auto; }
.primary-button, .channel-filter button, .pagination > button, .page-jump button, .editor-modal footer button[type="submit"] {
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 11px;
  background: linear-gradient(135deg, #1d6ae8, #1064dd 55%, #0b53c4);
  color: #fff;
  font-weight: 650;
  box-shadow: 0 10px 24px rgba(19, 117, 247, .24), inset 0 1px 0 rgba(255, 255, 255, .24);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}
.primary-button:hover, .channel-filter button:hover, .pagination > button:not(:disabled):hover, .page-jump button:hover, .editor-modal footer button[type="submit"]:hover {
  filter: brightness(1.05);
  transform: translateY(-1px);
  box-shadow: 0 14px 30px rgba(19, 117, 247, .3), inset 0 1px 0 rgba(255, 255, 255, .24);
}
.ghost-button { background: rgba(255, 255, 255, .5) !important; color: #3f4e60 !important; border: 1px solid var(--glass-border) !important; box-shadow: var(--glass-inset) !important; -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); }
.filter-grid { display: grid; }
.channel-filter { gap: 10px; padding: 14px 16px; }
.channel-filter h3 { font-size: 14px; }
.channel-filter .filter-grid { grid-template-columns: repeat(6, minmax(112px, 1fr)); gap: 8px 10px; }
.channel-filter .form-field { gap: 3px; font-size: 12px; }
.channel-filter .form-field input,
.channel-filter .form-field select {
  padding: 7px 9px;
  border-radius: 8px;
  font-size: 12px;
}
.channel-filter button { padding: 7px 11px; border-radius: 8px; font-size: 12px; }
.filter-actions { display: flex; justify-content: flex-end; align-items: end; gap: 6px; }
.table-panel { gap: 0; }
.table-wrapper {
  width: 100%;
  max-width: 100%;
  overflow: auto;
  max-height: min(72vh, 760px);
  overscroll-behavior: contain;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  margin-top: 15px;
  background: rgba(255, 255, 255, .46);
  box-shadow: var(--glass-shadow);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(150%);
  backdrop-filter: blur(var(--glass-blur)) saturate(150%);
}
.data-table {
  width: 100%;
  min-width: 1450px;
  table-layout: fixed;
  border-collapse: separate;
  border-spacing: 0;
  background: transparent;
}
.data-table th, .data-table td { padding: 9px 8px; border-bottom: 1px solid rgba(148, 163, 184, .2); text-align: left; font-size: 12.5px; white-space: nowrap; }
.data-table th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: rgba(255, 255, 255, .8);
  -webkit-backdrop-filter: blur(12px) saturate(150%);
  backdrop-filter: blur(12px) saturate(150%);
  color: #3d4b5f;
  font-weight: 680;
}
.data-table tbody tr:last-child td { border-bottom: 0; }
.data-table tbody tr { transition: background .14s ease; }
.data-table tbody tr:hover { background: rgba(19, 117, 247, .07); }
.data-table:not(.sales-dashboard-table) th:first-child {
  left: 0;
  z-index: 3;
}
.data-table:not(.sales-dashboard-table) td:first-child {
  position: sticky;
  left: 0;
  z-index: 2;
  background: rgba(255, 255, 255, .92);
  box-shadow: inset -1px 0 0 rgba(148, 163, 184, .24);
}
.data-table:not(.sales-dashboard-table) tbody tr:hover td:first-child {
  background: rgba(235, 245, 255, .96);
}
.channel-page .data-table {
  min-width: 1550px;
}

.market-page { align-content: start; }
.market-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}
.market-kpi { border-radius: 16px; }
.market-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(360px, .92fr);
  gap: 15px;
  align-items: stretch;
}
.market-cooperation-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, .44);
  box-shadow: var(--glass-shadow);
}
.market-cooperation-filter .form-field {
  width: min(220px, 100%);
  margin: 0;
}
.market-cooperation-filter .muted {
  min-width: 260px;
  padding-bottom: 11px;
}
.market-amount-button {
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 700;
  text-align: right;
}
.market-amount-button:hover { color: #0b63ce; }
.market-map-panel { position: relative; }
.market-map { position: relative; display: grid; gap: 10px; }
.market-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1000 / 720;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  background: linear-gradient(180deg, #f8fbff, #edf4fb);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .8);
}
.market-svg path {
  fill: #fff;
  stroke: rgba(90, 108, 130, .72);
  stroke-width: 1;
  vector-effect: non-scaling-stroke;
}
.market-svg path.covered { fill: #1e40af; stroke: rgba(255, 255, 255, .9); }
.market-svg path.interactive {
  cursor: pointer;
  transform-box: fill-box;
  transform-origin: center;
  transition: transform .18s ease, fill .18s ease, stroke-width .18s ease, filter .18s ease;
}
.market-svg path.interactive:hover,
.market-svg path.interactive:focus-visible {
  transform: scale(1.035);
  stroke-width: 2;
  filter: drop-shadow(0 7px 14px rgba(30, 64, 175, .28));
  outline: 0;
}
.market-svg path.blank.interactive:hover,
.market-svg path.blank.interactive:focus-visible { fill: #f8fafc; }
.market-svg path.covered.interactive:hover,
.market-svg path.covered.interactive:focus-visible { fill: #2563eb; }
.market-svg path.active {
  stroke: #d97706;
  stroke-width: 2.5;
}
.market-map-label {
  pointer-events: none;
  font-size: 15px;
  font-weight: 650;
  text-anchor: middle;
  dominant-baseline: middle;
  fill: #17325e;
  stroke: rgba(255,255,255,.86);
  stroke-width: 3px;
  paint-order: stroke fill;
}
.market-map-tooltip {
  position: absolute;
  top: 4px;
  right: 4px;
  z-index: 1;
  display: grid;
  min-width: 158px;
  gap: 3px;
  padding: 9px 11px;
  border: 1px solid rgba(255, 255, 255, .78);
  border-radius: 10px;
  background: rgba(15, 23, 42, .82);
  color: #fff;
  box-shadow: 0 12px 28px rgba(15, 23, 42, .2);
  pointer-events: none;
}
.market-map-tooltip strong { font-size: 13px; line-height: 1.35; }
.market-map-tooltip span { font-size: 12px; opacity: .88; }
.market-legend {
  display: flex;
  align-items: center;
  gap: 12px;
  color: #526070;
  font-size: 12px;
}
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-item i {
  width: 11px;
  height: 11px;
  border: 1px solid rgba(90, 108, 130, .7);
  border-radius: 3px;
}
.legend-covered { background: #1e40af; }
.legend-blank { background: #fff; }
.market-child-panel { min-width: 0; }
.market-child-table { max-height: 520px; margin-top: 12px; }
.market-child-table .data-table { min-width: 480px; }
.market-region-filter {
  display: grid;
  grid-template-columns: minmax(220px, 360px) minmax(140px, 180px) auto auto;
  gap: 10px;
  align-items: end;
  margin-top: 14px;
}
.market-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.market-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  padding: 6px 10px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255, 255, 255, .58);
  box-shadow: var(--glass-inset);
  font-size: 12px;
}
.market-filter-chip b {
  color: #3d4b5f;
  font-weight: 680;
}
.market-filter-chip small {
  color: #526070;
  overflow-wrap: anywhere;
}
.market-region-groups {
  display: grid;
  grid-template-columns: minmax(280px, .78fr) minmax(420px, 1.22fr);
  gap: 15px;
  align-items: start;
  margin-top: 15px;
}
.market-level-panel {
  min-width: 0;
  margin-top: 0;
  padding: 14px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: rgba(255, 255, 255, .42);
  box-shadow: var(--glass-shadow);
}
.market-level-panel h4,
.market-region-subtitle {
  margin: 0;
  color: #31404f;
  font-size: 14px;
}
.market-region-subtitle {
  margin-top: 15px;
}
.market-level-table { max-height: 340px; margin-top: 10px; }
.market-level-table .data-table { min-width: 480px; }
.market-region-filter button {
  padding: 9px 14px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 10px;
  background: linear-gradient(135deg, #1d6ae8, #1064dd 55%, #0b53c4);
  color: #fff;
  font-weight: 650;
}
.market-region-table { margin-top: 15px; max-height: min(66vh, 700px); }
.market-region-table .data-table { min-width: 880px; }
.market-brand-panel { min-width: 0; }
.market-brand-table { max-height: 520px; margin-top: 12px; }
.market-brand-table .data-table { min-width: 720px; }
.market-brand-name-cell { font-weight: 650; }
.market-brand-link { display: inline-block; color: #0b63ce; }
.market-brand-link:hover { text-decoration: underline; }
.market-brand-customer-table { margin-top: 15px; }
.market-brand-customer-table .data-table { min-width: 1500px; }
.market-brand-customer-table th,
.market-brand-customer-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  line-height: 1.45;
}
.market-brand-customer-table td.market-brand-customer-channelName,
.market-brand-customer-table td.market-brand-customer-address { width: 14%; }
.market-brand-customer-table td.market-brand-customer-brand { width: 11%; }
.market-brand-customer-table td.market-brand-customer-orderAmount { width: 8%; }
.market-order-amount-link { font-weight: 700; }
.market-brand-empty { margin: 28px 0; text-align: center; }
.market-season-modal { width: min(520px, 100%); }
.market-season-modal-body { padding: 20px 22px 24px; }
.market-season-table { width: 100%; }
.market-season-table th,
.market-season-table td { font-size: 13px; }
.market-expansion-filter { display: grid; gap: 12px; padding: 14px 16px; }
.market-expansion-filter h3 { margin: 0; font-size: 14px; }
.market-expansion-filter-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 10px;
}
.market-expansion-filter .form-field { margin: 0; font-size: 12px; }
.market-expansion-filter .form-field input,
.market-expansion-filter .form-field select {
  padding: 8px 10px;
  font-size: 12.5px;
}
.market-expansion-filter .filter-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}
.market-expansion-filter button {
  padding: 8px 13px;
  border: 1px solid rgba(255, 255, 255, .3);
  border-radius: 9px;
  background: linear-gradient(135deg, #1d6ae8, #1064dd 55%, #0b53c4);
  color: #fff;
  font-size: 12.5px;
  font-weight: 650;
}
.market-expansion-table { max-height: min(68vh, 760px); margin-top: 12px; }
.market-expansion-table .data-table { min-width: 1480px; }
.market-expansion-table th,
.market-expansion-table td {
  vertical-align: top;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.market-expansion-modal { width: min(1120px, 100%); }
.market-expansion-remark-grid { grid-template-columns: 1fr; padding-top: 0; }
.market-status.is-following { color: #b54708; }
.market-brand-order-table .data-table { min-width: 2200px; }
.market-brand-order-table th,
.market-brand-order-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  line-height: 1.45;
}
.dashboard-page { align-content: start; }
.dashboard-filter-panel { min-width: 0; }
.segmented-control {
  display: inline-flex;
  padding: 3px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(255,255,255,.56);
}
.segmented-control button {
  padding: 6px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #526070;
  font-size: 12px;
  font-weight: 650;
}
.segmented-control button.active { background: #e8f1ff; color: #0b4dbb; }
.dashboard-brand-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}
.dashboard-brand-button {
  padding: 8px 13px;
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  background: rgba(255,255,255,.58);
  color: #3d4b5f;
  font-size: 12.5px;
  font-weight: 620;
  box-shadow: var(--glass-inset);
}
.dashboard-brand-button:hover { color: #0b63ce; }
.dashboard-brand-button.active {
  border-color: rgba(29,110,232,.45);
  background: #e8f1ff;
  color: #0b4dbb;
}
.dashboard-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 15px;
}
.dashboard-chart-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px;
  align-items: stretch;
}
.dashboard-chart-panel { min-width: 0; }
.dashboard-period-field { max-width: 190px; margin-top: 14px; }
.dashboard-chart-body {
  display: grid;
  grid-template-columns: minmax(190px, .78fr) minmax(220px, 1.22fr);
  gap: 16px;
  align-items: center;
  margin-top: 15px;
  position: relative;
}
.dashboard-donut { max-width: 210px; }
.dashboard-donut svg { width: 100%; height: auto; }
.donut-slice {
  pointer-events: visibleStroke;
  transform-box: view-box;
  transform-origin: center;
  transition: transform .16s ease, stroke-width .16s ease;
}
.donut-slice.interactive { cursor: pointer; }
.donut-slice.interactive:hover,
.donut-slice.interactive:focus-visible {
  transform: scale(1.035);
  stroke-width: 30;
  outline: none;
}
.dashboard-scope-back { margin-top: 14px; }
.dashboard-pie-tooltip {
  position: absolute;
  top: 0;
  right: 0;
  z-index: 2;
  display: none;
  min-width: 150px;
  padding: 8px 11px;
  border: 1px solid rgba(255,255,255,.75);
  border-radius: 10px;
  background: rgba(15,23,42,.86);
  color: #fff;
  box-shadow: 0 12px 26px rgba(15,23,42,.2);
  pointer-events: none;
}
.dashboard-pie-tooltip[data-visible='true'] { display: grid; gap: 3px; }
.dashboard-pie-tooltip strong { font-size: 13px; }
.dashboard-pie-tooltip span { font-size: 12px; opacity: .9; }
.donut-track { fill: none; stroke: rgba(148,163,184,.18); stroke-width: 28; }
.donut-total { fill: #26364a; font-size: 24px; font-weight: 750; text-anchor: middle; }
.donut-label { fill: #64748b; font-size: 11px; text-anchor: middle; }
.dashboard-legend {
  display: grid;
  max-height: 340px;
  overflow: auto;
  gap: 7px;
  align-content: start;
}
.dashboard-legend-item {
  display: grid;
  grid-template-columns: 11px minmax(72px, .8fr) minmax(100px, 1.2fr);
  align-items: center;
  gap: 8px;
  color: #41526a;
  font-size: 12px;
}
.dashboard-legend-item i { width: 11px; height: 11px; border-radius: 3px; }
.dashboard-legend-item b { overflow-wrap: anywhere; }
.dashboard-legend-item small { color: #64748b; text-align: right; }
.dashboard-chart-empty { margin: 48px 0; text-align: center; }
.dashboard-shipment-panel { grid-column: 1 / -1; }
.shipment-rate-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(150px, 1fr)) minmax(140px, .7fr);
  gap: 10px;
  margin-top: 16px;
}
.shipment-rate-summary span {
  padding: 10px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  background: rgba(255,255,255,.55);
  color: #4c5d73;
  font-size: 12px;
  overflow-wrap: anywhere;
}
.shipment-rate-summary strong {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  color: #123c8f;
  font-size: 17px;
  white-space: nowrap;
}
.shipment-progress-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  margin-top: 14px;
}
.shipment-progress-track {
  display: flex;
  height: 30px;
  overflow: visible;
  border: 1px solid rgba(148,163,184,.28);
  border-radius: 999px;
  background: #e5eaf1;
  box-shadow: var(--glass-inset);
}
.shipment-progress-sent {
  min-width: 0;
  border-radius: 999px 0 0 999px;
  background: linear-gradient(90deg, #1d4ed8, #3b82f6);
  transition: width .2s ease;
}
.shipment-progress-sent.is-full { border-radius: 999px; }
.shipment-progress-unsent {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
  padding: 0;
  border: 0;
  background: #dbe2ea;
  color: #48586f;
  font-size: 11.5px;
  font-weight: 700;
  cursor: pointer;
  border-radius: 0 999px 999px 0;
  transition: transform .16s ease, background .15s ease, color .15s ease, box-shadow .16s ease;
}
.shipment-progress-unsent.is-full { border-radius: 999px; }
.shipment-progress-unsent:hover,
.shipment-progress-unsent:focus-visible {
  background: #cbd5e1;
  color: #1f344d;
  transform: scale(1.035);
  box-shadow: 0 8px 18px rgba(15,23,42,.16);
  outline: none;
}
.shipment-progress-unsent span { overflow: hidden; white-space: nowrap; }
.shipment-rate-table-panel { min-width: 0; }
.shipment-rate-table .data-table { min-width: 1250px; }
.shipment-rate-table th,
.shipment-rate-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  line-height: 1.45;
}
.shipment-customer {
  min-width: 170px;
}
.shipment-customer { display: grid; gap: 3px; }
.shipment-customer small { color: #708196; }
.shipment-unsent-text { color: #9a3412; font-weight: 700; }
.shipment-mini-progress {
  width: 120px;
  max-width: 100%;
  height: 8px;
  overflow: hidden;
  border-radius: 999px;
  background: #dde3eb;
}
.shipment-mini-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1d4ed8, #3b82f6);
}
.market-customer-table .data-table { min-width: 1950px; }
.market-customer-table th,
.market-customer-table td {
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: break-word;
  vertical-align: top;
  line-height: 1.45;
}
.market-customer-table td.market-customer-channelNo { width: 5%; }
.market-customer-table td.market-customer-province,
.market-customer-table td.market-customer-city { width: 6%; }
.market-customer-table td.market-customer-district { width: 7%; }
.market-customer-table td.market-customer-brand,
.market-customer-table td.market-customer-marketName { width: 8%; }
.market-customer-table td.market-customer-channelAbbrev,
.market-customer-table td.market-customer-contact { width: 9%; }
.market-customer-table td.market-customer-channelName,
.market-customer-table td.market-customer-address { width: 13%; }
.market-customer-table td.market-customer-channelGroup { width: 5%; }
.market-customer-table td.market-customer-brandOperator { width: 8%; }
.market-wide-cell { min-width: 120px; }
.market-status {
  font-weight: 650;
}
.market-status.is-covered { color: #1746a2; }
.market-status.is-blank { color: #667081; }
.data-table tr.active-row { background: rgba(217, 119, 6, .11); }
.truncate-cell {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.channel-col-no { width: 6.5%; }
.channel-col-province { width: 5%; }
.channel-col-city, .channel-col-district { width: 5.5%; }
.channel-col-brand, .channel-col-abbrev { width: 8%; }
.channel-col-name { width: 10%; }
.channel-col-operator { width: 8%; }
.channel-col-group { width: 5.5%; }
.channel-col-market,
.channel-col-market-group { width: 6%; }
.channel-col-address { width: 11%; }
.channel-col-contact { width: 10%; }
.channel-col-date { width: 7.5%; }
.channel-col-actions { width: 11%; }
.channel-page td.channel-col-contact,
.channel-page td.channel-col-date {
  white-space: normal;
  overflow-wrap: anywhere;
}
.channel-page .table-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.channel-page .table-actions button {
  flex: 0 0 auto;
  padding: 5px 8px;
  font-size: 12px;
}
.table-link { color: #1769aa; font-weight: 650; text-decoration: none; }
.table-link:hover { text-decoration: underline; }
.channel-order-table .data-table { min-width: 2350px; }
.channel-finance-table .data-table { min-width: 3600px; }
.finance-repayment-table .data-table { min-width: 2800px; }
.finance-summary-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(168px, 1fr));
  gap: 10px;
  margin-top: 15px;
}
.panel-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.panel-toolbar h3 { margin: 0; }
.panel-toolbar button { flex: 0 0 auto; }
.toolbar-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; justify-content: flex-end; }
.table-search { display: flex; align-items: center; gap: 8px; }
.table-search input {
  width: 220px;
  max-width: 100%;
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
}
.table-search input:focus {
  border-color: var(--accent);
  outline: 2px solid rgba(19, 117, 247, .18);
}
.empty-table-cell { text-align: center; padding: 18px; }
.finance-summary-item {
  display: grid;
  min-width: 0;
  gap: 6px;
  padding: 12px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  background: rgba(255, 255, 255, .58);
}
.finance-summary-item-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-width: 0;
}
.finance-summary-item-title span { flex: 1 1 auto; }
.field-action-button {
  flex: 0 0 auto;
  padding: 3px 7px;
  border-radius: 7px;
  font-size: 11px;
  line-height: 1.35;
}
.finance-summary-item span {
  font-size: 12px;
  line-height: 1.45;
  color: #526070;
  overflow-wrap: anywhere;
}
.finance-summary-item strong {
  font-size: 15px;
  line-height: 1.45;
  color: #26364a;
  overflow-wrap: anywhere;
}
.finance-repayment-table th,
.finance-repayment-table td {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  overflow-wrap: anywhere;
}
.table-note { margin-top: 12px; font-size: 12px; }
.page-actions { display: flex; align-items: center; gap: 10px; }
.repayment-grid { grid-template-columns: repeat(5, minmax(160px, 1fr)); }
.repayment-modal header > div { display: grid; gap: 4px; }
.numeric-cell { font-variant-numeric: tabular-nums; }
.sales-dashboard-panel { min-width: 0; overflow: hidden; }
.sales-dashboard-toolbar-meta {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
}
.sales-customer-filter {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 5px 4px 10px;
  border: 1px solid rgba(19, 117, 247, .24);
  border-radius: 999px;
  background: rgba(19, 117, 247, .09);
  color: #155db4;
  font-size: 12px;
  font-weight: 650;
}
.sales-customer-filter button {
  min-height: 22px;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .78);
  color: #31506f;
  font-size: 11px;
}
.sales-customer-cell {
  cursor: pointer;
  color: inherit;
  font-weight: 700;
}
.sales-customer-cell:hover,
.sales-customer-cell:focus-visible { color: inherit; background: rgba(235, 245, 255, .98); }
.sales-customer-name {
  display: block;
  min-height: 100%;
  text-decoration: none;
  overflow-wrap: anywhere;
}
.sales-dashboard-filters {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
  align-items: end;
  padding-bottom: 16px;
}
.sales-dashboard-filter { display: grid; gap: 5px; font-size: 12px; color: #526070; }
.sales-dashboard-filter select { width: 100%; min-width: 0; }
.sales-company-filter { grid-column: span 2; }
.sales-dashboard-filter select,
.sales-dashboard-filters input {
  min-height: 37px;
  padding: 7px 9px;
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 9px;
  background: rgba(255, 255, 255, .68);
  font: inherit;
}
.sales-dashboard-filters input { min-width: 0; }
.sales-dashboard-filters input { grid-column: 1 / 4; }
.sales-dashboard-filters .primary-button { grid-column: 4 / 5; justify-self: end; }
.sales-dashboard-filters .ghost-button { grid-column: 5 / 7; justify-self: end; }
.sales-customer-credit-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 18px;
  padding: 14px 16px;
  border: 1px solid rgba(203, 213, 225, .58);
  border-radius: 14px;
  background: rgba(255, 255, 255, .62);
  flex-wrap: wrap;
}
.sales-customer-credit-title { display: grid; gap: 3px; min-width: 0; }
.sales-customer-credit-title strong { color: #223247; font-size: 14px; }
.sales-customer-credit-title span { color: #607086; font-size: 12px; overflow-wrap: anywhere; }
.sales-customer-credit-metrics {
  display: flex;
  align-items: stretch;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}
.sales-customer-credit-metric {
  min-width: 150px;
  padding: 10px 13px;
  border: 1px solid rgba(203, 213, 225, .5);
  border-radius: 11px;
  background: rgba(255, 255, 255, .78);
  display: grid;
  gap: 4px;
}
.sales-customer-credit-metric span { color: #647387; font-size: 12px; }
.sales-customer-credit-edit {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 2px 4px;
  border: 0;
  background: transparent;
  color: #1f2f45;
  font: inherit;
  font-size: 15px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.sales-customer-credit-edit > span:last-child {
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(19, 117, 247, .1);
  color: #1663c2;
  font-size: 11px;
}
.sales-customer-credit-edit:disabled > span:last-child { background: rgba(100, 116, 135, .12); color: #647387; }
.sales-customer-credit-metric.debt strong { color: #b42318; }
.sales-customer-credit-note {
  align-self: center;
  max-width: 300px;
  color: #68788c;
  font-size: 12px;
  line-height: 1.45;
}
.sales-brand-summary-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 0 10px;
}
.sales-brand-summary-title h3 { margin: 0; font-size: 15px; }
.sales-summary-statements {
  min-width: 0;
  margin-top: 22px;
  padding-top: 4px;
  border-top: 1px solid rgba(203, 213, 225, .55);
}
.sales-summary-cards { display: grid; gap: 14px; min-width: 0; }
.sales-summary-card {
  min-width: 0;
  padding: 16px;
  border: 1px solid rgba(203, 213, 225, .55);
  border-radius: 14px;
  background: rgba(255, 255, 255, .52);
  display: grid;
  gap: 13px;
}
.sales-summary-card header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.sales-summary-card header > div { display: grid; gap: 3px; min-width: 0; }
.sales-summary-card header strong { font-size: 15px; color: #223247; overflow-wrap: anywhere; }
.sales-summary-card header span { font-size: 12px; color: #617084; }
.sales-summary-code {
  flex: 0 0 auto;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(19, 117, 247, .1);
  color: #1657b8;
  font-size: 12px;
  font-weight: 700;
}
.sales-summary-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px 14px;
  color: #5b6a7e;
  font-size: 12.5px;
}
.sales-summary-meta span { overflow-wrap: anywhere; }
.sales-summary-metrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(188px, 1fr));
  gap: 10px;
}
.sales-summary-metric {
  min-width: 0;
  padding: 11px 12px;
  border: 1px solid rgba(203, 213, 225, .44);
  border-radius: 11px;
  background: rgba(255, 255, 255, .68);
  display: grid;
  gap: 6px;
}
.sales-summary-metric span { color: #647387; font-size: 12px; line-height: 1.35; }
.sales-summary-metric strong { color: #1f2f45; font-size: 14px; line-height: 1.35; overflow-wrap: anywhere; }
.sales-dashboard-table { min-width: 4148px; }
.sales-dashboard-table th,
.sales-dashboard-table td {
  width: 148px;
  min-width: 148px;
  white-space: nowrap;
  padding: 6px 5px;
  font-size: 11px;
  line-height: 1.25;
}
.sales-dashboard-table td { max-width: 150px; overflow: hidden; text-overflow: ellipsis; }
.sales-dashboard-table .pinned-column {
  background: rgba(255, 255, 255, .95);
}
.sales-dashboard-table .pinned-left,
.sales-dashboard-table .pinned-right {
  position: sticky;
  background: rgba(255, 255, 255, .95);
  z-index: 2;
}
.sales-dashboard-table .pinned-left {
  left: var(--pin-offset, 0px);
  box-shadow: inset -1px 0 0 rgba(148, 163, 184, .3);
}
.sales-dashboard-table .pinned-right {
  right: var(--pin-offset, 0px);
  box-shadow: inset 1px 0 0 rgba(148, 163, 184, .3);
}
.sales-dashboard-table th.pinned-left,
.sales-dashboard-table th.pinned-right { z-index: 4; }
.sales-dashboard-table tbody tr:hover td.pinned-left,
.sales-dashboard-table tbody tr:hover td.pinned-right {
  background: rgba(235, 245, 255, .97);
}
.column-pin-button {
  width: 18px;
  height: 16px;
  margin-left: 3px;
  padding: 0;
  border-radius: 4px;
  background: rgba(203, 213, 225, .32);
  color: #7386a0;
  font-size: 9px;
  line-height: 14px;
  vertical-align: middle;
}
.column-pin-button:hover,
.column-pin-button.active {
  background: rgba(19, 117, 247, .14);
  color: #1064dd;
}
.sales-credit-link {
  color: #1769aa;
  font-weight: 700;
  text-decoration: none;
}
.sales-credit-link:hover { text-decoration: underline; }
.temporary-credit-page .page-header .toolbar-actions {
  display: flex;
  align-items: center;
  gap: 9px;
}

.temporary-credit-editing-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(19, 117, 247, .12);
  color: #1673f7;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.temporary-credit-form {
  display: grid;
  grid-template-columns: repeat(4, minmax(190px, 1fr));
  gap: 13px;
  align-items: start;
}

.temporary-channel-field {
  min-width: 0;
}

.temporary-channel-results {
  display: grid;
  max-height: 190px;
  overflow-y: auto;
  border: 1px solid rgba(148, 163, 184, .34);
  border-radius: 9px;
  background: rgba(255, 255, 255, .72);
}

.temporary-channel-option {
  display: grid;
  gap: 2px;
  padding: 8px 10px;
  border: 0;
  border-bottom: 1px solid rgba(148, 163, 184, .2);
  background: transparent;
  color: #26364d;
  text-align: left;
  cursor: pointer;
}

.temporary-channel-option:last-of-type {
  border-bottom: 0;
}

.temporary-channel-option strong {
  font-size: 13px;
}

.temporary-channel-option span {
  color: #66758a;
  font-size: 12px;
}

.temporary-channel-option.selected {
  background: rgba(19, 117, 247, .1);
}

.temporary-channel-option:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.temporary-channel-more,
.temporary-channel-results > .muted {
  margin: 0;
  padding: 8px 10px;
  font-size: 12px;
}
.temporary-channel-field { grid-column: span 2; }
.temporary-credit-form .form-field textarea {
  width: 100%;
  min-height: 86px;
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 10px;
  background: rgba(255, 255, 255, .68);
  resize: vertical;
}
.temporary-credit-form .form-field input[readonly] {
  color: #647387;
  background: rgba(248, 250, 252, .82);
}
.temporary-credit-actions {
  grid-column: 1 / -1;
  display: flex;
  justify-content: flex-end;
  gap: 9px;
}
.temporary-credit-table-wrapper {
  overflow-x: auto;
  overscroll-behavior-x: contain;
}
.temporary-credit-table {
  min-width: 2600px;
}
.temporary-credit-table th,
.temporary-credit-table td {
  min-width: 132px;
  padding: 12px 18px;
  font-size: 13px;
  line-height: 1.55;
}
.temporary-credit-table th + th,
.temporary-credit-table td + td {
  border-left: 1px solid rgba(148, 163, 184, .18);
}
.temporary-credit-table td:first-child {
  min-width: 150px;
}
.temporary-credit-table td:last-child,
.temporary-credit-table th:last-child {
  min-width: 170px;
}
.temporary-credit-pending-row td {
  background: rgba(245, 158, 11, .08);
}

.temporary-credit-editing-row td {
  background: rgba(19, 117, 247, .1);
}
.temporary-credit-approval-modal .form-field { margin: 16px; }
.temporary-credit-approval-modal textarea {
  width: 100%;
  min-height: 108px;
  padding: 10px 12px;
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
  resize: vertical;
}
.temporary-credit-approval-modal footer {
  display: flex;
  justify-content: flex-end;
  gap: 9px;
  padding: 0 16px 16px;
}
.temporary-credit-approval-modal .reject-button {
  border: 0;
  border-radius: 10px;
  padding: 10px 15px;
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #b91c1c);
  cursor: pointer;
}
.temporary-credit-table .approve-button { color: #047857; }
.temporary-credit-table .reject-button { color: #b91c1c; }
.temporary-credit-table .delete-button { color: #b91c1c; }
.temporary-credit-table button:disabled { cursor: not-allowed; opacity: .45; }
.temporary-credit-repayment-modal {
  min-width: min(920px, 94vw);
}
.temporary-credit-repayment-modal header {
  gap: 10px;
}
.temporary-credit-repayment-add {
  margin-left: auto;
  white-space: nowrap;
}
.temporary-credit-repayment-modal header .modal-close {
  margin-left: 0;
}
.temporary-credit-repayment-totals {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  padding: 0 16px;
}
.temporary-credit-repayment-total {
  display: grid;
  gap: 5px;
  padding: 11px 13px;
  border: 1px solid rgba(203, 213, 225, .55);
  border-radius: 10px;
  background: rgba(248, 250, 252, .8);
}
.temporary-credit-repayment-total span {
  color: #647387;
  font-size: 12px;
}
.temporary-credit-repayment-total strong {
  color: #223247;
  font-size: 15px;
}
.temporary-credit-repayment-wrapper {
  max-height: min(52vh, 460px);
  overflow: auto;
  margin: 14px 16px;
}
.temporary-credit-repayment-table {
  width: 100%;
  min-width: 760px;
  table-layout: fixed;
}
.temporary-credit-repayment-table th:nth-child(1),
.temporary-credit-repayment-table td:nth-child(1) { width: 14%; }
.temporary-credit-repayment-table th:nth-child(2),
.temporary-credit-repayment-table td:nth-child(2) { width: 16%; }
.temporary-credit-repayment-table th:nth-child(3),
.temporary-credit-repayment-table td:nth-child(3) { width: 16%; }
.temporary-credit-repayment-table th:nth-child(4),
.temporary-credit-repayment-table td:nth-child(4) { width: 13%; }
.temporary-credit-repayment-table th:nth-child(5),
.temporary-credit-repayment-table td:nth-child(5) { width: 14%; }
.temporary-credit-repayment-table th:nth-child(6),
.temporary-credit-repayment-table td:nth-child(6) { width: 14%; }
.temporary-credit-repayment-table th:nth-child(7),
.temporary-credit-repayment-table td:nth-child(7) { width: 13%; }
.temporary-credit-repayment-table input[type='month'],
.temporary-credit-repayment-table input[type='number'] {
  width: 100%;
  min-width: 0;
  box-sizing: border-box;
  padding: 6px 8px;
  border: 1px solid rgba(203, 213, 225, .75);
  border-radius: 8px;
  background: rgba(255, 255, 255, .85);
  font-size: 12.5px;
}
.temporary-credit-repayment-table tr.repayment-paid td {
  background: rgba(16, 185, 129, .09);
}
.temporary-credit-repayment-table tr.repayment-shortfall td,
.temporary-credit-repayment-table tr.repayment-overdue td {
  background: rgba(239, 68, 68, .1);
}
.repayment-status {
  display: inline-flex;
  align-items: center;
  padding: 4px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}
.repayment-status.paid {
  color: #047857;
  background: rgba(16, 185, 129, .16);
}
.repayment-status.shortfall,
.repayment-status.overdue {
  color: #b91c1c;
  background: rgba(239, 68, 68, .16);
}
.repayment-status.draft {
  color: #647387;
  background: rgba(148, 163, 184, .18);
}
.temporary-credit-repayment-modal footer {
  display: flex;
  justify-content: flex-end;
  padding: 0 16px 16px;
}
.sales-credit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(184px, 1fr));
  gap: 10px;
}
.sales-credit-item {
  min-width: 0;
  display: grid;
  gap: 7px;
  padding: 12px 14px;
  border: 1px solid rgba(203, 213, 225, .5);
  border-radius: 8px;
  background: rgba(255, 255, 255, .65);
}
.sales-credit-item > span {
  color: #5f6d80;
  font-size: 12px;
  line-height: 1.4;
}
.sales-credit-item > strong {
  color: #223247;
  font-size: 14.5px;
  line-height: 1.45;
  overflow-wrap: anywhere;
}
.sales-credit-item:first-child { grid-column: 1 / -1; }
.credit-repayment-details {
  margin-top: 12px;
  border: 1px solid rgba(203, 213, 225, .48);
  border-radius: 8px;
  background: rgba(255, 255, 255, .48);
}
.credit-repayment-details summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 44px;
  padding: 10px 14px;
  border-radius: 8px;
  cursor: pointer;
  color: #26364a;
  font-weight: 700;
}
.credit-repayment-details summary::-webkit-details-marker { display: none; }
.credit-repayment-details summary::after {
  content: '▾';
  flex: 0 0 auto;
  color: #5f6d80;
  transition: transform .16s ease;
}
.credit-repayment-details:not([open]) summary::after { transform: rotate(-90deg); }
.credit-repayment-details summary > span { flex: 1 1 auto; }
.credit-repayment-details summary > small {
  flex: 2 1 320px;
  color: #657386;
  font-weight: 500;
  text-align: right;
}
.credit-repayment-details[open] summary { border-bottom: 1px solid rgba(203, 213, 225, .48); }
.credit-repayment-details > *:not(summary) { padding: 0 14px; }
.credit-repayment-details > *:last-child { padding-bottom: 14px; }
.credit-repayment-table-wrapper { margin: 14px 0; }
.credit-repayment-table { min-width: 760px; }
.credit-repayment-totals {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(158px, 1fr));
  gap: 10px;
  margin-top: 14px;
}
.credit-repayment-total {
  display: grid;
  gap: 5px;
  padding: 11px 12px;
  border: 1px solid rgba(203, 213, 225, .44);
  border-radius: 8px;
  background: rgba(255, 255, 255, .72);
}
.credit-repayment-total span { color: #647387; font-size: 12px; }
.credit-repayment-total strong { color: #1f2f45; font-size: 14px; }
.reconciliation-button { min-width: 58px; }
.amount-sort-button {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  width: 12px;
  height: 14px;
  margin-left: 3px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #8b99ac;
  cursor: pointer;
  line-height: 1;
  vertical-align: middle;
}
.amount-sort-button span { display: block; font-size: 7px; line-height: 7px; }
.amount-sort-button span.active { color: #1064dd; }
.table-actions { display: flex; gap: 7px; }
.table-actions button {
  padding: 6px 10px;
  border: 1px solid rgba(19, 117, 247, .22);
  border-radius: 9px;
  background: rgba(255, 255, 255, .58);
  color: #1064dd;
  font-size: 12px;
  transition: background .16s ease, border-color .16s ease;
}
.table-actions button:hover { background: rgba(255, 255, 255, .82); border-color: rgba(19, 117, 247, .4); }
.danger-button { background: rgba(239, 68, 68, .12) !important; color: #d92d20 !important; border-color: rgba(239, 68, 68, .35) !important; }
.form-warning { color: #b42318; font-weight: 600; }
.empty-table { padding: 48px !important; color: #5a6a80; text-align: center; }
.pagination { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 10px; padding-top: 15px; font-size: 13px; color: #526070; }
.pagination > button:disabled { background: rgba(255, 255, 255, .48); color: #8b99ac; box-shadow: none; cursor: not-allowed; transform: none; filter: none; }
.page-size { display: flex; align-items: center; gap: 6px; }
.page-size select { padding: 7px 8px; border: 1px solid rgba(203, 213, 225, .72); border-radius: 9px; background: rgba(255, 255, 255, .68); }
.page-jump { display: flex; align-items: center; gap: 6px; }
.page-jump input { width: 62px; padding: 7px 8px; border: 1px solid rgba(203, 213, 225, .72); border-radius: 9px; background: rgba(255, 255, 255, .68); text-align: center; }

.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(15, 23, 42, .42);
  -webkit-backdrop-filter: blur(10px) saturate(120%);
  backdrop-filter: blur(10px) saturate(120%);
}
.modal {
  width: min(960px, 100%);
  max-height: min(86vh, 900px);
  overflow: auto;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 20px;
  background: rgba(255, 255, 255, .78);
  box-shadow: 0 28px 80px rgba(1, 19, 38, .28), var(--glass-inset);
  -webkit-backdrop-filter: blur(24px) saturate(160%);
  backdrop-filter: blur(24px) saturate(160%);
}
.editor-modal { padding: 0; }
.editor-modal header, .editor-modal footer { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 18px 22px; }
.editor-modal header { border-bottom: 1px solid rgba(148, 163, 184, .22); }
.editor-modal footer { justify-content: flex-end; border-top: 1px solid rgba(148, 163, 184, .22); }
.editor-modal h3 { margin: 0; }
.modal-close { width: 32px; height: 32px; border: 1px solid var(--glass-border-soft); border-radius: 10px; background: rgba(255, 255, 255, .6); color: #526070; font-size: 20px; line-height: 1; transition: background .16s ease; }
.modal-close:hover { background: rgba(255, 255, 255, .88); }
.editor-grid { display: grid; grid-template-columns: repeat(4, minmax(180px, 1fr)); gap: 14px; padding: 20px 22px; }
.password-grid { grid-template-columns: repeat(2, minmax(220px, 1fr)); }
.password-modal header > div { display: grid; gap: 4px; }
.season-policy-modal { width: min(720px, 100%); }
.season-policy-grid { grid-template-columns: 1fr; }
.form-field textarea {
  width: 100%;
  min-height: 128px;
  padding: 11px 12px;
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 11px;
  background: rgba(255, 255, 255, .52);
  resize: vertical;
  font: inherit;
}

.contracts-modal { width: min(860px, 100%); }
.contracts-body { padding: 18px 22px 22px; }
.contract-upload-form {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 12px;
  align-items: end;
  padding-bottom: 16px;
  margin-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, .28);
}
.contract-upload-field { margin: 0; }
.contract-upload-message {
  grid-column: 1 / -1;
  margin: 0;
  color: #047857;
  font-size: 13px;
}
.contracts-table { width: 100%; }
.contracts-table th, .contracts-table td { padding: 10px 12px; font-size: 13px; }
.contracts-empty { padding: 40px 0; text-align: center; }
.contracts-error { color: #d92d20; padding: 24px 0; text-align: center; }
.dashboard-contracts-button { min-height: 38px; padding: 8px 14px; }
.dashboard-contracts-modal { width: min(1160px, 100%); }
.dashboard-contracts-search {
  display: flex;
  gap: 10px;
  padding: 18px 22px 0;
}
.dashboard-contracts-search input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 38px;
  padding: 8px 11px;
  border: 1px solid rgba(203, 213, 225, .72);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
}
.dashboard-contracts-search button { min-height: 38px; padding: 8px 14px; }
.dashboard-contracts-modal .contracts-body { overflow-x: auto; }
.dashboard-contracts-modal .contracts-table { min-width: 1020px; }
.dashboard-contracts-modal .contracts-table th,
.dashboard-contracts-modal .contracts-table td {
  padding: 12px 16px;
  line-height: 1.45;
  white-space: normal;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.dashboard-contracts-modal .contracts-table th:nth-child(1),
.dashboard-contracts-modal .contracts-table td:nth-child(1) { width: 16%; }
.dashboard-contracts-modal .contracts-table th:nth-child(2),
.dashboard-contracts-modal .contracts-table td:nth-child(2) { width: 11%; }
.dashboard-contracts-modal .contracts-table th:nth-child(3),
.dashboard-contracts-modal .contracts-table td:nth-child(3) { width: 24%; }
.dashboard-contracts-modal .contracts-table th:nth-child(4),
.dashboard-contracts-modal .contracts-table td:nth-child(4) { width: 12%; }
.dashboard-contracts-modal .contracts-table th:nth-child(5),
.dashboard-contracts-modal .contracts-table td:nth-child(5) { width: 8%; }
.dashboard-contracts-modal .contracts-table th:nth-child(6),
.dashboard-contracts-modal .contracts-table td:nth-child(6) { width: 14%; }
.dashboard-contracts-modal .contracts-table th:nth-child(7),
.dashboard-contracts-modal .contracts-table td:nth-child(7) { width: 12%; }
.dashboard-contracts-modal .contracts-table td:last-child { white-space: nowrap; }
.dashboard-contracts-pagination { padding-top: 14px; }

.source-document-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  cursor: pointer;
}
.source-document-amount { min-width: 0; }
.source-document-icon {
  padding: 1px 4px;
  border: 1px solid rgba(37, 99, 235, .22);
  border-radius: 999px;
  background: rgba(37, 99, 235, .08);
  color: rgba(37, 99, 235, .88);
  font-size: 10px;
  line-height: 1.2;
  white-space: nowrap;
}
.source-document-button:hover, .source-document-button:focus-visible {
  background: rgba(37, 99, 235, .10);
  outline: none;
}
.credit-edit-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  padding: 2px 4px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-variant-numeric: tabular-nums;
  text-align: right;
  cursor: pointer;
}
.credit-edit-button:hover, .credit-edit-button:focus-visible {
  background: rgba(37, 99, 235, .10);
  outline: none;
}
.dashboard-documents-modal { width: min(1120px, 100%); }
.dashboard-documents-body { padding: 18px 22px 22px; overflow-x: auto; }
.dashboard-documents-table { min-width: 1080px; }
.document-items-table { min-width: 760px; }
.dashboard-documents-table th,
.dashboard-documents-table td {
  padding: 11px 14px;
  line-height: 1.45;
  white-space: normal;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.dashboard-documents-table .document-id-cell { width: 16%; font-variant-numeric: tabular-nums; }
.dashboard-documents-table .document-mode-cell { width: 15%; }
.dashboard-documents-table .document-remark-cell { width: 26%; color: #47566d; }
.document-detail-row > td { padding: 0 14px 14px 34px; background: rgba(248, 250, 252, .92); }
.document-items-wrapper { border: 1px solid #e2e6eb; border-radius: 10px; }
.document-items-table { min-width: 760px; }
.document-items-table th, .document-items-table td {
  padding: 9px 12px;
  line-height: 1.4;
  white-space: normal;
  vertical-align: top;
}
.dashboard-documents-pagination { padding-top: 14px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media (max-width: 1000px) {
  .app-shell { grid-template-columns: 1fr; grid-template-rows: auto minmax(0, 1fr); }
  .sidebar { z-index: 2; height: auto; max-height: none; min-height: auto; border-right: 0; border-bottom: 1px solid #e2e6eb; }
  .brand { min-height: 58px; padding-bottom: 8px; }
  .sidebar nav { display: flex; overflow-x: auto; }
  .sidebar a, .sidebar button.nav-group { min-width: 168px; }
  .sidebar-footer { margin-top: 10px; }
  .kpi-grid, .panel-grid { grid-template-columns: 1fr; }
  .market-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dashboard-chart-layout { grid-template-columns: 1fr; }
  .market-layout { grid-template-columns: 1fr; }
  .market-cooperation-filter { align-items: start; }
  .market-cooperation-filter .muted { padding-bottom: 0; }
  .market-region-groups { grid-template-columns: 1fr; }
  .market-region-filter { grid-template-columns: 1fr 1fr; }
  .filter-grid, .editor-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-dashboard-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .sales-dashboard-filters .sales-company-filter,
  .sales-dashboard-filters input,
  .sales-dashboard-filters .primary-button,
  .sales-dashboard-filters .ghost-button { grid-column: auto; }
  .channel-filter .filter-actions { grid-column: 1 / -1; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .pagination { justify-content: flex-start; }
}

@media (max-width: 700px) {
  .main { padding: 16px; }
  .user-form { grid-template-columns: 1fr; }
  .page-header { align-items: start; flex-direction: column; }
  .filter-grid, .editor-grid { grid-template-columns: 1fr; }
  .sales-dashboard-filters { grid-template-columns: 1fr; }
  .sales-dashboard-filters .sales-company-filter { grid-column: auto; }
  .market-kpis { grid-template-columns: 1fr; }
  .dashboard-kpis { grid-template-columns: 1fr; }
  .dashboard-chart-body { grid-template-columns: 1fr; justify-items: center; }
  .market-region-filter { grid-template-columns: 1fr; }
  .market-expansion-filter-grid { grid-template-columns: 1fr; }
  .market-map-tooltip { left: 10px; right: 10px; min-width: 0; }
  .subnav { margin-left: 16px; }
}
