:root {
  --bg: #edf2f8;
  --panel: #ffffff;
  --ink: #101927;
  --muted: #65748a;
  --line: #d8e1ee;
  --brand: #90a9d4;
  --brand-dark: #5f79a5;
  --accent: #b8cdf0;
  --navy: #061426;
  --steel: #7186a8;
  --ice: #e9f1ff;
  --ok: #248a58;
  --warn: #b66b00;
  --shadow: 0 24px 60px rgba(16, 25, 39, 0.13);
  --soft-shadow: 0 12px 30px rgba(16, 25, 39, 0.08);
  --radius: 18px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  display: grid;
  grid-template-columns: 292px 1fr;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.72), rgba(255, 255, 255, 0) 280px),
    var(--bg);
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

body.sidebar-collapsed {
  grid-template-columns: 92px 1fr;
}

body.admin-locked .nav,
body.admin-locked .sidebar,
body.admin-locked .topbar,
body.admin-locked .view {
  display: none;
}

body.admin-locked {
  grid-template-columns: 1fr;
}

body:not(.admin-locked) .admin-gate {
  display: none;
}

button, input, select {
  font: inherit;
}

button {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  border-radius: 14px;
  padding: 10px 14px;
  cursor: pointer;
  font-weight: 700;
  transition: border-color 160ms ease, background 160ms ease, color 160ms ease, transform 160ms ease;
}

button:hover { border-color: var(--brand); color: var(--brand-dark); transform: translateY(-1px); }
button:disabled { cursor: not-allowed; opacity: 0.56; transform: none; }

.primary {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.primary:hover { background: var(--brand-dark); color: #fff; }

input, select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 12px;
  background: #fff;
  color: var(--ink);
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

input:focus, select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(144, 169, 212, 0.24);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  min-height: 0;
  padding: 18px 14px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(247, 250, 254, 0.94)),
    radial-gradient(circle at 0% 0%, rgba(144, 169, 212, 0.28), transparent 32%);
  color: var(--ink);
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow: hidden;
  border-right: 1px solid rgba(144, 169, 212, 0.30);
  box-shadow: 16px 0 44px rgba(70, 88, 120, 0.13);
  transition: width 240ms ease, padding 240ms ease;
  z-index: 20;
}

.brand {
  flex: 0 0 auto;
  display: grid;
  gap: 12px;
  place-items: center;
  min-height: 76px;
  padding: 14px;
  border: 1px solid rgba(144, 169, 212, 0.34);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(144, 169, 212, 0.18), rgba(255, 255, 255, 0.90)),
    rgba(255, 255, 255, 0.86);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.94), 0 12px 28px rgba(70, 88, 120, 0.08);
}

.brand-logo {
  width: 100%;
  max-width: 174px;
  height: auto;
  display: block;
  object-fit: contain;
  filter: drop-shadow(0 10px 18px rgba(144, 169, 212, 0.14));
}

.login-logo {
  width: 100%;
  max-width: 280px;
  justify-self: center;
  padding: 20px;
  border-radius: 20px;
  background: #02060c;
  object-fit: contain;
  box-shadow: inset 0 0 0 1px rgba(144, 169, 212, 0.2), 0 16px 38px rgba(5, 11, 21, 0.14);
}

.sidebar-toggle {
  position: absolute;
  top: 24px;
  right: -14px;
  width: 30px;
  height: 30px;
  padding: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--brand);
  box-shadow: var(--soft-shadow);
}

.brand strong, .brand small { display: block; }
.brand strong {
  letter-spacing: 1px;
}
.brand small { color: var(--muted); margin-top: 3px; }

.nav {
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 8px;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(95, 121, 165, 0.42) transparent;
  border: 1px solid rgba(144, 169, 212, 0.24);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.86);
}

.nav::-webkit-scrollbar {
  width: 6px;
}

.nav::-webkit-scrollbar-track {
  background: transparent;
}

.nav::-webkit-scrollbar-thumb {
  border-radius: 999px;
  background: rgba(95, 121, 165, 0.34);
}

.nav-link {
  width: 100%;
  min-width: 0;
  border-color: transparent;
  background: transparent;
  color: #51627a;
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  text-align: left;
  min-height: 44px;
  padding: 9px 11px;
  overflow: hidden;
  border-radius: 13px;
  box-shadow: none;
}

.nav-link strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
}

.nav-link:hover, .nav-link.active {
  background:
    linear-gradient(135deg, rgba(144, 169, 212, 0.28), rgba(233, 241, 255, 0.92)),
    #fff;
  color: var(--navy);
  border-color: rgba(144, 169, 212, 0.42);
  box-shadow: 0 10px 22px rgba(78, 96, 125, 0.10);
}

.nav-link.active::before {
  content: "";
  position: absolute;
  inset: 9px auto 9px 0;
  width: 4px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--brand-dark), var(--brand));
}

.nav-link span {
  flex: 0 0 28px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border-radius: 11px;
  background: rgba(144, 169, 212, 0.15);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(144, 169, 212, 0.12);
}

.nav-link svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.nav-link:hover span,
.nav-link.active span {
  background: #fff;
  color: var(--brand-dark);
  box-shadow: inset 0 0 0 1px rgba(144, 169, 212, 0.24), 0 8px 18px rgba(70, 88, 120, 0.10);
}

.sidebar-profile {
  flex: 0 0 auto;
  margin-top: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px;
  border: 1px solid rgba(144, 169, 212, 0.30);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(144, 169, 212, 0.18), rgba(255, 255, 255, 0.92)),
    #fff;
  box-shadow: 0 10px 24px rgba(70, 88, 120, 0.08);
  backdrop-filter: blur(12px);
}

.sidebar-profile > div:last-child {
  min-width: 0;
}

.sidebar-profile strong,
.sidebar-profile small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

#logoutBtn {
  flex: 0 0 auto;
  width: 100%;
  min-height: 42px;
  border-color: rgba(144, 169, 212, 0.34);
  background: rgba(255, 255, 255, 0.78);
  color: var(--brand-dark);
  border-radius: 14px;
}

.avatar {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 15px;
  background: linear-gradient(135deg, var(--brand), var(--ice));
  color: var(--navy);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.66);
}

.sidebar-profile strong, .sidebar-profile small { display: block; }
.sidebar-profile small { color: var(--muted); margin-top: 2px; }

body.sidebar-collapsed .sidebar { align-items: center; }
body.sidebar-collapsed .brand div,
body.sidebar-collapsed .nav-link strong,
body.sidebar-collapsed .sidebar-profile div,
body.sidebar-collapsed #logoutBtn { display: none; }
body.sidebar-collapsed .brand {
  width: 100%;
  min-height: 58px;
  padding: 10px;
}
body.sidebar-collapsed .brand-logo {
  max-width: 46px;
}
body.sidebar-collapsed .nav {
  width: 100%;
  padding-inline: 6px;
}
body.sidebar-collapsed .nav-link { justify-content: center; width: 100%; padding-inline: 0; }
body.sidebar-collapsed .nav-link span { flex-basis: 32px; }
body.sidebar-collapsed .sidebar-profile {
  width: 100%;
  justify-content: center;
}
body.sidebar-collapsed .sidebar-toggle { transform: rotate(180deg); }

.auth-card {
  margin-top: auto;
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid #2c3b49;
  border-radius: 8px;
  background: #17232e;
}

.admin-gate .auth-card {
  width: min(460px, 100%);
  margin: 0;
  padding: 30px;
  border-color: rgba(255, 255, 255, 0.72);
  background: rgba(255, 255, 255, 0.84);
  color: var(--ink);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.auth-card h2 {
  margin: 0 0 4px;
  color: #fff;
  font-size: 17px;
}

.admin-gate .auth-card h1 {
  margin-bottom: 18px;
}

.admin-gate .auth-card label {
  color: var(--muted);
}

.admin-gate .auth-card p {
  color: var(--muted);
}

.auth-card label {
  color: #c7d1dc;
  font-size: 12px;
  font-weight: 700;
}

.auth-card p {
  margin: 4px 0 0;
  color: #b6c0cc;
  font-size: 12px;
  line-height: 1.4;
}

.main {
  min-width: 0;
  padding: 28px clamp(18px, 3vw, 34px);
}

.admin-gate {
  min-height: calc(100vh - 52px);
  display: grid;
  align-content: center;
  justify-items: center;
  padding: 42px;
}

.admin-gate h1 {
  margin-bottom: 10px;
}

.admin-gate p:last-child {
  margin-bottom: 0;
  color: var(--muted);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 24px;
  padding: 14px 0;
  background: rgba(238, 244, 248, 0.82);
  backdrop-filter: blur(18px);
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--brand);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 12px;
}

h1, h2, p { margin-top: 0; }
h1 { margin-bottom: 0; font-size: 34px; }
h2 { margin-bottom: 0; font-size: 18px; }

.toolbar {
  position: relative;
  display: grid;
  grid-template-columns: minmax(220px, 320px) auto auto;
  gap: 10px;
  align-items: center;
}

.search-shell {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  box-shadow: 0 1px 0 rgba(25, 38, 51, 0.03);
}

.search-shell input {
  border: 0;
  box-shadow: none;
  background: transparent;
  padding-inline: 0;
}

.icon-btn {
  width: 42px;
  height: 42px;
  padding: 0;
  border-radius: 999px;
  color: var(--brand-dark);
}

.notification-btn {
  position: relative;
  display: grid;
  place-items: center;
  background: #fff;
}

.notification-symbol {
  line-height: 1;
  font-size: 18px;
}

.notification-btn small {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  border: 2px solid #fff;
  border-radius: 999px;
  background: var(--brand-dark);
  color: #fff;
  font-size: 10px;
  font-weight: 900;
}

.notification-btn small.empty {
  background: var(--muted);
}

.notification-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 86px;
  z-index: 40;
  width: min(420px, calc(100vw - 32px));
  max-height: 520px;
  display: none;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.notification-panel.open {
  display: grid;
  animation: pageIn 180ms ease both;
}

.notification-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(135deg, rgba(144, 169, 212, 0.16), rgba(255, 255, 255, 0.72));
}

.notification-panel-head strong,
.notification-panel-head span {
  display: block;
}

.notification-panel-head span {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.notification-panel-head button {
  min-height: 34px;
  padding: 0 11px;
  border-radius: 10px;
}

.notification-panel-actions {
  display: flex;
  gap: 8px;
  align-items: center;
}

.notification-list {
  display: grid;
  gap: 8px;
  max-height: 430px;
  overflow: auto;
  padding: 12px;
}

.notification-item {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.notification-item > span {
  align-self: start;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(144, 169, 212, 0.18);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.notification-item strong,
.notification-item small {
  display: block;
  overflow-wrap: anywhere;
}

.notification-item small {
  margin-top: 4px;
  color: var(--muted);
  font-weight: 700;
}

.pulse {
  animation: pulseGlow 2.4s ease-in-out infinite;
}

.view { display: none; }
.view.active { display: block; }

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 18px;
  margin-bottom: 18px;
}

body.is-loading .panel,
body.is-loading .stat {
  position: relative;
}

body.is-loading .panel::after,
body.is-loading .stat::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.5), transparent);
  animation: shimmer 1.1s ease-in-out infinite;
  pointer-events: none;
}

.stat, .panel, .details-panel {
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--soft-shadow);
  backdrop-filter: blur(10px);
}

.stat {
  position: relative;
  padding: 22px;
  min-height: 154px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
}

.stat::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  background: linear-gradient(180deg, var(--brand), var(--accent));
}

.stat::after {
  content: "";
  position: absolute;
  right: -42px;
  top: -42px;
  width: 110px;
  height: 110px;
  border-radius: 999px;
  background: rgba(144, 169, 212, 0.14);
}

.stat:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.stat span, .stat small, .panel-head span, .meta, .empty {
  color: var(--muted);
}

.stat strong {
  display: block;
  margin: 10px 0;
  font-size: clamp(28px, 3vw, 38px);
  line-height: 1;
}

.spark {
  display: flex;
  align-items: end;
  gap: 5px;
  height: 34px;
}

.spark i {
  flex: 1;
  min-width: 8px;
  border-radius: 999px 999px 4px 4px;
  background: linear-gradient(180deg, rgba(95, 121, 165, 0.95), rgba(144, 169, 212, 0.2));
  animation: rise 700ms ease both;
}

