: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: 70px minmax(122px, 0.8fr) minmax(160px, 1fr) minmax(108px, 0.75fr) 78px;
  gap: 8px;
  align-items: center;
  justify-content: end;
  min-width: 0;
}

.employee-actions button,
.employee-actions select {
  min-height: 38px;
  border-radius: 12px;
  padding: 8px 10px;
  font-size: 13px;
}

@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;
}

.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 {
  padding: 13px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.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(250px, 1.45fr) minmax(150px, 0.8fr) minmax(170px, 0.9fr) minmax(135px, 0.7fr) 92px minmax(560px, 1.8fr);
  gap: 12px;
  min-width: 1280px;
}

.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: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 253, 0.9));
  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;
}

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

.upload-panel {
  margin-bottom: 0;
}

.upload-grid {
  display: grid;
  gap: 14px;
  margin-bottom: 16px;
}

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

.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-list,
.greeting-grid {
  display: grid;
  gap: 12px;
}

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

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

.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: 8px;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
}

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

.document-actions button {
  padding: 9px 12px;
}

.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;
}

.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-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;
  gap: 12px;
}

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

.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;
}

.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;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.quotation-summary button {
  margin-left: auto;
  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%;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.quotation-table-row {
  display: grid;
  grid-template-columns: minmax(120px, 0.8fr) minmax(180px, 1.2fr) minmax(130px, 0.85fr) minmax(170px, 1fr) minmax(110px, 0.7fr) minmax(190px, 1.1fr) minmax(100px, 0.6fr);
  gap: 12px;
  align-items: center;
  min-width: 980px;
  padding: 12px 14px;
  border: 0;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
}

.quotation-table-head {
  position: sticky;
  top: 0;
  z-index: 1;
  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-table-row .quotation-actions {
  justify-content: flex-start;
}

.quotation-table-row .quotation-actions button {
  min-width: auto;
  padding: 7px 9px;
  font-size: 12px;
}

.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) auto;
  min-width: 0;
  align-items: end;
}

.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-wrap: anywhere;
}

.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;
  justify-content: center;
}

.employee-edit-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.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);
}

.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;
}

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

.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;
}

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

.expense-image {
  height: 150px;
  margin-top: 12px;
}

.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(260px, 1fr));
  gap: 18px;
}

.visit-user-card {
  display: grid;
  gap: 16px;
  min-height: 176px;
  padding: 22px;
  text-align: left;
  border: 1px solid var(--line);
  border-radius: 18px;
  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-user-card span {
  color: var(--brand-dark);
  font-weight: 900;
}

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

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

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

.visit-table-row {
  display: grid;
  grid-template-columns: 1.35fr 0.9fr 0.9fr 0.65fr 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 14px 16px;
  border-radius: 10px;
  background: #fff;
}

.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-overview {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.expense-overview article {
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background:
    linear-gradient(135deg, rgba(144, 169, 212, 0.16), rgba(233, 241, 255, 0.72)),
    #fff;
}

.expense-overview span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 900;
  text-transform: uppercase;
}

.expense-overview strong {
  display: block;
  margin-top: 8px;
  font-size: 24px;
}

.user-expense-card {
  display: grid;
  gap: 14px;
}

.expense-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.expense-summary span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 9px;
  background: #f9fbfd;
}

.expense-stack {
  display: grid;
  gap: 10px;
}

.expense-row {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px;
  background: #fbfdff;
}

.expense-row-main {
  display: flex;
  justify-content: space-between;
  gap: 12px;
}

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

.expense-amount strong {
  font-size: 18px;
}

.expense-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.expense-actions button {
  min-height: 34px;
  border: 0;
  border-radius: 10px;
  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); }

.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: 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; }
  .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-actions { grid-template-columns: 1fr; }
  .management-select-row { 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; }
  #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: 900px; }
  .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; }
  .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; }
}