.spark i:nth-child(1) { height: 42%; }
.spark i:nth-child(2) { height: 72%; animation-delay: 60ms; }
.spark i:nth-child(3) { height: 54%; animation-delay: 120ms; }
.spark i:nth-child(4) { height: 88%; animation-delay: 180ms; }
.spark i:nth-child(5) { height: 64%; animation-delay: 240ms; }
.spark.line i { border-radius: 999px; height: 6px; align-self: center; }

.radial {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: conic-gradient(var(--brand) var(--progress, 0%), #e8eef4 0);
  color: var(--ink);
  font-size: 12px;
  font-weight: 900;
}

.chart-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.65fr);
  gap: 18px;
  margin-bottom: 18px;
}

.chart-panel {
  min-height: 260px;
}

.area-chart {
  display: flex;
  align-items: end;
  gap: 10px;
  height: 170px;
  padding: 18px;
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(144, 169, 212, 0.16), rgba(144, 169, 212, 0.04));
}

.area-chart span {
  flex: 1;
  min-width: 16px;
  border-radius: 999px 999px 8px 8px;
  background: linear-gradient(180deg, var(--brand-dark), rgba(144, 169, 212, 0.2));
  animation: rise 700ms ease both;
}

.donut-wrap {
  display: grid;
  grid-template-columns: 150px 1fr;
  gap: 18px;
  align-items: center;
}

.donut-chart {
  width: 148px;
  height: 148px;
  border-radius: 999px;
  background: conic-gradient(var(--navy) 0 28%, var(--brand-dark) 28% 54%, var(--brand) 54% 78%, var(--ice) 78% 100%);
  box-shadow: inset 0 0 0 28px #fff, var(--soft-shadow);
}

.legend {
  display: grid;
  gap: 10px;
}

.legend span {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-weight: 800;
  font-size: 13px;
}

.legend i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--brand);
}

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

.panel {
  padding: 20px;
}

.form-panel {
  margin-bottom: 16px;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.employee-form-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 18px;
}

.employee-form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.checkbox-label {
  grid-template-columns: 18px 1fr;
  align-items: center;
  align-content: center;
  color: var(--ink) !important;
}

.employee-actions {
  display: grid;
  grid-template-columns: 64px minmax(118px, 0.9fr) minmax(150px, 1fr) minmax(102px, 0.8fr) 70px;
  gap: 8px;
  align-items: center;
  justify-content: end;
  min-width: 0;
}

.employee-actions button,
.employee-actions select {
  width: 100%;
  min-height: 34px;
  border-radius: 8px;
  padding: 7px 9px;
  font-size: 12px;
}

@media (max-width: 640px) {
  .employee-actions {
    grid-template-columns: 1fr;
  }
}

.danger {
  border-color: rgba(164, 68, 43, 0.26);
  color: #a4442b;
  background: #fff7f4;
}

.danger:hover {
  border-color: #a4442b;
  color: #7f2f1d;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
  padding: 0;
}

.list {
  display: grid;
  gap: 10px;
}

.dashboard-recent-list {
  max-height: 380px;
  overflow-y: auto;
  padding: 6px 8px 6px 0;
  scrollbar-gutter: stable;
}

.list-item, .employee-card, .data-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: 0 1px 0 rgba(25, 38, 51, 0.02);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.employee-card:hover, .data-card:hover {
  border-color: #bfd0df;
  box-shadow: var(--soft-shadow);
  transform: translateY(-1px);
}

.list-item {
  min-height: 104px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.list-item > div {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.list-item strong,
.list-item .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 16px;
  align-items: stretch;
}

#expenseGrid {
  grid-template-columns: repeat(3, minmax(320px, 1fr));
  align-items: start;
}

#expenseGrid.expense-table-mode {
  grid-template-columns: 1fr;
}

.employee-grid {
  display: grid;
  gap: 16px;
}

.employee-flat-list {
  display: grid;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.employee-card, .data-card {
  padding: 16px;
}

.employee-list-header,
.employee-list-row {
  display: grid;
  grid-template-columns: minmax(230px, 1.35fr) minmax(135px, 0.75fr) minmax(155px, 0.85fr) minmax(120px, 0.65fr) 84px minmax(500px, 1.55fr);
  gap: 10px;
  min-width: 1160px;
}

.employee-list-header {
  align-items: center;
  padding: 0 14px 8px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.employee-list-header span:last-child {
  text-align: right;
}

.employee-list-row {
  align-items: center;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(25, 38, 51, 0.03);
  transition: border-color 160ms ease, box-shadow 160ms ease, transform 160ms ease;
}

.employee-hierarchy {
  display: grid;
  gap: 12px;
}

.employee-hierarchy-head,
.hierarchy-group header,
.hierarchy-rsm-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
}

.employee-hierarchy-head {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(144, 169, 212, 0.18), rgba(255, 255, 255, 0.95));
}

.employee-hierarchy-head h3,
.employee-hierarchy-head p {
  margin: 0;
}

.employee-hierarchy-head p,
.hierarchy-group span,
.hierarchy-rsm-head span,
.hierarchy-asm-list small {
  color: var(--muted);
  font-weight: 800;
}

.hierarchy-group {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.hierarchy-group header div,
.hierarchy-rsm-head div {
  display: grid;
  gap: 4px;
}

.hierarchy-actions {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.hierarchy-actions button,
.hierarchy-asm-list button {
  padding: 7px 10px;
  border-radius: 10px;
  font-size: 12px;
}

.hierarchy-children {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.management-select-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 12px;
  border: 1px solid #e7eef8;
  border-radius: 14px;
  background: #f8fbff;
}

.management-select-row.compact {
  padding: 0;
  border: 0;
  background: transparent;
}

.management-select-row select {
  min-width: 0;
}

.hierarchy-rsm {
  display: grid;
  gap: 12px;
  padding: 12px;
  border: 1px solid #e7eef8;
  border-radius: 14px;
  background: #f8fbff;
}

.hierarchy-asm-list {
  display: grid;
  gap: 8px;
}

.hierarchy-asm-list span,
.hierarchy-asm-list em {
  padding: 9px 10px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  font-style: normal;
  font-weight: 800;
}

.hierarchy-asm-list > span {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.hierarchy-asm-list small {
  display: block;
  margin-top: 2px;
}

.hierarchy-group.unassigned {
  border-style: dashed;
}

.employee-hierarchy {
  gap: 18px;
}

.employee-hierarchy-head {
  padding: 18px 20px;
  border-color: rgba(144, 169, 212, 0.32);
  background:
    linear-gradient(135deg, rgba(144, 169, 212, 0.22), rgba(255, 255, 255, 0.98) 64%),
    #fff;
  box-shadow: var(--soft-shadow);
}

.employee-hierarchy-head h3 {
  font-size: 18px;
  letter-spacing: 0;
}

.employee-hierarchy-head > span {
  padding: 10px 12px;
  border: 1px solid rgba(144, 169, 212, 0.34);
  border-radius: 999px;
  background: #fff;
  color: var(--brand-dark);
  white-space: nowrap;
}

.hierarchy-group {
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  border-color: rgba(144, 169, 212, 0.24);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.98), rgba(248,251,255,0.94)),
    #fff;
}

.hierarchy-group > header {
  padding: 0 0 14px;
  border-bottom: 1px solid #e7eef8;
}

.hierarchy-group > header strong {
  font-size: 18px;
}

.hierarchy-group > header span:not(.pill) {
  font-size: 13px;
}

.management-select-row {
  padding: 10px;
  border-color: #dce7f5;
  border-radius: 16px;
  background: #f6f9fe;
}

.management-select-row select {
  height: 42px;
  border-color: #dce7f5;
  background-color: #fff;
}

.management-select-row button {
  min-height: 42px;
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.hierarchy-children {
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 14px;
}

.hierarchy-rsm {
  padding: 14px;
  border-color: #dce7f5;
  border-radius: 16px;
  background: #fbfdff;
  box-shadow: 0 10px 24px rgba(16, 25, 39, 0.05);
}

.hierarchy-rsm-head {
  align-items: flex-start;
  padding-bottom: 10px;
  border-bottom: 1px solid #e7eef8;
}

.hierarchy-rsm-head > div:first-child strong {
  font-size: 15px;
}

.hierarchy-actions button,
.hierarchy-asm-list button {
  min-height: 34px;
  padding: 7px 10px;
  font-size: 11px;
}

.hierarchy-asm-list {
  gap: 7px;
}

.hierarchy-asm-list > span {
  min-height: 52px;
  padding: 10px;
  border: 1px solid #edf2f9;
  box-shadow: 0 1px 0 rgba(16, 25, 39, 0.03);
}

.hierarchy-asm-list > span > span {
  display: grid;
  gap: 2px;
  min-width: 0;
  padding: 0;
  background: transparent;
  border-radius: 0;
}

.hierarchy-asm-list > span strong {
  font-size: 13px;
  overflow-wrap: anywhere;
}

.hierarchy-asm-list em {
  border: 1px dashed #dce7f5;
  color: var(--muted);
  text-align: center;
}

.hierarchy-group.unassigned {
  background: #fff;
  border-color: #dce7f5;
}

.employee-hierarchy {
  gap: 14px;
}

.employee-hierarchy-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
}

.employee-hierarchy-head h3 {
  font-size: 16px;
}

.employee-hierarchy-head p {
  margin-top: 3px;
  font-size: 12px;
}

.employee-hierarchy-head > span {
  border-radius: 8px;
  font-size: 12px;
}

.hierarchy-group {
  gap: 12px;
  padding: 14px;
  border-radius: 8px;
  box-shadow: var(--soft-shadow);
}

.hierarchy-group > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding-bottom: 10px;
}

.hierarchy-group > header strong,
.hierarchy-rsm-head > div:first-child strong {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hierarchy-group > header strong {
  font-size: 16px;
}

.hierarchy-group > header span:not(.pill),
.hierarchy-rsm-head span {
  overflow-wrap: anywhere;
  font-size: 12px;
}

.management-select-row {
  grid-template-columns: minmax(0, 1fr) 96px;
  gap: 8px;
  padding: 8px;
  border-radius: 8px;
}

.management-select-row select,
.management-select-row button {
  min-height: 36px;
  height: 36px;
  border-radius: 8px;
  font-size: 12px;
}

.hierarchy-children {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.hierarchy-rsm {
  gap: 10px;
  padding: 14px;
  border-radius: 8px;
  box-shadow: none;
}

.hierarchy-rsm-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding-bottom: 8px;
}

.hierarchy-actions {
  display: grid;
  grid-template-columns: auto auto;
  gap: 6px;
  align-items: center;
}

.hierarchy-actions .pill {
  min-height: 30px;
  padding: 7px 10px;
  border-radius: 999px;
  font-size: 11px;
}

.hierarchy-actions button,
.hierarchy-asm-list button {
  min-height: 30px;
  border-radius: 8px;
  padding: 6px 8px;
}

.hierarchy-asm-list {
  --asm-row-height: 60px;
  display: grid;
  grid-auto-rows: var(--asm-row-height);
  gap: 8px;
  max-height: calc((var(--asm-row-height) * 3) + 16px);
  overflow-y: auto;
  padding: 2px 8px 2px 2px;
  scrollbar-gutter: stable;
}

.hierarchy-asm-list > span {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 62px;
  align-items: center;
  height: var(--asm-row-height);
  min-height: 0;
  box-sizing: border-box;
  gap: 10px;
  padding: 8px 9px 8px 10px;
  border-radius: 8px;
  border: 1px solid #e8eef7;
  background: #fff;
}

.hierarchy-asm-list > span > span {
  display: grid;
  gap: 2px;
  align-self: center;
  min-width: 0;
}

.hierarchy-asm-list button {
  width: 62px;
  min-width: 62px;
  min-height: 34px;
  align-self: center;
  justify-self: end;
  padding-inline: 6px;
  font-size: 11px;
}

.hierarchy-asm-list > span strong,
.hierarchy-asm-list > span small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hierarchy-asm-list > span strong {
  line-height: 1.25;
}

.hierarchy-asm-list > span small {
  line-height: 1.25;
}

.hierarchy-asm-list em {
  padding: 12px;
  border-radius: 8px;
}

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

.outstanding-layout {
  display: grid;
  gap: 16px;
  margin-bottom: 16px;
}

.upload-panel {
  display: grid;
  grid-template-rows: auto 1fr auto;
  align-content: start;
  min-height: 100%;
  padding: 16px;
  margin-bottom: 0;
}

.upload-panel .panel-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
}

.upload-panel .panel-head span:empty {
  display: none;
}

.upload-grid {
  display: grid;
  align-content: start;
  gap: 10px;
  margin-bottom: 12px;
}

.upload-panel > .primary {
  align-self: end;
}

.upload-grid label {
  display: grid;
  gap: 5px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.upload-grid input {
  min-height: 38px;
}

.pdf-category-radios {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.pdf-category-radios legend {
  grid-column: 1 / -1;
  margin-bottom: 2px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.pdf-category-radios label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
  color: var(--text);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.pdf-category-radios input {
  width: 16px;
  height: 16px;
  min-height: 0;
  accent-color: var(--brand);
}

.pdf-category-radios label:has(input:checked) {
  border-color: var(--brand);
  background: #eef5ff;
  box-shadow: 0 0 0 2px rgba(143, 166, 211, 0.14);
}

.recipient-checkbox-list {
  display: grid;
  gap: 8px;
  max-height: 92px;
  overflow: auto;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f8fbff;
}

.recipient-checkbox {
  display: grid !important;
  grid-template-columns: 18px 1fr;
  gap: 10px !important;
  align-items: start;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 12px;
  background: #fff;
  color: var(--ink) !important;
}

.recipient-checkbox input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  padding: 0;
}

.recipient-checkbox span {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.recipient-checkbox strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.recipient-checkbox small {
  color: var(--muted);
  font-weight: 800;
}

.pdf-recipient-editor {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
  margin-top: 10px;
  max-height: 86px;
  overflow: auto;
  padding: 8px;
  border: 1px solid #e8eef7;
  border-radius: 14px;
  background: #f8fbff;
}

.pdf-recipient-editor label {
  display: flex;
  gap: 8px;
  align-items: center;
  min-height: 34px;
  padding: 6px 8px;
  border-radius: 10px;
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.pdf-recipient-editor input {
  width: 16px;
  height: 16px;
  padding: 0;
}

.document-panel-head {
  align-items: center;
  gap: 10px;
}

.pdf-filter-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.pdf-filter-tabs button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.pdf-filter-tabs button.active {
  border-color: var(--brand);
  background: #eef5ff;
  color: var(--brand-dark);
}

.document-list,
.greeting-grid {
  display: grid;
  gap: 8px;
  max-height: 270px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.document-row,
.greeting-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 25, 39, 0.03);
}

.document-icon {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 10px;
  background: #eef4ff;
  color: var(--brand-dark);
  font-weight: 900;
  font-size: 11px;
}

.document-row strong,
.greeting-card strong {
  display: block;
  overflow-wrap: anywhere;
}

.document-row span,
.greeting-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.document-actions {
  display: flex;
  gap: 6px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.document-actions a {
  padding: 7px 10px;
  border: 1px solid var(--line);
  border-radius: 10px;
  color: var(--brand-dark);
  background: #fff;
  font-weight: 900;
  text-decoration: none;
}

.document-actions button {
  min-height: 34px;
  padding: 7px 10px;
}

.greeting-card {
  grid-template-columns: 76px minmax(0, 1fr) auto;
}

.greeting-card img {
  width: 76px;
  height: 58px;
  border: 1px solid var(--line);
  border-radius: 14px;
  object-fit: cover;
  background: #edf2f8;
}

.vendor-kyc-layout {
  align-items: start;
}

.vendor-kyc-list {
  display: grid;
  gap: 12px;
}

.vendor-kyc-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  text-align: left;
}

.vendor-kyc-row.active {
  border-color: rgba(85, 118, 178, 0.44);
  background: #f4f8ff;
  box-shadow: 0 14px 32px rgba(42, 68, 110, 0.08);
}

.vendor-kyc-row-main {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.vendor-kyc-row-main strong,
.vendor-kyc-row-main small {
  overflow-wrap: anywhere;
}

.vendor-kyc-row-main small,
.vendor-kyc-detail-head span,
.vendor-kyc-address span {
  color: var(--muted);
  font-weight: 800;
}

.vendor-kyc-detail {
  display: grid;
  gap: 14px;
}

.vendor-kyc-detail-card {
  display: grid;
  gap: 16px;
}

.vendor-kyc-detail-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: start;
}

.vendor-kyc-detail-head div {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.vendor-kyc-detail-head strong {
  overflow-wrap: anywhere;
  font-size: 20px;
}

.vendor-kyc-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.vendor-kyc-meta div,
.vendor-kyc-address {
  display: grid;
  gap: 4px;
  padding: 12px;
  border: 1px solid #e8eef7;
  border-radius: 16px;
  background: #f8fbff;
}

.vendor-kyc-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.vendor-kyc-meta strong,
.vendor-kyc-address strong {
  overflow-wrap: anywhere;
}

.vendor-kyc-documents {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.vendor-kyc-document {
  display: grid;
  gap: 8px;
  min-height: 156px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  color: var(--ink);
  font-weight: 900;
  text-decoration: none;
  text-align: left;
  cursor: zoom-in;
}

.vendor-kyc-document span {
  color: var(--muted);
  font-size: 12px;
}

.vendor-kyc-document img {
  width: 100%;
  height: 112px;
  border-radius: 14px;
  object-fit: cover;
  background: #edf2f8;
}

.vendor-kyc-document.missing {
  place-content: center;
  text-align: center;
  border-style: dashed;
  background: #fbfcfe;
}

.vendor-kyc-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.vendor-kyc-actions button {
  padding: 10px 14px;
}

.diamond-request-layout {
  align-items: start;
}

.diamond-request-list,
.diamond-history-list {
  display: grid;
  gap: 12px;
}

.diamond-history-list {
  max-height: 552px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-gutter: stable;
}

.diamond-request-row,
.diamond-history-row {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.7fr) auto;
  gap: 12px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
}

.diamond-history-row {
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
}

.diamond-request-main,
.diamond-history-row > div,
.diamond-request-meta {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.diamond-request-main strong,
.diamond-history-row strong {
  overflow-wrap: anywhere;
}

.diamond-request-main span,
.diamond-request-meta span,
.diamond-history-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.reply-dialog {
  width: min(560px, calc(100vw - 32px));
  padding: 0;
  border: 0;
  border-radius: 24px;
  background: transparent;
}

.reply-dialog::backdrop {
  background: rgba(15, 23, 42, 0.46);
  backdrop-filter: blur(3px);
}

.reply-dialog-card {
  display: grid;
  gap: 16px;
  padding: 20px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.reply-dialog-card label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.reply-dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.outstanding-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.outstanding-form-grid label {
  display: grid;
  gap: 7px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.outstanding-form-grid .wide {
  grid-column: 1 / -1;
}

#outstandingUserIds {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: 248px;
}

#outstandingUserIds .recipient-checkbox {
  min-height: 42px;
}

.outstanding-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.outstanding-employee-card {
  display: grid;
  grid-template-rows: auto auto 1fr;
  gap: 12px;
  height: 100%;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.outstanding-employee-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.outstanding-employee-card .employee-identity > div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.outstanding-employee-card .employee-identity span:not(.employee-avatar) {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.outstanding-employee-summary {
  display: grid;
  place-items: center;
  min-width: 78px;
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--soft);
}

.outstanding-employee-summary strong {
  color: var(--brand-dark);
  font-size: 18px;
  line-height: 1;
}

.outstanding-employee-summary span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.outstanding-upload-form {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8fbff;
}

.outstanding-upload-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  min-width: 0;
}

.outstanding-upload-form input {
  width: 100%;
}

.outstanding-upload-form button {
  width: 100%;
  min-height: 42px;
}

.outstanding-upload-form [data-outstanding-upload-status] {
  color: var(--steel);
  font-size: 12px;
  font-weight: 800;
}

.outstanding-records {
  display: grid;
  gap: 10px;
  max-height: 206px;
  overflow-y: auto;
  padding-right: 4px;
}

.outstanding-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) max-content;
  gap: 8px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfdff;
}

.outstanding-row > div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.outstanding-row strong {
  overflow-wrap: anywhere;
}

.outstanding-row span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  overflow-wrap: anywhere;
}

.outstanding-row small {
  color: var(--steel);
  font-size: 12px;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.outstanding-row .document-actions {
  display: inline-flex;
  justify-content: flex-end;
  flex-wrap: nowrap;
  gap: 6px;
}

.outstanding-row .document-actions a,
.outstanding-row .document-actions button {
  flex: 0 0 auto;
  min-height: 30px;
  padding: 6px 8px;
  font-size: 12px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.quotation-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
  width: 100%;
}

.quotation-card {
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

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

.quotation-card header div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.quotation-card header span:first-child {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.quotation-card header strong {
  overflow-wrap: anywhere;
  font-size: 18px;
}

.quotation-card header small,
.quotation-card p {
  color: var(--muted);
  font-weight: 800;
}

.quotation-card p {
  margin: 0;
  line-height: 1.5;
}

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

.quotation-details div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #e8eef7;
  border-radius: 12px;
  background: #f8fbff;
}

.quotation-details span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quotation-details strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.quotation-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
  flex-wrap: wrap;
}

.quotation-actions button {
  min-width: 110px;
}

.quotation-actions .success {
  background: var(--ok);
  border-color: var(--ok);
  color: #fff;
}

.quotation-actions .warning {
  background: var(--warn);
  border-color: var(--warn);
  color: #fff;
}

.quotation-summary {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
  margin-bottom: 14px;
}

.quotation-summary > div {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.quotation-summary button {
  min-height: 34px;
  padding: 8px 12px;
  border-radius: 10px;
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

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

.quotation-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.35fr) minmax(110px, 0.65fr) minmax(110px, 0.65fr) minmax(170px, 0.9fr) auto minmax(210px, auto);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 1px 0 rgba(16, 25, 39, 0.03);
}

.quotation-main,
.quotation-list-details {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.quotation-main span,
.quotation-list-details span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quotation-main strong,
.quotation-list-details strong {
  overflow-wrap: anywhere;
}

.quotation-main small {
  color: var(--muted);
  font-weight: 800;
}

.quotation-table {
  display: grid;
  gap: 0;
  width: 100%;
  max-height: calc(100vh - 220px);
  overflow-x: auto;
  overflow-y: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
}

.quotation-table-row {
  display: grid;
  grid-template-columns: minmax(210px, 1.25fr) minmax(150px, 0.95fr) minmax(120px, 0.75fr) minmax(150px, 0.9fr) minmax(105px, 0.65fr) minmax(95px, 0.55fr) minmax(105px, 0.55fr) minmax(230px, 1.15fr);
  gap: 10px;
  align-items: center;
  min-width: 1280px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.quotation-table-head {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #f8fbff;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.quotation-table-row:last-child {
  border-bottom: 0;
}

.quotation-table-row:not(.quotation-table-head):hover {
  background: #fbfdff;
}

.quotation-table-row.quotation-approved {
  border-left: 4px solid var(--ok);
}

.quotation-table-row.quotation-rejected {
  border-left: 4px solid #a4442b;
}

.quotation-table-row.quotation-pending {
  border-left: 4px solid var(--warn);
}

.quotation-table-row > strong,
.quotation-table-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.quotation-items-cell {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-height: 66px;
  overflow-y: auto;
  padding-right: 4px;
}

.quotation-customer-cell {
  display: grid;
  gap: 4px;
}

.quotation-customer-cell b {
  color: #152033;
}

.quotation-customer-cell small {
  color: var(--muted);
  font-weight: 800;
}

.quotation-item-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  padding: 5px 7px;
  border: 1px solid #d8e3f1;
  border-radius: 8px;
  background: #f8fbff;
  color: #14243a;
  font-size: 12px;
  font-weight: 900;
  line-height: 1.1;
}

.quotation-item-chip small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.quotation-item-chip.more {
  background: #eef4fb;
  color: var(--muted);
}

.quotation-table-row .quotation-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
}

.quotation-table-row .quotation-actions button {
  min-width: auto;
  min-height: 30px;
  padding: 6px 9px;
  border-radius: 8px;
  font-size: 12px;
}

.quotation-actions .compact.success {
  border-color: rgba(16, 137, 77, 0.24);
  background: #eaf8f0;
  color: #10894d;
}

.quotation-actions .compact.warning {
  border-color: rgba(190, 112, 0, 0.26);
  background: #fff3de;
  color: #b66700;
}

.quotation-actions .compact.danger {
  border-color: rgba(211, 47, 47, 0.24);
  background: #fff0f0;
  color: #d32f2f;
}

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

.quotation-pdf-list {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.quotation-pdf-row {
  display: flex;
  align-items: center;
  gap: 5px;
}

.quotation-pdf-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  margin-top: 4px;
}

.quotation-pdf-name-input {
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 500;
  color: var(--ink);
  background: #fff;
  width: 140px;
}

.quotation-pdf-file-label {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f4f7fb;
  color: var(--ink);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.quotation-pdf-file-label input[type="file"] {
  width: 0;
  height: 0;
  opacity: 0;
  position: absolute;
  pointer-events: none;
}

.quotation-pdf-file-label:has(input:not([value=""]):not([value])) {
  border-color: rgba(16, 137, 77, 0.4);
  background: #eaf8f0;
  color: #10894d;
}

.quotation-pdf-status {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.quotation-pdf-link {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 9px;
  border: 1px solid rgba(16, 137, 77, 0.3);
  border-radius: 8px;
  background: #eaf8f0;
  color: #10894d;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.tour-calendar-layout {
  display: grid;
  grid-template-columns: minmax(280px, 360px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.tour-calendar-card {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.92));
  box-shadow: var(--soft-shadow);
}

.tour-calendar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.tour-calendar-head button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-radius: 12px;
  font-size: 22px;
  line-height: 1;
}

.tour-calendar-head strong {
  text-align: center;
}

.tour-calendar {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 7px;
}

.tour-weekday {
  padding: 4px 0;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-align: center;
  text-transform: uppercase;
}

.tour-day {
  min-height: 44px;
  display: grid;
  place-items: center;
  gap: 1px;
  padding: 6px 4px;
  border-radius: 13px;
  border-color: transparent;
  background: #f8fbff;
  color: var(--ink);
}

.tour-day:hover {
  border-color: var(--brand);
  background: #fff;
}

.tour-day.muted {
  background: transparent;
  pointer-events: none;
}

.tour-day.has-plan {
  background: linear-gradient(135deg, rgba(144, 169, 212, 0.24), rgba(233, 241, 255, 0.92));
  border-color: rgba(144, 169, 212, 0.34);
}

.tour-day.selected {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand-dark);
  box-shadow: 0 10px 22px rgba(95, 121, 165, 0.24);
}

.tour-day small {
  display: grid;
  min-width: 18px;
  height: 18px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--brand-dark);
  font-size: 10px;
  font-weight: 900;
}

.tour-plan-results {
  min-width: 0;
}

.tour-plan-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.tour-employee-group {
  display: grid;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.tour-employee-group > header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.tour-employee-group small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.tour-plan-card {
  display: grid;
  grid-template-columns: minmax(170px, 0.7fr) minmax(260px, 1.6fr) minmax(220px, 0.9fr) minmax(160px, 0.7fr);
  gap: 10px;
  align-items: start;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.tour-plan-card header {
  display: grid;
  gap: 6px;
}

.tour-plan-card header div {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.tour-plan-card header span:first-child {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
}

.tour-plan-card header strong {
  overflow-wrap: anywhere;
  font-size: 16px;
}

.tour-plan-card header small,
.tour-plan-card p {
  color: var(--muted);
  font-weight: 800;
}

.tour-plan-card p {
  margin: 0;
  line-height: 1.5;
}

.tour-shop-list {
  display: grid;
  gap: 6px;
}

.tour-shop-item {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  padding: 8px;
  border: 1px solid #e8eef7;
  border-radius: 12px;
  background: linear-gradient(180deg, #ffffff 0%, #f8fbff 100%);
}

.tour-shop-item > span {
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  border-radius: 8px;
  background: rgba(144, 169, 212, 0.18);
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
}

.tour-shop-item div {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.tour-shop-item strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.tour-shop-item small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
  line-height: 1.35;
}

.tour-plan-meta {
  display: grid;
  grid-template-columns: 1fr;
  gap: 6px;
}

.tour-plan-meta div {
  display: grid;
  gap: 3px;
  padding: 8px;
  border: 1px solid #e8eef7;
  border-radius: 10px;
  background: #f8fbff;
}

.tour-plan-meta span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.tour-plan-meta strong {
  overflow-wrap: anywhere;
  font-size: 13px;
}

.tour-plan-card > p {
  padding: 8px 10px;
  border: 1px solid #e8eef7;
  border-radius: 10px;
  background: #f8fbff;
}

.employee-list-row.editing {
  grid-template-columns: minmax(0, 1fr) 168px;
  min-width: 0;
  align-items: center;
  padding: 14px;
  border-color: rgba(74, 111, 165, 0.26);
  background: #f8fbff;
}

.employee-list-row:hover {
  border-color: #bfd0df;
  box-shadow: var(--soft-shadow);
  transform: translateY(-1px);
}

.employee-person {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.employee-person > div {
  min-width: 0;
}

.employee-person strong,
.employee-list-cell strong {
  display: block;
  min-width: 0;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-person .meta {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-list-cell {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.employee-list-cell span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.employee-list-cell small {
  color: var(--muted);
  font-weight: 700;
}

.employee-list-location {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.72);
}

.employee-list-status {
  display: flex;
  align-items: center;
  justify-content: center;
}

.employee-edit-fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px;
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.employee-edit-fields label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.employee-edit-fields input,
.employee-edit-fields select {
  width: 100%;
  min-width: 0;
  min-height: 38px;
  border-radius: 8px;
}

.employee-list-row.editing .employee-actions {
  grid-template-columns: 1fr;
  gap: 8px;
  grid-column: 2;
  grid-row: 1;
  align-self: stretch;
}

.employee-list-row.editing .employee-actions button {
  min-height: 38px;
}

.employee-asset-editor {
  border: 1px solid var(--line);
  border-radius: 10px;
  display: grid;
  gap: 10px;
  grid-column: 1 / -1;
  grid-row: 2;
  padding: 12px;
}

.employee-asset-head,
.employee-asset-row {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.employee-asset-head span,
.employee-asset-row span {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 700;
  margin-top: 3px;
}

.employee-asset-form {
  display: grid;
  gap: 8px;
  grid-template-columns: minmax(160px, 1.2fr) minmax(130px, 0.9fr) minmax(130px, 0.8fr) minmax(120px, 0.8fr) auto;
}

.employee-asset-form input,
.employee-asset-form button {
  min-height: 38px;
}

.employee-asset-form small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  grid-column: 1 / -1;
}

.employee-asset-list {
  display: grid;
  gap: 8px;
}

.employee-asset-row {
  background: #f8fbff;
  border: 1px solid #e5eef9;
  border-radius: 8px;
  padding: 9px 10px;
}

.employee-actions .success {
  border-color: rgba(64, 143, 89, 0.28);
  background: #edf8f1;
  color: var(--ok);
}

.employee-card {
  display: flex;
  flex-direction: column;
  min-height: 292px;
  gap: 16px;
}

.employee-card header, .data-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.employee-card-head {
  align-items: start;
}

.employee-identity, .map-profile {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.employee-identity strong,
.map-profile h2 {
  overflow-wrap: anywhere;
}

.employee-avatar {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(144, 169, 212, 0.34), rgba(233, 241, 255, 0.88));
  color: var(--brand-dark);
  font-weight: 900;
}

.employee-card-body {
  display: grid;
  gap: 10px;
}

.employee-meta-row, .employee-location, .map-stat {
  display: grid;
  gap: 4px;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(249, 251, 253, 0.92), rgba(255, 255, 255, 0.74));
}

.employee-meta-row {
  grid-template-columns: 82px minmax(0, 1fr);
  align-items: center;
}

.employee-meta-row span,
.employee-location span,
.map-stat span,
.visit-detail span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
}

.employee-meta-row strong,
.employee-location strong,
.map-stat strong {
  min-width: 0;
  overflow-wrap: anywhere;
}

.employee-location small {
  color: var(--muted);
}

.pill {
  align-self: start;
  border-radius: 999px;
  padding: 5px 9px;
  background: #eaf6ef;
  color: var(--ok);
  font-size: 12px;
  font-weight: 800;
}

.pill.inactive { background: #f5ece7; color: #a4442b; }
.pill.pending { background: #fff4df; color: var(--warn); }
.pill.approved { background: #eaf6ef; color: var(--ok); }
.pill.rejected { background: #f5ece7; color: #a4442b; }

.map-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 18px;
  align-items: start;
}

.map-canvas {
  min-height: 620px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: #dce7ef;
  overflow: hidden;
  display: grid;
  place-items: center;
  color: #41505e;
  font-weight: 700;
  box-shadow: var(--soft-shadow);
}

.leaflet-container {
  width: 100%;
  height: 100%;
  min-height: inherit;
  font-family: inherit;
}

.route-point-marker {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  border: 3px solid #fff;
  border-radius: 999px;
  background: #ef3b31;
  color: #fff;
  box-shadow: 0 6px 18px rgba(16, 25, 39, 0.24);
  font-size: 12px;
  font-weight: 900;
}

.route-point-marker.is-small {
  width: 24px;
  height: 24px;
  border-width: 2px;
  font-size: 10px;
}

.route-point-marker span {
  line-height: 1;
}

.route-map { min-height: 560px; margin-top: 16px; }

.details-panel {
  padding: 20px;
  background: rgba(255, 255, 255, 0.78);
  position: sticky;
  top: 104px;
  display: grid;
  gap: 14px;
}

.route-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) minmax(180px, 240px) auto auto;
  gap: 12px;
  align-items: center;
  background:
    linear-gradient(135deg, rgba(144, 169, 212, 0.18), rgba(233, 241, 255, 0.62)),
    rgba(255, 255, 255, 0.9);
}

.route-employee-grid {
  display: grid;
  gap: 28px;
  margin-bottom: 18px;
}

.route-role-section {
  display: grid;
  gap: 14px;
}

.route-role-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.route-role-head h3 {
  margin: 0;
  font-size: 20px;
}

.route-role-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 900;
}

.route-role-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
}

.route-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}

.route-filter {
  display: flex;
  gap: 10px;
  align-items: center;
}

.route-filter input {
  min-width: 220px;
  background: rgba(255, 255, 255, 0.9);
}

.route-date-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: -8px 0 18px;
}

.route-date-chips span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 10px;
  background: rgba(255, 255, 255, 0.9);
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.route-employee-card {
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--soft-shadow);
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.route-employee-card:hover {
  transform: translateY(-2px);
  border-color: #bfd0df;
  box-shadow: var(--shadow);
}

.route-card-focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(144, 169, 212, 0.26), var(--shadow);
}

.route-employee-card header {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

.route-card-head {
  align-items: start;
}

.mini-route-map {
  min-height: 220px;
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  background: #e8eef4;
  display: block;
  position: relative;
  color: var(--muted);
  font-weight: 800;
  cursor: zoom-in;
}

.mini-route-map > span {
  min-height: 220px;
  display: grid;
  place-items: center;
}

.mini-route-map iframe {
  width: 100%;
  height: 220px;
  border: 0;
  display: block;
}

.mini-map-zoom-hit {
  position: absolute;
  inset: 0;
  z-index: 5;
  border: 0;
  padding: 0;
  background: transparent;
  cursor: zoom-in;
}

.mini-map-zoom-hit span {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(15, 107, 120, 0.92);
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(15, 107, 120, 0.28);
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 160ms ease, transform 160ms ease;
}

.mini-route-map:hover .mini-map-zoom-hit span,
.mini-map-zoom-hit:focus-visible span {
  opacity: 1;
  transform: translateY(0);
}

.route-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(13, 24, 34, 0.58);
  backdrop-filter: blur(8px);
}

.route-zoom-panel {
  width: min(1180px, 96vw);
  max-height: 92vh;
  display: grid;
  gap: 14px;
  padding: 18px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow);
}

.route-zoom-panel header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.route-zoom-panel h3 {
  margin: 0;
}

.route-zoom-panel span {
  color: var(--muted);
  font-weight: 800;
}

.route-zoom-panel button {
  min-height: 38px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  background: #f8fbfd;
  color: var(--brand-dark);
  font-weight: 900;
  cursor: pointer;
}

.route-zoom-map {
  height: min(68vh, 680px);
  min-height: 420px;
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #e8eef4;
}

.route-zoom-map span {
  height: 100%;
  display: grid;
  place-items: center;
}

.visit-image-panel {
  width: min(980px, 96vw);
}

.visit-image-panel img {
  display: block;
  width: 100%;
  max-height: 76vh;
  object-fit: contain;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f4f7fa;
}

.route-zoom-map iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.route-fallback-map {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 320px;
  overflow: hidden;
  border-radius: inherit;
  background:
    linear-gradient(90deg, rgba(207, 222, 233, 0.55) 1px, transparent 1px),
    linear-gradient(rgba(207, 222, 233, 0.55) 1px, transparent 1px),
    linear-gradient(135deg, #ecf8f1, #f8fafc 48%, #eef5ff);
  background-size: 54px 54px, 54px 54px, 100% 100%;
}

.route-fallback-map svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.route-fallback-map polyline {
  fill: none;
  stroke: #0f6b78;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  vector-effect: non-scaling-stroke;
}

.route-fallback-pin {
  position: absolute;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border: 3px solid #fff;
  border-radius: 999px;
  background: #e0362d;
  color: #fff !important;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.22);
  font-size: 12px;
  font-weight: 900;
}

.route-fallback-summary {
  position: absolute;
  left: 16px;
  bottom: 16px;
  display: grid;
  gap: 2px;
  max-width: min(560px, calc(100% - 32px));
  padding: 12px 14px;
  border: 1px solid rgba(203, 213, 225, 0.86);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.12);
}

.route-fallback-summary strong {
  color: var(--text);
  font-size: 14px;
}

.route-fallback-summary small {
  color: var(--muted);
  font-weight: 800;
}

.route-zoom-timeline {
  max-height: 180px;
  overflow-y: auto;
}

.route-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 14px;
}

.route-card-footer div {
  display: grid;
  gap: 3px;
}

.route-card-footer span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.route-timeline {
  display: grid;
  gap: 12px;
  max-height: 260px;
  overflow: auto;
  padding: 4px 2px 2px;
}

.route-timeline-item {
  position: relative;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 12px;
  align-items: start;
}

.route-timeline-item::before {
  content: "";
  position: absolute;
  left: 27px;
  top: 28px;
  bottom: -14px;
  width: 2px;
  background: linear-gradient(180deg, rgba(144, 169, 212, 0.42), rgba(144, 169, 212, 0));
}

.route-timeline-item:last-child::before {
  display: none;
}

.route-timeline-item > span {
  display: grid;
  place-items: center;
  min-height: 28px;
  border-radius: 999px;
  background: rgba(144, 169, 212, 0.16);
  color: var(--brand);
  font-size: 11px;
  font-weight: 900;
}

.route-timeline-item div {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}

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

.route-timeline-item small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.route-timeline-item p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.route-timeline-empty {
  padding: 14px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.route-card-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.route-card-metrics div {
  display: grid;
  gap: 5px;
  min-width: 0;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fbfdff;
}

.route-card-metrics span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.route-card-metrics strong {
  overflow-wrap: anywhere;
}

.thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(72px, 1fr));
  gap: 8px;
  margin-top: 10px;
}

.visit-image-thumb {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 14px;
  background: transparent;
  cursor: zoom-in;
}

.expense-image-button {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 0;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background: #f4f7fb;
  overflow: hidden;
  cursor: zoom-in;
}

.thumbs img, .expense-image {
  width: 100%;
  height: 72px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #eef3f7;
}

.expense-image {
  height: 118px;
  margin-top: 0;
  border: 0;
  border-radius: 0;
}

.visit-panel-head {
  align-items: center;
}

.visit-filter {
  display: flex;
  gap: 10px;
  align-items: center;
}

.visit-filter input,
.visit-filter button {
  min-height: 42px;
}

.visit-list {
  display: grid;
  gap: 18px;
}

.visit-board-head,
.visit-table-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.visit-board-head h3,
.visit-table-head h3,
.visit-detail-card h3,
.visit-map-card h3 {
  margin: 0;
}

.visit-user-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.visit-user-card {
  display: grid;
  align-content: start;
  gap: 10px;
  min-height: 0;
  padding: 16px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--soft-shadow);
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease;
}

.visit-user-card:hover {
  transform: translateY(-2px);
  border-color: #bfd0df;
  box-shadow: var(--shadow);
}

.visit-card-name {
  color: var(--brand-dark);
  font-weight: 900;
  font-size: 15px;
  line-height: 1.3;
}

.visit-user-card strong {
  font-size: 26px;
  line-height: 1.05;
}

.visit-user-card small {
  color: var(--muted);
  font-weight: 700;
}

.visit-card-role {
  justify-self: start;
  padding: 5px 8px;
  border: 1px solid #dfe9f6;
  border-radius: 999px;
  background: #f8fbff;
  color: var(--brand-dark);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.visit-tour-plan,
.visit-shop-list {
  display: grid;
  gap: 6px;
  padding: 10px;
  border: 1px solid #dfe9f6;
  border-radius: 10px;
  background: #f8fbff;
  color: var(--ink);
}

.visit-tour-plan b,
.visit-tour-plan em,
.visit-tour-shops i,
.visit-shop-list b,
.visit-shop-list em,
.visit-shop-list i {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-style: normal;
}

.visit-tour-plan b,
.visit-shop-list b {
  color: var(--brand-dark);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.visit-tour-plan em,
.visit-shop-list em {
  color: var(--ink);
  font-size: 13px;
  font-weight: 800;
}

.visit-tour-shops,
.visit-shop-list > span {
  display: grid;
  gap: 4px;
  max-height: 118px;
  overflow-y: auto;
  padding-right: 4px;
  color: var(--muted) !important;
  scrollbar-width: thin;
}

.visit-tour-shops i,
.visit-shop-list i {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.visit-tour-plan.empty-plan,
.visit-shop-list.empty-plan {
  border-style: dashed;
  background: #fff;
}

.visit-table {
  display: grid;
  gap: 10px;
}

.visit-table-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.15fr) minmax(150px, 1.05fr) minmax(110px, 0.8fr) minmax(100px, 0.75fr) minmax(74px, 0.55fr) minmax(130px, 0.95fr) 52px auto;
  gap: 10px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff;
}

.visit-list-thumb {
  display: block;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 0;
  border-radius: 8px;
  overflow: hidden;
  cursor: zoom-in;
  background: transparent;
}

.visit-list-thumb img {
  width: 44px;
  height: 44px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
}

.visit-table-row > span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.visit-table-header {
  color: var(--ink);
  background: transparent;
  font-weight: 900;
}

.visit-table-row button,
.visit-table-head button,
.visit-detail-card button {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 9px 12px;
  background: #fff;
  color: var(--brand-dark);
  font-weight: 900;
  cursor: pointer;
}

.visit-detail-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1fr) minmax(360px, 1fr);
  gap: 16px;
}

.visit-detail-card,
.visit-map-card {
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--soft-shadow);
}

.visit-detail-title {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}

.visit-detail-title .meta {
  margin: 4px 0 0;
}

.visit-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin: 14px 0;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.visit-detail-list div {
  display: grid;
  gap: 3px;
  min-width: 0;
  padding: 10px;
  border: 1px solid #e8eef7;
  border-radius: 12px;
  background: #f8fbff;
}

.visit-detail-list strong {
  overflow-wrap: anywhere;
  font-size: 13px;
  line-height: 1.35;
}

.visit-detail-list span,
.visit-list-cell span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
}

.visit-detail-map {
  position: relative;
  min-height: 250px;
  margin-top: 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  background: #e8eff5;
}

.visit-detail-map span {
  display: grid;
  min-height: 250px;
  place-items: center;
  color: var(--muted);
  font-weight: 900;
}

.visit-detail-map iframe {
  width: 100%;
  height: 250px;
  border: 0;
  display: block;
}

.visit-card {
  position: relative;
  overflow: hidden;
}

.visit-card::before {
  content: "";
  position: absolute;
  left: 28px;
  top: 58px;
  bottom: 20px;
  width: 2px;
  background: linear-gradient(180deg, rgba(144, 169, 212, 0.48), transparent);
}

.visit-head {
  align-items: center;
  position: relative;
}

.visit-node {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  border: 5px solid rgba(144, 169, 212, 0.26);
  border-radius: 999px;
  background: var(--brand);
  box-shadow: 0 0 0 6px rgba(144, 169, 212, 0.12);
}

.visit-detail {
  display: grid;
  gap: 12px;
  margin-left: 36px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fbfdff;
}

.visit-detail p {
  margin: 0;
  color: var(--ink);
}

.expand-panel {
  margin-left: 36px;
}

.expand-panel summary {
  cursor: pointer;
  color: var(--brand);
  font-weight: 800;
}

.expense-panel-head {
  align-items: center;
  min-height: 40px;
  padding-bottom: 8px;
}

.expense-command-bar {
  display: grid;
  grid-template-columns: minmax(140px, 190px) minmax(135px, 180px) minmax(135px, 180px) minmax(150px, 220px) minmax(90px, 120px);
  gap: 10px;
  align-items: end;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(247, 251, 255, 0.94), rgba(255, 255, 255, 0.98)),
    #fff;
}

.expense-command-bar label {
  display: grid;
  gap: 4px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.expense-command-bar select,
.expense-command-bar button {
  min-height: 34px;
  border: 1px solid #d6e2f1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  font-weight: 800;
}

.expense-command-bar button {
  padding: 0 16px;
  color: #1f3658;
}

.expense-overview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}

.expense-overview article {
  position: relative;
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid #d8e3f1;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.94), rgba(246, 249, 253, 0.96)),
    #fff;
  box-shadow: 0 10px 24px rgba(17, 27, 46, 0.055);
  overflow: hidden;
}

.expense-overview article::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, #233a5e, #57a08b);
}

.expense-overview span,
.expense-user-role,
.expense-category,
.expense-user-total span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  letter-spacing: 0;
  text-transform: uppercase;
}

.expense-overview strong {
  display: block;
  margin-top: 5px;
  color: #121a29;
  font-size: 22px;
  line-height: 1.1;
}

.expense-overview small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-weight: 800;
}

.user-expense-card {
  display: grid;
  gap: 9px;
  align-self: start;
  border-radius: 8px;
  border-color: #d8e3f1;
  background:
    linear-gradient(180deg, #fff, #f8fbff),
    #fff;
  padding: 12px;
  box-shadow: 0 10px 24px rgba(17, 27, 46, 0.055);
}

.user-expense-card > header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: start;
  padding-bottom: 8px;
  border-bottom: 1px solid #e4ecf6;
}

.user-expense-card > header strong,
.expense-row-main strong {
  display: block;
  overflow-wrap: anywhere;
}

.user-expense-card > header strong {
  font-size: 15px;
}

.user-expense-card .meta {
  margin-top: 3px;
  font-size: 12px;
}

.expense-user-role,
.expense-category {
  display: block;
  margin-bottom: 4px;
  color: #5576b2;
}

.expense-user-total {
  min-width: 86px;
  padding: 8px 10px;
  border: 1px solid #dce7f5;
  border-radius: 8px;
  background: #f7fbff;
  text-align: right;
}

.expense-user-total strong {
  display: block;
  margin-top: 3px;
  color: #13715f;
  font-size: 14px;
}

.expense-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}

.expense-summary button {
  display: grid;
  gap: 2px;
  min-height: 38px;
  padding: 7px 9px;
  border: 1px solid #dfe9f6;
  border-radius: 8px;
  background: #fff;
  color: var(--muted);
  text-align: left;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}

.expense-summary button.active {
  border-color: rgba(31, 54, 88, 0.32);
  background: #f2f6fb;
  color: #1f3658;
}

.expense-summary strong {
  color: #111827;
  font-size: 14px;
}

.expense-card-filter-note {
  margin-top: -2px;
  color: #5576b2;
  font-size: 12px;
  font-weight: 900;
}

.expense-stack {
  display: grid;
  gap: 8px;
  min-height: 0;
  max-height: 430px;
  overflow-y: auto;
  padding-right: 4px;
}

.expense-row {
  border: 1px solid #dce7f5;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(17, 27, 46, 0.045);
}

.expense-row-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
}

.expense-amount {
  display: grid;
  justify-items: end;
  gap: 6px;
  white-space: nowrap;
}

.expense-amount strong {
  color: #111827;
  font-size: 16px;
}

.expense-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 9px;
  align-items: center;
}

.expense-actions button {
  min-height: 30px;
  border: 0;
  border-radius: 8px;
  padding: 0 12px;
  color: #fff;
  font-weight: 900;
  cursor: pointer;
  transition: transform 160ms ease, box-shadow 160ms ease, opacity 160ms ease;
}

.expense-actions button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(16, 24, 40, 0.12);
}

.expense-actions button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.expense-actions .success { background: var(--ok); }
.expense-actions .warning { background: var(--warn); }
.expense-actions .danger { background: var(--danger); }
.expense-actions .neutral { background: #5576b2; }

.expense-table-card {
  grid-column: 1 / -1;
  overflow: hidden;
  border: 1px solid #d8e3f1;
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(17, 27, 46, 0.055);
}

.expense-table-head,
.expense-table-row {
  display: grid;
  grid-template-columns: minmax(190px, 1.05fr) 124px minmax(220px, 1.25fr) 136px 104px 78px minmax(380px, 1fr);
  gap: 10px;
  align-items: center;
}

.expense-table-head {
  padding: 10px 14px;
  border-bottom: 1px solid #dce7f5;
  background: #f6f9fd;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.expense-table-body {
  display: grid;
  max-height: 560px;
  overflow: auto;
}

.expense-table-row {
  padding: 10px 14px;
  border-bottom: 1px solid #edf2f8;
}

.expense-table-head span:nth-child(5),
.expense-table-row > div:nth-child(5) {
  text-align: right;
}

.expense-table-head span:nth-child(6),
.expense-table-row > div:nth-child(6) {
  text-align: center;
}

.expense-table-head span:nth-child(7),
.expense-table-row > div:nth-child(7) {
  justify-content: flex-end;
}

.expense-table-row:last-child {
  border-bottom: 0;
}

.expense-table-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.expense-table-link {
  min-height: 30px;
  padding: 0 10px;
  border: 1px solid #d6e2f1;
  border-radius: 8px;
  background: #f7fbff;
  color: #1f3658;
  font-weight: 900;
  cursor: zoom-in;
}

.expense-table-actions {
  display: flex;
  flex-wrap: nowrap;
  justify-content: flex-end;
  gap: 6px;
}

.expense-table-actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: auto;
  min-width: 76px;
  height: 38px;
  min-height: 38px;
  border: 1px solid #d6e2f1;
  border-radius: 10px;
  padding: 0 9px;
  background: #fff;
  color: #2f3a45;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, color 160ms ease, transform 160ms ease;
}

.expense-table-actions button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 8px 18px rgba(17, 27, 46, 0.1);
}

.expense-table-actions .action-icon {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: rgba(47, 58, 69, 0.06);
}

.expense-table-actions svg {
  width: 14px;
  height: 14px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.expense-table-actions strong {
  color: currentColor;
  font-size: 11px;
  line-height: 1.1;
  text-align: center;
  white-space: nowrap;
}

.expense-table-actions .success {
  border-color: #a9e6c7;
  background: #f2fff8;
  color: #0f9f66;
}

.expense-table-actions .success .action-icon {
  background: #dbf8ea;
}

.expense-table-actions .warning {
  border-color: #ffd09b;
  background: #fff9f1;
  color: #d56b00;
}

.expense-table-actions .warning .action-icon {
  background: #ffeed9;
}

.expense-table-actions .danger {
  border-color: #ffb3b6;
  background: #fff5f5;
  color: #d63333;
}

.expense-table-actions .danger .action-icon {
  background: #ffe1e2;
}

.expense-table-actions .neutral {
  border-color: #b9ccff;
  background: #f5f8ff;
  color: #2458e6;
}

.expense-table-actions .neutral .action-icon {
  background: #e4ecff;
}

.monthly-target-layout {
  display: grid;
  gap: 16px;
}

.monthly-target-head {
  align-items: center;
}

.monthly-target-head label {
  display: grid;
  gap: 5px;
  min-width: 180px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.monthly-target-summary {
  display: none;
}

.monthly-target-summary article {
  min-height: 76px;
  padding: 12px 14px;
  border: 1px solid #d8e3f1;
  border-radius: 8px;
  background: #fff;
}

.monthly-target-summary span,
.monthly-target-summary small,
.monthly-target-metrics span,
.monthly-target-form label {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.monthly-target-summary strong {
  display: block;
  margin: 5px 0 4px;
  font-size: 22px;
}

.monthly-upload-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 12px;
  align-items: end;
}

.monthly-upload-grid label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.section-toggle {
  min-height: 34px;
  padding: 7px 12px;
  border-radius: 8px;
  border-color: #cbd8e8;
  background: #f8fbff;
  color: #263a57;
  font-weight: 900;
}

.collapsible-body {
  margin-top: 12px;
}

.collapsible-body.is-hidden {
  display: none;
}

.today-report-head {
  align-items: center;
}

.today-report-embedded {
  display: grid;
  gap: 12px;
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #dbe4ef;
}

.today-report-embedded .panel-head {
  padding-bottom: 4px;
}

.today-report-actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.today-report-actions input {
  min-height: 38px;
  max-width: 160px;
}

.today-report-actions button {
  min-height: 38px;
  padding: 8px 12px;
  border-radius: 8px;
  border-color: #cbd8e8;
  background: #f8fbff;
  color: #263a57;
  font-weight: 900;
}

.today-report-actions button:last-child {
  border-color: var(--brand);
  background: var(--brand);
  color: #fff;
}

.monthly-report-charts {
  display: grid;
  grid-template-columns: minmax(260px, 1.1fr) minmax(190px, 0.7fr) minmax(320px, 1.2fr);
  gap: 12px;
  margin-bottom: 14px;
}

.monthly-report-chart-card {
  min-height: 116px;
  display: flex;
  gap: 14px;
  align-items: center;
  padding: 14px;
  border: 1px solid #d8e3f1;
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.monthly-report-chart-card > span,
.monthly-report-chart-card span,
.monthly-report-chart-card small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.monthly-report-chart-card strong {
  display: block;
  margin: 4px 0;
  color: #111827;
  font-size: 20px;
}

.monthly-report-donut {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #fff 0 55%, transparent 56%),
    conic-gradient(#1f8f5f 0 var(--progress, 0deg), #e8eef6 var(--progress, 0deg) 360deg);
  box-shadow: 0 10px 22px rgba(17, 27, 46, 0.08);
}

.monthly-report-donut strong {
  margin: 0;
  font-size: 15px;
  line-height: 1;
}

.monthly-report-donut span {
  font-size: 9px;
}

.monthly-report-chart-card.weekly {
  display: grid;
  grid-template-columns: minmax(120px, 0.65fr) minmax(0, 1fr);
}

.monthly-week-bars {
  height: 86px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 9px;
  align-items: end;
}

.monthly-week-bars div {
  height: 100%;
  display: grid;
  grid-template-rows: 1fr auto auto;
  gap: 3px;
  justify-items: center;
  min-width: 0;
}

.monthly-week-bars i {
  align-self: end;
  width: 100%;
  max-width: 22px;
  border-radius: 999px 999px 3px 3px;
  background: linear-gradient(180deg, #1f8f5f, #8bd35f);
}

.monthly-week-bars b {
  color: #14243a;
  font-size: 10px;
}

.monthly-progress-lines {
  grid-column: 1 / -1;
  display: grid;
  gap: 12px;
  padding: 14px;
  border: 1px solid #d8e3f1;
  border-radius: 10px;
  background: #fff;
}

.monthly-progress-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}

.monthly-progress-head span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.monthly-progress-head strong {
  font-size: 14px;
}

.monthly-progress-list {
  display: grid;
  gap: 8px;
}

.monthly-progress-row {
  display: grid;
  grid-template-columns: minmax(160px, 0.8fr) minmax(180px, 1fr) minmax(120px, 0.45fr);
  gap: 10px;
  align-items: center;
}

.monthly-progress-row span,
.monthly-progress-row b {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

.monthly-progress-track {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef6;
}

.monthly-progress-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #1f8f5f, #8bd35f);
}

.today-report-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.today-report-summary article {
  padding: 11px 12px;
  border: 1px solid #d8e3f1;
  border-radius: 8px;
  background: #f9fbfe;
}

.today-report-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.today-report-summary strong {
  display: block;
  margin-top: 4px;
  font-size: 18px;
}

.today-report-table {
  display: grid;
  overflow-x: auto;
  border: 1px solid #cbd8e8;
  border-radius: 8px;
  background: #fff;
}

.today-report-row {
  display: grid;
  grid-template-columns: minmax(180px, 0.8fr) 110px 110px 140px 100px;
  min-width: 640px;
  border-bottom: 1px solid #dbe4ef;
}

.today-report-detail-row {
  display: grid;
  grid-template-columns: 120px 110px 150px 110px minmax(210px, 1fr) minmax(190px, 0.9fr) 90px 90px 120px 90px;
  min-width: 1260px;
  border-bottom: 1px solid #dbe4ef;
}

.today-report-row:last-child {
  border-bottom: 0;
}

.today-report-detail-row:last-child {
  border-bottom: 0;
}

.today-report-row > span,
.today-report-row > strong,
.today-report-detail-row > span,
.today-report-detail-row > strong {
  min-height: 31px;
  display: grid;
  align-items: center;
  padding: 5px 7px;
  border-right: 1px solid #dbe4ef;
  font-size: 12px;
  line-height: 1.2;
  overflow-wrap: anywhere;
}

.today-report-row > :last-child {
  border-right: 0;
}

.today-report-detail-row > :last-child {
  border-right: 0;
}

.today-report-table-head > span {
  min-height: 36px;
  justify-items: center;
  background: #fff200;
  color: #07111f;
  font-size: 11px;
  font-weight: 900;
  text-align: center;
}

.today-report-total > strong,
.today-report-total > span {
  background: #8bd35f;
  color: #07111f;
  font-weight: 900;
  text-align: center;
}

.monthly-target-grid {
  display: grid;
  gap: 10px;
}

.monthly-target-row {
  display: grid;
  grid-template-columns: minmax(230px, 1fr) 116px minmax(260px, 1.1fr) minmax(260px, 0.95fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid #d8e3f1;
  border-radius: 10px;
  background: #fff;
}

.monthly-target-person {
  display: flex;
  gap: 10px;
  align-items: center;
  min-width: 0;
}

.monthly-target-person strong,
.monthly-target-person small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.monthly-target-person small {
  margin-top: 3px;
  color: var(--muted);
  font-weight: 800;
}

.monthly-target-chart {
  position: relative;
  width: 112px;
  height: 112px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background:
    radial-gradient(circle at center, #ffffff 0 54%, transparent 55%),
    conic-gradient(var(--ring-color, #248a58) 0 var(--achieved, 0deg), #e8eef6 var(--achieved, 0deg) 360deg);
  box-shadow:
    0 14px 28px rgba(17, 27, 46, 0.08),
    inset 0 0 0 1px rgba(211, 222, 236, 0.7);
}

.monthly-target-chart::before {
  content: "";
  position: absolute;
  inset: 9px;
  border-radius: inherit;
  border: 1px solid rgba(216, 227, 241, 0.95);
  box-shadow: inset 0 0 0 8px #fff;
  pointer-events: none;
}

.monthly-target-chart.active {
  --ring-color: #1f8f5f;
}

.monthly-target-chart.complete {
  --ring-color: #14a76c;
}

.monthly-target-chart.empty {
  --ring-color: #cbd8e8;
}

.monthly-target-chart-core {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  width: 68px;
  height: 68px;
  border-radius: 999px;
  background: linear-gradient(180deg, #fff, #f8fbff);
  text-align: center;
  box-shadow: 0 1px 0 rgba(17, 27, 46, 0.04);
}

.monthly-target-chart strong {
  color: #122033;
  font-size: 15px;
  line-height: 1;
}

.monthly-target-chart span {
  color: var(--muted);
  font-size: 9px;
  font-weight: 900;
  line-height: 1.1;
}

.monthly-target-chart > small {
  position: absolute;
  left: 50%;
  bottom: -7px;
  z-index: 2;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  transform: translateX(-50%);
  padding: 4px 7px;
  border: 1px solid #d8e3f1;
  border-radius: 999px;
  background: #fff;
  color: var(--muted);
  font-size: 10px;
  font-weight: 900;
  white-space: nowrap;
  box-shadow: 0 6px 14px rgba(17, 27, 46, 0.08);
}

.monthly-target-chart > small b {
  color: #14243a;
}

.monthly-target-metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.monthly-target-metrics div {
  display: grid;
  gap: 3px;
  padding: 10px;
  border: 1px solid #e2eaf4;
  border-radius: 8px;
  background: #f9fbfe;
}

.monthly-target-form {
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  gap: 8px;
  align-items: end;
}

.monthly-target-form label {
  display: grid;
  gap: 5px;
}

.monthly-target-form input {
  min-height: 36px;
  border-radius: 8px;
}

.monthly-target-form button {
  min-height: 36px;
  border-radius: 8px;
}

.monthly-target-form small {
  grid-column: 1 / -1;
  color: var(--muted);
  font-weight: 800;
}

.monthly-report-table {
  display: grid;
  overflow-x: auto;
  border: 1px solid #cbd8e8;
  border-radius: 8px;
  background: #fff;
}

.monthly-report-row {
  display: grid;
  grid-template-columns: 190px repeat(15, minmax(86px, 1fr));
  min-width: 1560px;
  border-bottom: 1px solid #dbe4ef;
}

.monthly-report-row:last-child {
  border-bottom: 0;
}

.monthly-report-row > span,
.monthly-report-row > strong {
  min-height: 30px;
  display: grid;
  place-items: center;
  padding: 5px 7px;
  border-right: 1px solid #dbe4ef;
  text-align: center;
  font-size: 13px;
  line-height: 1.2;
}

.monthly-report-row > :last-child {
  border-right: 0;
}

.monthly-report-head > span {
  min-height: 44px;
  background: #fff200;
  color: #07111f;
  font-weight: 900;
}

.monthly-report-head > span:nth-child(13),
.monthly-report-head > span:nth-child(16) {
  background: #00b96b;
}

.monthly-report-head > span:nth-child(14) {
  background: #ff4d3f;
}

.monthly-report-row strong {
  justify-content: center;
  background: #f9fbfe;
}

.report-ok {
  color: #00a54f;
  font-weight: 900;
}

.report-bad {
  color: #f00000;
  font-weight: 900;
}

.monthly-report-total > strong,
.monthly-report-total > span {
  background: #4777c2;
  color: #fff;
  font-weight: 900;
}

.empty {
  padding: 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: #f9fbfd;
  text-align: center;
  font-weight: 700;
}

.toast {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 50;
  max-width: 360px;
  padding: 14px 16px;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 16px;
  background: rgba(17, 27, 36, 0.9);
  color: #fff;
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity 180ms ease, transform 180ms ease;
}

.toast.show {
  opacity: 1;
  transform: translateY(0);
}

.view.active {
  animation: pageIn 260ms ease both;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes rise {
  from { transform: scaleY(0.3); opacity: 0.45; }
  to { transform: scaleY(1); opacity: 1; }
}

@keyframes pulseGlow {
  0%, 100% { box-shadow: 0 0 0 0 rgba(144, 169, 212, 0.34); }
  50% { box-shadow: 0 0 0 8px rgba(144, 169, 212, 0); }
}

@keyframes shimmer {
  from { transform: translateX(-100%); }
  to { transform: translateX(100%); }
}

@media (max-width: 1240px) {
  #expenseGrid { grid-template-columns: repeat(2, minmax(320px, 1fr)); }
  .expense-overview { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .expense-command-bar { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .expense-table-card { overflow-x: auto; }
  .expense-table-head,
  .expense-table-row { min-width: 1320px; }
}

@media (max-width: 980px) {
  body { grid-template-columns: 1fr; }
  .sidebar { position: static; height: auto; max-height: none; overflow: visible; border-radius: 0 0 24px 24px; }
  .sidebar-toggle { display: none; }
  .nav { grid-template-columns: repeat(2, 1fr); max-height: 360px; overflow-y: auto; }
  .topbar, .map-layout { grid-template-columns: 1fr; display: grid; }
  .toolbar, .route-controls { grid-template-columns: 1fr; }
  .document-panel-head { align-items: stretch; flex-direction: column; }
  .pdf-filter-tabs { justify-content: flex-start; }
  .document-row { grid-template-columns: auto minmax(0, 1fr); }
  .document-row .document-actions { grid-column: 1 / -1; justify-content: flex-start; }
  .employee-form-grid { grid-template-columns: 1fr; }
  .employee-list-header { display: none; }
  .employee-list-row { grid-template-columns: 1fr; min-width: 0; align-items: stretch; }
  .employee-list-row.editing { grid-template-columns: 1fr; }
  .employee-actions { grid-template-columns: 1fr; }
  .management-select-row { grid-template-columns: 1fr; }
  .employee-hierarchy-head,
  .hierarchy-group > header,
  .hierarchy-rsm-head { grid-template-columns: 1fr; align-items: stretch; }
  .hierarchy-actions { grid-template-columns: 1fr; }
  .documents-layout { grid-template-columns: 1fr; }
  .vendor-kyc-meta,
  .vendor-kyc-documents { grid-template-columns: 1fr; }
  .vendor-kyc-row,
  .vendor-kyc-detail-head { align-items: stretch; flex-direction: column; }
  .diamond-request-row,
  .diamond-history-row { grid-template-columns: 1fr; }
  .outstanding-form-grid,
  .outstanding-row { grid-template-columns: 1fr; }
  .outstanding-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .outstanding-upload-form { grid-template-columns: 1fr; }
  .outstanding-employee-card > header { align-items: stretch; flex-direction: column; }
  .outstanding-employee-summary { place-items: start; }
  #outstandingUserIds { grid-template-columns: 1fr; }
  .document-row,
  .greeting-card { grid-template-columns: 1fr; align-items: stretch; }
  .quotation-grid { grid-template-columns: 1fr; }
  .quotation-details { grid-template-columns: 1fr; }
  .quotation-row { grid-template-columns: 1fr; align-items: stretch; }
  .quotation-table-row { min-width: 1280px; }
  .tour-calendar-layout { grid-template-columns: 1fr; }
  .tour-calendar-card { position: static; }
  .tour-plan-grid { grid-template-columns: 1fr; }
  .tour-plan-card { grid-template-columns: 1fr; }
  .tour-plan-meta { grid-template-columns: 1fr; }
  .stats-grid, .split, .chart-grid, .expense-overview { grid-template-columns: 1fr; }
  #expenseGrid { grid-template-columns: 1fr; }
  .expense-panel-head { align-items: stretch; flex-direction: column; }
  .expense-command-bar { grid-template-columns: 1fr; }
  .expense-stack { max-height: 640px; }
  .monthly-target-head { align-items: stretch; flex-direction: column; }
  .monthly-target-summary,
  .monthly-report-charts,
  .today-report-summary,
  .monthly-upload-grid,
  .monthly-target-row,
  .monthly-target-metrics,
  .monthly-target-form { grid-template-columns: 1fr; }
  .today-report-head,
  .today-report-actions { align-items: stretch; flex-direction: column; }
  .today-report-actions input { max-width: none; }
  .monthly-target-chart { justify-self: center; }
  .visit-user-grid,
  .visit-table-row,
  .visit-detail-layout { grid-template-columns: 1fr; }
  .visit-detail-list { grid-template-columns: 1fr; }
  .visit-table-header { display: none; }
  .route-card-metrics { grid-template-columns: 1fr; }
  .route-role-grid { grid-template-columns: 1fr; }
  .route-page-head, .route-filter, .route-card-footer { align-items: stretch; flex-direction: column; }
  .mini-route-map { min-height: 320px; }
  .details-panel { order: -1; }
  .donut-wrap { grid-template-columns: 1fr; justify-items: center; }
}

@media (max-width: 640px) {
  .outstanding-list { grid-template-columns: 1fr; }
}

/* Global responsive polish layer */
html {
  scroll-behavior: smooth;
}

body {
  overflow-x: hidden;
}

.main {
  width: 100%;
  max-width: 1920px;
}

.view.active {
  display: grid;
  gap: 18px;
}

.panel {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  border-radius: 12px;
  box-shadow: 0 12px 34px rgba(16, 25, 39, 0.07);
}

.panel-head {
  align-items: flex-start;
  min-width: 0;
}

.panel-head > div {
  min-width: 0;
}

.panel-head h2,
.panel-head span,
.stat span,
.stat small,
.employee-card,
.data-card,
.list-item,
.document-row,
.quotation-table-row,
.tour-plan-card,
.visit-user-card,
.expense-table-row,
.monthly-report-row,
.today-report-row {
  overflow-wrap: anywhere;
}

.toolbar,
.route-filter,
.visit-filter,
.today-report-actions,
.expense-command-bar,
.document-panel-head,
.monthly-target-head,
.expense-panel-head,
.visit-panel-head {
  min-width: 0;
}

.toolbar {
  justify-content: end;
}

.search-shell {
  min-height: 46px;
}

.search-shell input {
  min-width: 0;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

label {
  min-width: 0;
}

.split,
.documents-layout,
.vendor-kyc-layout,
.diamond-request-layout,
.monthly-target-layout,
.tour-calendar-layout,
.visit-detail-layout {
  min-width: 0;
}

.stats-grid,
.documents-layout,
.outstanding-list,
.route-employee-grid,
.visit-user-grid,
.cards-grid,
#expenseGrid,
.monthly-report-charts {
  align-items: start;
}

.stats-grid {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.stat {
  min-height: 132px;
  border-radius: 12px;
}

.list-item {
  border-radius: 10px;
}

.employee-card,
.data-card,
.quotation-card,
.tour-plan-card,
.visit-user-card,
.route-employee-card,
.outstanding-employee-card,
.vendor-kyc-row,
.diamond-request-row,
.diamond-history-row {
  border-radius: 10px;
}

.document-list,
.greeting-grid,
.vendor-kyc-list,
.diamond-request-list,
.diamond-history-list,
.outstanding-records,
.visit-list,
.tour-plan-grid,
.route-employee-grid {
  scrollbar-gutter: stable;
}

.employee-flat-list,
.quotation-table,
.expense-table-card,
.monthly-report-table,
.today-report-table,
.visit-table,
.tour-plan-results {
  max-width: 100%;
  overflow-x: auto;
  scrollbar-gutter: stable;
}

.quotation-table-head,
.expense-table-head,
.monthly-report-head,
.today-report-head-row,
.visit-table-header {
  position: sticky;
  top: 0;
  z-index: 2;
}

.expense-table-card,
.quotation-table,
.monthly-report-table,
.today-report-table {
  border-radius: 10px;
}

.expense-table-head,
.expense-table-row {
  grid-template-columns: minmax(180px, 1fr) 120px minmax(210px, 1.15fr) 132px 96px 78px minmax(300px, 0.9fr);
}

.expense-table-actions {
  justify-content: flex-start;
  gap: 8px;
}

.expense-table-actions button {
  width: 64px;
  min-height: 58px;
  padding: 7px 6px;
}

.expense-table-actions .action-icon {
  width: 30px;
  height: 30px;
}

.quotation-table-row {
  grid-template-columns: minmax(210px, 1.2fr) minmax(150px, 0.85fr) minmax(120px, 0.68fr) minmax(150px, 0.8fr) minmax(105px, 0.6fr) minmax(95px, 0.55fr) minmax(105px, 0.55fr) minmax(210px, 0.95fr);
}

.quotation-table-row > strong,
.quotation-table-row > span,
.expense-table-row > div,
.expense-table-head span {
  align-content: center;
}

.quotation-table-row .quotation-actions,
.vendor-kyc-actions,
.hierarchy-actions,
.document-actions,
.outstanding-row .document-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
}

.document-row,
.outstanding-row {
  border-radius: 10px;
}

.document-actions a,
.document-actions button,
.outstanding-row .document-actions a,
.outstanding-row .document-actions button {
  min-height: 36px;
  border-radius: 9px;
}

.monthly-report-charts {
  grid-template-columns: minmax(260px, 0.8fr) minmax(190px, 0.55fr) minmax(380px, 1.35fr);
}

.monthly-progress-row {
  grid-template-columns: minmax(150px, 0.75fr) minmax(160px, 1fr) minmax(112px, 0.45fr);
}

.monthly-report-table,
.today-report-table {
  width: 100%;
}

.monthly-report-row {
  min-width: 1500px;
}

.today-report-row {
  min-width: 620px;
}

.today-report-detail-row {
  min-width: 1180px;
}

.today-report-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.today-report-actions input {
  width: 190px;
}

.route-page-head,
.expense-panel-head,
.visit-panel-head,
.today-report-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
}

.route-filter,
.visit-filter,
.expense-command-bar {
  align-items: end;
}

.expense-command-bar {
  grid-template-columns: minmax(150px, 0.7fr) minmax(150px, 0.7fr) minmax(160px, 0.75fr) minmax(200px, 1fr) minmax(110px, auto);
}

.route-employee-grid {
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.visit-user-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.outstanding-list {
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}

#expenseGrid {
  grid-template-columns: 1fr;
}

.notification-panel {
  max-width: calc(100vw - 28px);
}

@media (min-width: 981px) {
  .view.active {
    align-content: start;
  }

  .main {
    justify-self: center;
  }

  .topbar {
    min-height: 78px;
  }
}

@media (max-width: 1280px) {
  .main {
    padding: 22px;
  }

  .panel {
    padding: 16px;
  }

  .monthly-report-charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 980px) {
  body.sidebar-collapsed,
  body {
    grid-template-columns: 1fr;
  }

  .main {
    padding: 16px;
  }

  .topbar {
    position: static;
    padding-top: 8px;
    margin-bottom: 14px;
  }

  .topbar h1 {
    font-size: clamp(24px, 6vw, 32px);
  }

  .toolbar {
    width: 100%;
    grid-template-columns: minmax(0, 1fr) 46px minmax(96px, auto);
  }

  .sidebar {
    padding: 12px;
    gap: 10px;
  }

  .brand {
    min-height: 58px;
    padding: 10px;
  }

  .brand-logo {
    max-width: 150px;
  }

  .nav {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    max-height: 300px;
    border-radius: 12px;
  }

  .nav-link {
    min-height: 40px;
    border-radius: 10px;
  }

  .panel-head,
  .route-page-head,
  .expense-panel-head,
  .visit-panel-head,
  .today-report-head {
    align-items: stretch;
    flex-direction: column;
  }

  .toolbar,
  .route-filter,
  .visit-filter,
  .today-report-actions,
  .expense-command-bar {
    grid-template-columns: 1fr;
    justify-content: stretch;
  }

  .today-report-actions {
    display: grid;
  }

  .today-report-actions input {
    width: 100%;
  }

  .expense-table-actions button {
    width: 58px;
    min-height: 54px;
  }
}

@media (max-width: 640px) {
  .main {
    padding: 12px;
  }

  .panel,
  .stat {
    padding: 14px;
    border-radius: 10px;
  }

  .stats-grid,
  .documents-layout,
  .split,
  .cards-grid,
  .route-employee-grid,
  .visit-user-grid,
  .outstanding-list {
    grid-template-columns: 1fr;
    gap: 12px;
  }

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

  .notification-panel {
    right: 0;
    left: 0;
    width: auto;
  }

  .nav {
    grid-template-columns: 1fr;
    max-height: 260px;
  }

  h1 {
    font-size: 26px;
  }

  h2 {
    font-size: 17px;
  }

  .employee-hierarchy-head,
  .hierarchy-group,
  .hierarchy-rsm,
  .employee-card,
  .data-card,
  .document-row,
  .quotation-card,
  .tour-plan-card,
  .visit-user-card,
  .route-employee-card,
  .outstanding-employee-card {
    padding: 12px;
  }
}

/* Visits and Visit Locations refinement */
#routes.view.active,
#visits.view.active {
  gap: 14px;
}

.route-page-head {
  align-items: end;
  padding: 18px;
  border: 1px solid rgba(144, 169, 212, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--soft-shadow);
}

.route-page-head h2 {
  font-size: 22px;
}

.route-filter {
  padding: 0;
  align-items: end;
}

.route-filter input,
.route-filter button,
.visit-filter input,
.visit-filter button {
  border-radius: 10px;
}

.route-date-chips {
  margin: 0;
}

.route-date-chips span {
  background: #fff;
  color: var(--brand-dark);
}

.route-employee-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 18px;
}

.route-role-section {
  gap: 12px;
  padding: 16px;
  border: 1px solid rgba(144, 169, 212, 0.22);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.7);
  box-shadow: var(--soft-shadow);
}

.route-role-head {
  padding-bottom: 10px;
  border-bottom: 1px solid #e3ebf6;
}

.route-role-head div {
  display: grid;
  gap: 3px;
}

.route-role-head h3 {
  font-size: 18px;
}

.route-role-head small {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
}

.route-role-head > span {
  padding: 7px 10px;
  border: 1px solid #dfe9f6;
  border-radius: 999px;
  background: #f8fbff;
  color: var(--brand-dark);
}

.route-role-grid {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}

.route-employee-card {
  align-content: start;
  gap: 10px;
  padding: 12px;
  border-radius: 12px;
  background: #fff;
}

.route-employee-card header {
  align-items: flex-start;
}

.route-employee-card .employee-identity {
  min-width: 0;
}

.route-employee-card .employee-identity > div {
  min-width: 0;
}

.route-employee-card .employee-identity strong,
.route-employee-card .meta {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}

.mini-route-map,
.mini-route-map > span,
.mini-route-map iframe {
  min-height: 170px;
  height: 170px;
  border-radius: 10px;
}

.route-card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.route-card-footer div {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.route-card-footer strong {
  font-size: 15px;
}

.route-card-footer span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.route-card-footer button {
  min-height: 32px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--brand-dark);
  font-size: 11px;
}

.route-employee-card .route-timeline {
  max-height: 150px;
  overflow-y: auto;
  padding-right: 4px;
  scrollbar-width: thin;
}

.route-timeline-empty {
  min-height: 86px;
  display: grid;
  place-items: center;
  border-radius: 10px;
}

.visit-board-head {
  padding: 16px 18px;
  border: 1px solid rgba(144, 169, 212, 0.24);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: var(--soft-shadow);
}

.visit-board-head div {
  display: grid;
  gap: 4px;
}

.visit-board-head h3 {
  font-size: 20px;
}

.visit-board-head span {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.visit-board-head > strong {
  padding: 8px 11px;
  border: 1px solid #dfe9f6;
  border-radius: 999px;
  background: #f8fbff;
  color: var(--brand-dark);
  white-space: nowrap;
}

.visit-user-grid {
  grid-template-columns: repeat(auto-fit, minmax(310px, 1fr));
  align-items: stretch;
}

.visit-user-card {
  position: relative;
  gap: 9px;
  border-radius: 12px;
  box-shadow: 0 10px 28px rgba(16, 25, 39, 0.06);
}

.visit-user-card.has-visits {
  border-color: rgba(36, 138, 88, 0.28);
}

.visit-user-card.has-visits::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 4px;
  border-radius: 12px 0 0 12px;
  background: var(--ok);
}

.visit-card-role {
  letter-spacing: 0;
}

.visit-card-name {
  color: #526da0;
  font-size: 16px;
}

.visit-user-card > strong {
  color: var(--ink);
  font-size: 28px;
}

.visit-shop-list,
.visit-tour-plan {
  border-color: #dfe9f6;
  background: linear-gradient(180deg, #fbfdff, #f6f9fe);
}

.visit-shop-list.empty-plan,
.visit-tour-plan.empty-plan {
  background: #fff;
}

.visit-tour-shops,
.visit-shop-list > span {
  max-height: 138px;
}

.visit-table-head {
  padding: 14px 16px;
  border: 1px solid rgba(144, 169, 212, 0.24);
  border-radius: 12px;
  background: #fff;
}

.visit-table {
  gap: 8px;
}

.visit-table-row {
  border: 1px solid #e2ebf6;
  box-shadow: 0 1px 0 rgba(16, 25, 39, 0.03);
}

@media (max-width: 980px) {
  .route-page-head,
  .route-filter,
  .visit-board-head,
  .route-role-head,
  .route-card-footer {
    align-items: stretch;
    flex-direction: column;
  }

  .route-role-grid,
  .visit-user-grid {
    grid-template-columns: 1fr;
  }

  .route-filter input {
    min-width: 0;
  }
}

/* Month end and daily report table alignment */
.monthly-report-table {
  overflow-x: hidden;
}

.monthly-report-row {
  grid-template-columns: minmax(130px, 1.45fr) minmax(68px, 0.72fr) minmax(82px, 0.82fr) minmax(82px, 0.82fr) minmax(64px, 0.64fr) minmax(74px, 0.74fr) minmax(64px, 0.64fr) minmax(74px, 0.74fr) minmax(64px, 0.64fr) minmax(74px, 0.74fr) minmax(64px, 0.64fr) minmax(74px, 0.74fr) minmax(90px, 0.9fr) minmax(90px, 0.9fr) minmax(72px, 0.72fr) minmax(84px, 0.82fr);
  min-width: 0;
  width: 100%;
}

.monthly-report-row > strong:first-child,
.monthly-report-row > span:first-child {
  justify-items: start;
  text-align: left;
  padding-left: 12px;
  overflow: visible;
  white-space: normal;
}

.monthly-report-row > span,
.monthly-report-row > strong {
  min-width: 0;
  min-height: 28px;
  padding: 4px 5px;
  font-size: 11px;
}

.monthly-report-head > span {
  min-height: 42px;
  font-size: 10px;
  line-height: 1.15;
}

.monthly-report-head > span:nth-child(13),
.monthly-report-head > span:nth-child(14),
.monthly-report-head > span:nth-child(15) {
  padding-inline: 5px;
}

.today-report-table {
  display: block;
  overflow-x: auto;
  padding-bottom: 2px;
}

.today-report-row {
  grid-template-columns: minmax(260px, 1fr) 120px 120px 160px 110px;
  min-width: 770px;
}

.today-report-detail-row {
  grid-template-columns: 140px 120px 170px 120px minmax(300px, 1.2fr) minmax(230px, 1fr) 100px 100px 150px 100px;
  min-width: 1510px;
}

.today-report-row > span,
.today-report-row > strong,
.today-report-detail-row > span,
.today-report-detail-row > strong {
  min-width: 0;
}

.today-report-row > span:not(:first-child),
.today-report-row > strong:not(:first-child),
.today-report-detail-row > span:nth-last-child(-n+4),
.today-report-detail-row > strong:nth-last-child(-n+4) {
  justify-items: center;
  text-align: center;
}

.today-report-table-head > span {
  width: 100%;
}

.reports-layout {
  display: grid;
  gap: 18px;
}

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

.report-filter-grid label {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  text-transform: uppercase;
}

.report-month-select {
  color: var(--muted);
  display: grid;
  font-size: 12px;
  font-weight: 800;
  gap: 8px;
  grid-row: span 2;
  text-transform: uppercase;
}

.report-month-checkboxes {
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 6px;
  max-height: 166px;
  overflow-y: auto;
  padding: 10px;
}

.report-month-check {
  align-items: center;
  background: #fff;
  border: 1px solid #e7eef8;
  border-radius: 6px;
  color: var(--navy);
  display: flex;
  flex-direction: row;
  font-size: 13px;
  font-weight: 700;
  gap: 8px;
  padding: 8px 10px;
  text-transform: none;
}

.report-month-check input {
  accent-color: var(--brand-dark);
  height: 16px;
  margin: 0;
  width: 16px;
}

.sales-report-table {
  overflow-x: auto;
  padding: 4px;
}

.sales-report-pivot,
.sales-report-difference {
  border-collapse: collapse;
  color: var(--navy);
  font-size: 14px;
  margin-bottom: 28px;
  min-width: 760px;
  table-layout: fixed;
  width: min(100%, 900px);
}

.sales-report-pivot th,
.sales-report-pivot td,
.sales-report-difference th,
.sales-report-difference td {
  border: 1px solid #111827;
  height: 28px;
  padding: 3px 8px;
  text-align: right;
  vertical-align: middle;
}

.sales-report-pivot th:first-child,
.sales-report-pivot td:first-child,
.sales-report-difference th:first-child,
.sales-report-difference td:first-child {
  text-align: center;
}

.sales-report-pivot th,
.sales-report-difference th,
.report-month-row th,
.report-month-row td,
.report-total-row {
  background: #d9eaf8;
  font-weight: 800;
}

.report-spacer-row td {
  background: #fff;
  border: 0;
  height: 28px;
}

.sales-report-difference th {
  background: #fff2cc;
  color: #ff0000;
}

.report-difference-row td {
  font-weight: 800;
}

@media (max-width: 900px) {
  .report-filter-grid {
    grid-template-columns: 1fr;
  }

  .employee-asset-form,
  .employee-asset-row {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }
}
