@font-face {
  font-family: "Yekan";
  src: url("/assets/fonts/typography/yekan-regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Yekan";
  src: url("/assets/fonts/typography/yekan-medium.woff2") format("woff2");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Yekan";
  src: url("/assets/fonts/typography/yekan-bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --primary: #2563eb;
  --primary-strong: #1d4ed8;
  --primary-soft: #dbeafe;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --page: #eef3f8;
  --border: #d8e0ea;
  --muted: #64748b;
  --text: #0f172a;
  --danger: #dc2626;
  --danger-soft: #fee2e2;
  --success: #059669;
  --success-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #fef3c7;
  --sidebar: #0f172a;
  --sidebar-soft: #1e293b;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.08);
  --radius: 8px;
  --topbar-height: 68px;
  --sidebar-width: 292px;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: "Yekan", Tahoma, Arial, sans-serif;
  font-size: 15px;
  letter-spacing: 0;
  overflow-x: hidden;
}

button,
input,
select,
textarea {
  font: inherit;
}

a {
  color: inherit;
  text-decoration: none;
}

.app-root {
  min-height: 100dvh;
}

.login-page {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(320px, 0.95fr) minmax(360px, 440px);
  align-items: center;
  justify-content: center;
  gap: 22px;
  padding: clamp(18px, 4vw, 56px);
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.18), transparent 32%),
    radial-gradient(circle at 85% 70%, rgba(5, 150, 105, 0.15), transparent 30%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.86), rgba(238, 243, 248, 0.92)),
    var(--page);
  overflow: hidden;
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 26px;
  border: 1px solid rgba(216, 224, 234, 0.75);
  border-radius: 18px;
  pointer-events: none;
}

.login-showcase {
  max-width: 720px;
  min-height: 520px;
  border: 1px solid rgba(216, 224, 234, 0.78);
  border-radius: 18px;
  background:
    linear-gradient(160deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.9)),
    var(--sidebar);
  color: #f8fafc;
  padding: clamp(28px, 5vw, 56px);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  position: relative;
  overflow: hidden;
}

.login-showcase::before,
.login-showcase::after {
  content: "";
  position: absolute;
  border: 1px solid rgba(148, 163, 184, 0.2);
  background: rgba(255, 255, 255, 0.06);
  border-radius: 8px;
}

.login-showcase::before {
  width: 58%;
  height: 132px;
  top: 52px;
  right: 42px;
}

.login-showcase::after {
  width: 44%;
  height: 96px;
  top: 210px;
  left: 54px;
}

.showcase-kicker {
  width: max-content;
  border: 1px solid rgba(191, 219, 254, 0.38);
  border-radius: 999px;
  padding: 7px 12px;
  color: #bfdbfe;
  font-weight: 700;
  margin-bottom: 18px;
}

.login-showcase h2 {
  max-width: 560px;
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.35;
  font-weight: 700;
}

.login-showcase p {
  max-width: 560px;
  margin: 16px 0 0;
  color: #cbd5e1;
  line-height: 1.9;
}

.showcase-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin-top: 28px;
}

.showcase-grid div {
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: var(--radius);
  padding: 12px;
  background: rgba(255, 255, 255, 0.07);
}

.showcase-grid strong,
.showcase-grid span {
  display: block;
}

.showcase-grid strong {
  font-size: 20px;
}

.showcase-grid span {
  color: #cbd5e1;
  font-size: 12px;
  margin-top: 4px;
}

.login-panel {
  width: min(100%, 460px);
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
  position: relative;
  z-index: 1;
  backdrop-filter: blur(18px);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.brand-lockup img,
.brand-logo {
  width: 46px;
  height: 46px;
  object-fit: contain;
}

.brand-title {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}

.brand-subtitle {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-weight: 600;
}

.field input,
.field select,
.field textarea {
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 10px 12px;
  outline: none;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field textarea {
  min-height: 96px;
  resize: vertical;
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.password-row {
  display: grid;
  grid-template-columns: 1fr 44px;
  gap: 8px;
}

.login-submit {
  width: 100%;
}

.quick-login {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

.quick-login-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
}

.quick-login-head span {
  color: var(--muted);
  font-size: 12px;
}

.quick-login-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.quick-login-card {
  min-height: 58px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, #fff, #f8fafc);
  color: var(--text);
  display: grid;
  gap: 3px;
  align-content: center;
  text-align: right;
  padding: 10px 12px;
  cursor: pointer;
  transition: border-color 160ms ease, transform 160ms ease, box-shadow 160ms ease;
}

.quick-login-card:hover,
.quick-login-card:focus-visible {
  border-color: var(--primary);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.12);
  transform: translateY(-1px);
}

.quick-login-card span {
  font-weight: 700;
}

.quick-login-card small {
  color: var(--muted);
  font-size: 12px;
}

.shell {
  min-height: 100dvh;
  display: grid;
  grid-template-columns: var(--sidebar-width) 1fr;
  direction: rtl;
}

.sidebar {
  background: linear-gradient(180deg, var(--sidebar), var(--sidebar-soft));
  color: #e2e8f0;
  min-height: 100dvh;
  position: sticky;
  top: 0;
  overflow-y: auto;
  padding: 18px 14px;
  z-index: 40;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px 18px;
  border-bottom: 1px solid rgba(226, 232, 240, 0.12);
}

.sidebar-title {
  font-size: 16px;
  font-weight: 700;
}

.sidebar-nav {
  display: grid;
  gap: 6px;
  margin-top: 16px;
}

.nav-link,
.nav-parent {
  width: 100%;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border: 0;
  border-radius: var(--radius);
  background: transparent;
  color: #dbe4ef;
  text-align: right;
  cursor: pointer;
  transition: background 160ms ease, color 160ms ease;
}

.nav-link:hover,
.nav-parent:hover,
.nav-link.active {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
}

.nav-children {
  display: grid;
  gap: 4px;
  margin: 4px 24px 8px 0;
}

.nav-children .nav-link {
  min-height: 36px;
  font-size: 13px;
  color: #cbd5e1;
}

.icon {
  width: 20px;
  height: 20px;
  flex: 0 0 20px;
  display: inline-flex;
}

.content-shell {
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: rgba(255, 255, 255, 0.88);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 0 24px;
  backdrop-filter: blur(16px);
}

.topbar-actions,
.toolbar,
.row-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.main-content {
  padding: 24px;
}

.shell,
.content-shell,
.main-content,
.panel {
  min-width: 0;
}

.page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 6px;
}

.page-title {
  margin: 0;
  font-size: 23px;
  font-weight: 700;
}

.page-hint {
  margin: 6px 0 0;
  color: var(--muted);
}

.btn {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
  padding: 8px 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  transition: background 160ms ease, border-color 160ms ease, transform 160ms ease;
}

.btn:hover {
  background: var(--surface-alt);
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled,
.btn[aria-busy="true"] {
  opacity: 0.58;
  cursor: not-allowed;
  transform: none;
}

.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-strong);
}

.filter-toggle {
  gap: 8px;
  color: var(--primary-strong);
  background: #eef8fd;
  border-color: #bee7f7;
}

.filter-toggle:hover,
.filter-toggle.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(14, 155, 216, 0.18);
}

.filter-toggle .filter-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  color: var(--primary-strong);
  background: #fff;
  font-size: 12px;
  font-weight: 800;
}

.btn-danger {
  color: var(--danger);
  border-color: #fecaca;
  background: #fff;
}

.btn-sm {
  min-height: 34px;
  padding: 6px 10px;
  font-size: 12px;
}

.icon-btn {
  width: 40px;
  padding: 0;
}

.panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.04);
}

.filters {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) repeat(3, minmax(140px, 180px));
  gap: 10px;
  align-items: end;
  padding: 14px;
  margin-bottom: 0;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
  animation: filter-panel-in 160ms ease-out;
}

.filters[hidden] {
  display: none;
}

.filters input,
.filters select {
  min-height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 10px;
}

.filters select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) left 16px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) left 11px center / 7px 7px no-repeat,
    #fff;
  padding-inline-start: 36px;
}

.filter-field,
.form-field {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 6px;
}

.filter-field span,
.form-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
}

.form-field label,
.form-section legend {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.form-label-icon {
  width: 22px;
  height: 22px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 22px;
  border-radius: 7px;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.form-label-icon svg {
  width: 15px;
  height: 15px;
}

.filter-field.compact {
  min-width: 130px;
}

.filter-actions {
  display: flex;
  align-items: end;
  gap: 8px;
}

.filter-actions .btn {
  min-width: 112px;
}

@keyframes filter-panel-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.grid-wrap {
  overflow: auto;
}

.data-grid {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  min-width: 840px;
}

.data-grid th,
.data-grid td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
}

.data-grid th {
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  background: var(--surface-alt);
  position: sticky;
  top: 0;
}

.data-grid tr:hover td {
  background: #fbfdff;
}

.badge {
  display: inline-flex;
  min-height: 26px;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.badge.success {
  background: var(--success-soft);
  color: var(--success);
}

.badge.warning {
  background: var(--warning-soft);
  color: var(--warning);
}

.badge.danger {
  background: var(--danger-soft);
  color: var(--danger);
}

.pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  color: var(--muted);
}

.metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric {
  padding: 18px;
}

.metric-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--muted);
}

.metric-value {
  font-size: 26px;
  font-weight: 700;
  margin-top: 14px;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.dashboard-grid > *,
.metrics > * {
  min-width: 0;
}

.dashboard-grid .grid-wrap {
  max-width: 100%;
  overflow-x: auto;
}

.dashboard-grid .data-grid {
  min-width: 0;
  table-layout: auto;
}

.dashboard-grid .data-grid th,
.dashboard-grid .data-grid td {
  white-space: normal;
}

.tabs {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding: 10px;
  border-bottom: 1px solid var(--border);
}

.tab {
  white-space: nowrap;
  min-height: 38px;
}

.tab.active {
  background: var(--primary-soft);
  border-color: #bfdbfe;
  color: var(--primary-strong);
}

.detail-body {
  padding: 16px;
}

.definition-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

.definition-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
}

.definition-label {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 6px;
}

.kanban-board {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  gap: 14px;
  overflow-x: auto;
}

.kanban-column {
  min-height: 360px;
  padding: 12px;
}

.kanban-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-top: 10px;
  cursor: grab;
}

.modal-backdrop-custom {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.48);
  display: grid;
  place-items: center;
  padding: 18px;
  z-index: 1000;
}

.modal-panel {
  width: min(100%, 760px);
  max-height: calc(100dvh - 36px);
  overflow: auto;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.modal-head,
.modal-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-foot {
  border-top: 1px solid var(--border);
  border-bottom: 0;
}

.modal-body {
  padding: 16px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal-body .field.wide {
  grid-column: 1 / -1;
}

.empty-state,
.error-state,
.loading-state {
  padding: 32px;
  text-align: center;
  color: var(--muted);
}

.toast-stack {
  position: fixed;
  left: 18px;
  bottom: 18px;
  z-index: 1200;
  display: grid;
  gap: 8px;
}

.toast-item {
  background: var(--sidebar);
  color: #fff;
  border-radius: var(--radius);
  padding: 12px 14px;
  box-shadow: var(--shadow);
}

.mobile-menu-button {
  display: none;
}

@media (max-width: 1024px) {
  .login-page {
    grid-template-columns: 1fr;
    align-content: start;
  }

  .login-showcase {
    min-height: auto;
    width: min(100%, 680px);
    margin: 0 auto;
  }

  .login-panel {
    margin: 0 auto;
  }

  .shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    right: 0;
    top: 0;
    width: min(88vw, var(--sidebar-width));
    transform: translateX(100%);
    transition: transform 220ms ease;
  }

  .shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  .mobile-menu-button {
    display: inline-flex;
  }

  .metrics,
  .dashboard-grid,
  .definition-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 720px) {
  .login-page {
    padding: 14px;
  }

  .login-page::before,
  .login-showcase {
    display: none;
  }

  .login-panel {
    border-radius: var(--radius);
    padding: 20px;
  }

  .quick-login-grid {
    grid-template-columns: 1fr;
  }

  .main-content,
  .topbar {
    padding-inline: 14px;
  }

  .page-header {
    display: grid;
  }

  .filters,
  .metrics,
  .dashboard-grid,
  .definition-grid,
  .modal-body {
    grid-template-columns: 1fr;
  }

  .data-grid {
    min-width: 720px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}

/* Brand refresh and professional data UI */
:root {
  --primary: #1689d8;
  --primary-strong: #0d67b2;
  --primary-soft: #e1f2ff;
  --accent: #7f858c;
  --surface: #ffffff;
  --surface-alt: #f6f9fc;
  --page: #eef5f8;
  --border: #d6e2eb;
  --muted: #617284;
  --text: #102033;
  --danger: #c81e39;
  --danger-soft: #ffe4e9;
  --success: #087f5b;
  --success-soft: #dff8ec;
  --warning: #b7791f;
  --warning-soft: #fff3d6;
  --sidebar: #0b6fa6;
  --sidebar-soft: #1188c2;
  --sidebar-elevated: #23a8df;
  --sidebar-text: #f8fbff;
  --sidebar-muted: #d8effb;
  --shadow-sm: 0 8px 18px rgba(16, 32, 51, 0.06);
  --shadow: 0 20px 55px rgba(16, 32, 51, 0.12);
  --shadow-strong: 0 26px 80px rgba(7, 20, 38, 0.24);
  --radius: 8px;
  --sidebar-width: 260px;
  --sidebar-collapsed-width: 76px;
}

body {
  background:
    linear-gradient(180deg, rgba(22, 137, 216, 0.07), transparent 280px),
    var(--page);
}

button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
.ts-control.focus {
  outline: 3px solid rgba(22, 137, 216, 0.22);
  outline-offset: 2px;
}

.shell {
  grid-template-columns: var(--sidebar-width) minmax(0, 1fr);
  transition: grid-template-columns 220ms ease;
}

.shell.sidebar-collapsed {
  grid-template-columns: var(--sidebar-collapsed-width) minmax(0, 1fr);
}

.sidebar {
  width: var(--sidebar-width);
  background:
    radial-gradient(circle at 14% 8%, rgba(125, 211, 252, 0.2), transparent 28%),
    linear-gradient(180deg, #0b74ad 0%, var(--sidebar-soft) 56%, #0b628f 100%);
  color: var(--sidebar-text);
  box-shadow: -18px 0 44px rgba(7, 50, 80, 0.2);
  border-left: 1px solid rgba(186, 230, 253, 0.18);
  transition: width 220ms ease, transform 220ms ease;
  scrollbar-color: rgba(148, 163, 184, .38) transparent;
}

.shell.sidebar-collapsed .sidebar {
  width: var(--sidebar-collapsed-width);
  padding-inline: 10px;
  overflow: visible;
}

.sidebar-header {
  min-height: 70px;
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
  padding: 8px 4px 14px;
  border-bottom: 1px solid rgba(186, 230, 253, 0.18);
}

.sidebar-header .brand-logo {
  width: 44px;
  height: 44px;
  padding: 0;
  flex: 0 0 auto;
  object-fit: contain;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  filter: drop-shadow(0 8px 16px rgba(7, 50, 80, 0.22));
}

.sidebar-brand-text {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.sidebar-title {
  margin: 0;
  color: #fff;
  font-size: 14px;
  font-weight: 800;
  line-height: 1.55;
  white-space: normal;
}

.sidebar-brand-text,
.nav-link > span:not(.icon),
.nav-parent > span:not(.icon):not(.nav-caret),
.brand-subtitle {
  transition: opacity 160ms ease, transform 160ms ease;
}

.shell.sidebar-collapsed .sidebar-brand-text,
.shell.sidebar-collapsed .nav-link > span:not(.icon),
.shell.sidebar-collapsed .nav-parent > span:not(.icon):not(.nav-caret),
.shell.sidebar-collapsed .brand-subtitle {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  transform: translateX(8px);
}

.sidebar-collapse {
  margin-inline-start: auto;
  margin-right: 0;
  width: 38px;
  min-width: 38px;
  height: 38px;
  min-height: 38px;
  padding: 0;
  flex: 0 0 38px;
  border-radius: 12px;
  background: linear-gradient(180deg, #29a9e8, #147fc0);
  color: #ffffff;
  border-color: rgba(186, 230, 253, 0.44);
  box-shadow:
    0 10px 20px rgba(7, 50, 80, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.sidebar-collapse:hover {
  background: linear-gradient(180deg, #38b9f2, #168bd0);
  border-color: #bae6fd;
  color: #fff;
}

.shell.sidebar-collapsed .sidebar-collapse .icon {
  transform: rotate(180deg);
}

.nav-parent,
.nav-link {
  position: relative;
  min-height: 46px;
  gap: 12px;
  padding: 10px;
  border-radius: 12px;
  color: var(--sidebar-muted);
  border: 1px solid transparent;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
}

.nav-link > span:not(.icon),
.nav-parent > span:not(.icon):not(.nav-caret) {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-link.active::before,
.nav-parent.active::before {
  content: "";
  position: absolute;
  right: -8px;
  width: 3px;
  height: 22px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 18px rgba(22, 137, 216, .68);
}

.nav-link:hover,
.nav-parent:hover,
.nav-link.active,
.nav-parent.active {
  color: #fff;
  background:
    linear-gradient(90deg, rgba(22, 137, 216, 0.38), rgba(255, 255, 255, 0.1));
  border-color: rgba(186, 230, 253, .36);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08), 0 10px 22px rgba(7, 50, 80, 0.14);
}

.nav-link.active,
.nav-parent.active {
  background:
    linear-gradient(90deg, rgba(22, 137, 216, 0.66), rgba(56, 189, 248, 0.2));
  border-color: rgba(186, 230, 253, .58);
}

.nav-caret {
  margin-right: auto;
  display: inline-flex;
  color: rgba(248, 251, 255, 0.72);
  transition: transform 180ms ease;
}

.nav-group.open .nav-caret {
  transform: rotate(-90deg);
}

.nav-children {
  display: none;
  gap: 6px;
  margin: 6px 6px 12px 0;
  padding-inline-start: 14px;
  border-inline-start: 1px solid rgba(186, 230, 253, 0.16);
}

.nav-group.open .nav-children {
  display: grid;
}

.shell.sidebar-collapsed .nav-children,
.shell.sidebar-collapsed .nav-caret {
  display: none;
}

.shell.sidebar-collapsed .nav-link,
.shell.sidebar-collapsed .nav-parent {
  justify-content: center;
  padding-inline: 0;
  border-radius: 14px;
}

.shell.sidebar-collapsed .nav-link > .icon,
.shell.sidebar-collapsed .nav-parent > .icon {
  opacity: 1;
  position: static;
  transform: none;
}

.shell.sidebar-collapsed .nav-link.active .icon,
.shell.sidebar-collapsed .nav-parent.active .icon {
  color: #ffffff;
  filter: drop-shadow(0 0 10px rgba(186, 230, 253, 0.5));
}

.shell.sidebar-collapsed .nav-link:hover::after,
.shell.sidebar-collapsed .nav-parent:hover::after {
  content: attr(title);
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  white-space: nowrap;
  background: #0b628f;
  color: #fff;
  border: 1px solid rgba(255,255,255,.18);
  border-radius: var(--radius);
  padding: 8px 10px;
  box-shadow: var(--shadow);
  z-index: 100;
}

.shell.sidebar-collapsed .sidebar-header {
  min-height: auto;
  display: grid;
  justify-items: center;
  gap: 8px;
  padding: 6px 0 12px;
  border-bottom-color: rgba(186, 230, 253, 0.14);
}

.shell.sidebar-collapsed .sidebar-header .brand-logo {
  width: 34px;
  height: 34px;
  padding: 0;
}

.shell.sidebar-collapsed .sidebar-collapse {
  margin: 0;
  background: #1689d8;
  border-color: #bae6fd;
}

.topbar {
  min-height: 72px;
  padding: 10px 20px 10px 18px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(247, 251, 253, 0.94));
  border-bottom: 1px solid rgba(214, 226, 235, 0.86);
  box-shadow: 0 10px 30px rgba(16, 32, 51, 0.05);
}

.topbar-brand-group {
  flex: 1 1 auto;
  min-width: 0;
  gap: 12px;
}

.topbar-brand-title {
  min-width: 0;
  display: block;
  overflow: hidden;
  color: #123b56;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.3;
}

.topbar-meta-group {
  flex: 0 0 auto;
  gap: 10px;
}

.topbar-user-badge {
  max-width: 220px;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #24516f;
  font-size: 13px;
  font-weight: 700;
  border: 1px solid rgba(22, 137, 216, 0.12);
  border-radius: 14px;
  background: rgba(22, 137, 216, 0.07);
  text-decoration: none;
  transition: border-color .18s ease, background .18s ease, color .18s ease;
}

.topbar-user-badge:hover {
  border-color: rgba(22, 137, 216, 0.28);
  background: rgba(22, 137, 216, 0.12);
  color: #0f6090;
}

.topbar-user-badge .icon {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.topbar-user-badge span:last-child {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-password-link {
  color: #0f6090;
  background: #fff;
  border-color: rgba(22, 137, 216, 0.18);
}

.topbar .icon-btn,
.mobile-menu-button {
  border-radius: 14px;
}

.main-content {
  max-width: 1680px;
  width: 100%;
}

.panel {
  box-shadow: var(--shadow-sm);
}

.btn {
  min-height: 42px;
  touch-action: manipulation;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-strong));
  border-color: transparent;
  box-shadow: 0 10px 22px rgba(14, 155, 216, 0.22);
}

.filters {
  grid-template-columns: minmax(240px, 1fr) repeat(3, minmax(132px, 176px));
  box-shadow: var(--shadow-sm);
  align-items: end;
  margin-bottom: 0;
  border-end-start-radius: 0;
  border-end-end-radius: 0;
}

.filters[hidden] {
  display: none;
}

.grid-panel {
  overflow: visible;
}

.grid-tools {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fff, #f9fcfe);
}

.column-menu {
  position: absolute;
  top: 54px;
  right: 14px;
  z-index: 20;
  display: grid;
  gap: 8px;
  min-width: 210px;
  padding: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.column-menu label {
  display: flex;
  gap: 8px;
  align-items: center;
  color: var(--text);
}

.gridjs-wrapper,
.gridjs-container {
  direction: rtl;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-family: "Yekan", Tahoma, Arial, sans-serif;
}

.gridjs-wrapper {
  max-width: 100%;
  overflow-x: auto;
}

.gridjs-table {
  width: 100%;
  min-width: 840px;
  border: 0;
}

.gridjs-th,
.gridjs-td {
  padding: 13px 14px !important;
  border-color: rgba(214, 226, 235, .85) !important;
  text-align: right !important;
  white-space: nowrap;
}

.gridjs-th {
  background: var(--surface-alt) !important;
  color: var(--muted) !important;
  font-weight: 800;
}

.gridjs-tr:hover .gridjs-td {
  background: #f6fbfe;
}

.gridjs-footer {
  display: none;
}

.accounts-grid-page .grid-wrap,
.accounts-grid-page .gridjs-container,
.accounts-grid-page .gridjs-wrapper {
  overflow-x: hidden;
}

.company-gridjs-table-accounts {
  table-layout: fixed;
}

.company-gridjs-table-accounts .gridjs-th,
.company-gridjs-table-accounts .gridjs-td {
  white-space: normal !important;
  vertical-align: top;
}

.company-gridjs-table-accounts .gridjs-th:first-child,
.company-gridjs-table-accounts .gridjs-td:first-child {
  width: 26%;
}

.company-gridjs-table-accounts .gridjs-th:last-child,
.company-gridjs-table-accounts .gridjs-td:last-child {
  width: 148px;
  white-space: nowrap !important;
}

.accounts-grid-page .accounts-filters {
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: 14px;
  padding: 18px;
  background:
    linear-gradient(180deg, rgba(248, 252, 255, 0.98), rgba(255, 255, 255, 0.98));
  border-color: rgba(185, 211, 226, 0.9);
  box-shadow: 0 14px 34px rgba(15, 65, 92, 0.07);
}

.accounts-grid-page .accounts-filters .filter-field {
  grid-column: span 2;
}

.accounts-grid-page .accounts-filters .filter-field-search {
  grid-column: span 4;
}

.accounts-grid-page .accounts-filters .filter-field span {
  color: #41596a;
  font-size: 12px;
  font-weight: 800;
}

.accounts-grid-page .accounts-filters input,
.accounts-grid-page .accounts-filters select,
.accounts-grid-page .accounts-filters .ts-control {
  min-height: 44px;
  border-color: #bfd5e3;
  border-radius: 10px;
  background-color: #fff !important;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.9), inset 0 1px 2px rgba(15, 65, 92, 0.04);
}

.accounts-grid-page .accounts-filters input:focus,
.accounts-grid-page .accounts-filters select:focus,
.accounts-grid-page .accounts-filters .ts-wrapper.focus .ts-control {
  border-color: rgba(14, 155, 216, 0.68);
  box-shadow: 0 0 0 3px rgba(14, 155, 216, 0.14);
  outline: 0;
}

.accounts-grid-page .accounts-filters .filter-field-search input {
  padding-inline: 14px;
  font-weight: 700;
}

.accounts-grid-page .accounts-filters .filter-field.compact {
  grid-column: span 2;
  min-width: 0;
}

.accounts-grid-page .accounts-filters .filter-actions {
  grid-column: span 3;
  justify-content: flex-end;
}

.accounts-grid-page .accounts-filters .filter-actions .btn {
  min-width: 104px;
}

@media (max-width: 1280px) {
  .accounts-grid-page .accounts-filters .filter-field {
    grid-column: span 3;
  }

  .accounts-grid-page .accounts-filters .filter-field-search {
    grid-column: span 6;
  }

  .accounts-grid-page .accounts-filters .filter-field.compact {
    grid-column: span 3;
  }

  .accounts-grid-page .accounts-filters .filter-actions {
    grid-column: span 6;
  }
}

@media (max-width: 760px) {
  .accounts-grid-page .accounts-filters {
    padding: 14px;
  }

  .accounts-grid-page .accounts-filters .filter-field,
  .accounts-grid-page .accounts-filters .filter-field-search,
  .accounts-grid-page .accounts-filters .filter-field.compact,
  .accounts-grid-page .accounts-filters .filter-actions {
    grid-column: 1 / -1;
  }

  .accounts-grid-page .accounts-filters .filter-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }

  .accounts-grid-page .accounts-filters .filter-actions .btn {
    width: 100%;
    min-width: 0;
  }
}

.grid-row-actions {
  flex-wrap: nowrap;
  justify-content: flex-start;
}

.account-grid-card {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.account-grid-thumb {
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(14,155,216,.08), rgba(255,255,255,.96));
  border: 1px solid rgba(14,155,216,.14);
}

.account-grid-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-grid-card-copy,
.account-grid-stack {
  min-width: 0;
}

.account-grid-card-copy strong,
.account-grid-stack strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.account-grid-card-copy span,
.account-grid-stack span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
}

.account-grid-card-copy strong,
.account-grid-card-copy span,
.account-grid-stack strong,
.account-grid-stack span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.chart-card {
  min-height: 330px;
  padding-bottom: 12px;
}

.chart-card canvas {
  width: 100%;
  max-width: 100%;
  height: 260px !important;
  padding: 8px 16px 16px;
}

.modal-backdrop-custom {
  background: rgba(7, 20, 38, 0.58);
  backdrop-filter: blur(4px);
}

.modal-panel {
  width: min(100%, 860px);
  max-height: calc(100dvh - 40px);
  overflow: hidden;
  border: 1px solid rgba(214, 226, 235, .9);
  border-radius: 12px;
  box-shadow: var(--shadow-strong);
}

.modal-head,
.modal-foot {
  position: sticky;
  z-index: 2;
  background: rgba(255,255,255,.96);
  backdrop-filter: blur(14px);
}

.modal-head {
  top: 0;
}

.modal-foot {
  bottom: 0;
}

.modal-body {
  max-height: calc(100dvh - 180px);
  overflow: auto;
  display: block;
  padding: 18px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.form-section {
  border: 0;
  padding: 0;
  margin: 0 0 18px;
}

.form-section-card {
  border: 1px solid rgba(214, 226, 235, .92);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 14px;
  background: linear-gradient(180deg, #fff, #fbfdff);
}

.form-section legend {
  float: none;
  width: auto;
  margin: 0 0 12px;
  font-size: 14px;
  font-weight: 700;
  color: var(--primary-strong);
}

.modal-body-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.modal-body-grid .field.wide {
  grid-column: 1 / -1;
}

.modal-body-grid .form-field-wide {
  grid-column: 1 / -1;
}

.form-field[hidden] {
  display: none !important;
}

.inline-action-field {
  display: flex;
  align-items: stretch;
  gap: 8px;
  min-width: 0;
}

.inline-action-field select {
  flex: 1 1 auto;
  min-width: 0;
}

.inline-action-field .btn {
  flex: 0 0 auto;
  min-height: 44px;
  white-space: nowrap;
}

.form-field input[type="file"] {
  padding: 10px;
  border-style: dashed;
  border-color: rgba(14, 155, 216, .35);
  background: linear-gradient(180deg, #fff, #f7fcff);
  cursor: pointer;
}

.field label {
  display: flex;
  align-items: center;
  gap: 4px;
}

.required-mark,
.field-error {
  color: var(--danger);
}

.field-helper,
.field-error {
  min-height: 18px;
  font-size: 12px;
}

.field-helper {
  color: var(--muted);
}

.field input.invalid,
.field select.invalid,
.field textarea.invalid,
.form-field input.invalid,
.form-field select.invalid,
.form-field textarea.invalid,
.invoice-line input.invalid,
.invoice-line select.invalid,
.ts-wrapper.invalid .ts-control {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(200, 30, 57, .1);
}

.form-field input,
.form-field select,
.form-field textarea {
  width: 100%;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fff;
}

.form-field select {
  appearance: none;
  background:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%) left 18px center / 7px 7px no-repeat,
    linear-gradient(135deg, var(--muted) 50%, transparent 50%) left 13px center / 7px 7px no-repeat,
    #fff;
  padding-inline-start: 40px;
}

.form-field input:disabled,
.form-field select:disabled,
.form-field textarea:disabled,
.form-field input[readonly] {
  color: var(--muted);
  background: #f3f7fb;
  cursor: not-allowed;
}

.field-validation {
  min-height: 18px;
  font-size: 12px;
  color: var(--danger);
}

.form-message {
  --message-accent: var(--primary-strong);
  --message-bg: #eef8fd;
  --message-border: #b7ddea;
  --message-text: #123b56;
  --message-muted: #36586b;
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  gap: 10px;
  margin: 0 24px 12px;
  padding: 12px 14px;
  border: 1px solid var(--message-border);
  border-inline-start: 4px solid var(--message-accent);
  border-radius: var(--radius);
  background: var(--message-bg);
  color: var(--message-text);
  font-size: 13px;
  line-height: 1.75;
  box-shadow: 0 10px 24px rgba(15, 23, 42, .06);
}

.modal-body + .form-message {
  margin-top: 14px;
}

.form-message[hidden] {
  display: none;
}

.form-message-icon {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  align-self: start;
  border-radius: 999px;
  color: #fff;
  background: var(--message-accent);
  box-shadow: 0 8px 18px rgba(15, 23, 42, .12);
}

.form-message-icon .icon,
.form-message-icon svg {
  width: 18px;
  height: 18px;
}

.form-message-content {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.form-message-title {
  color: var(--message-text);
  font-size: 13px;
  font-weight: 800;
}

.form-message-text,
.form-message-list {
  margin: 0;
  color: var(--message-muted);
}

.form-message-list {
  padding-inline-start: 18px;
}

.form-message-list li + li {
  margin-top: 2px;
}

.form-message-error {
  --message-accent: #b4232f;
  --message-bg: #fff5f6;
  --message-border: #f0b9c0;
  --message-text: #7f1d1d;
  --message-muted: #8f2530;
}

.form-message-warning {
  --message-accent: #a16207;
  --message-bg: #fff8e8;
  --message-border: #f4d28a;
  --message-text: #713f12;
  --message-muted: #854d0e;
}

.form-message-success {
  --message-accent: #15803d;
  --message-bg: #edfdf3;
  --message-border: #a9e7bf;
  --message-text: #14532d;
  --message-muted: #166534;
}

.form-message-info {
  --message-accent: var(--primary-strong);
  --message-bg: #eef8fd;
  --message-border: #b7ddea;
  --message-text: #123b56;
  --message-muted: #36586b;
}

.server-grid {
  background: #fff;
}

.server-grid + #gridjs-grid:not(:empty) {
  margin-top: 0;
}

.grid-status {
  margin: 12px 0;
  padding: 12px 14px;
  border: 1px solid #d7ebf3;
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(255,255,255,.92), rgba(237,248,252,.86));
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}

.grid-status[hidden] {
  display: none;
}

.grid-status-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.grid-status-copy {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
}

.grid-status-copy span {
  color: var(--muted);
  font-size: 13px;
}

.grid-filter-chips {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  flex-wrap: wrap;
}

.grid-filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 260px;
  padding: 6px 10px;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  color: var(--primary-strong);
  background: #eef8fd;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.grid-filter-chip.default {
  color: #475569;
  border-color: var(--border);
  background: #f8fafc;
}

.grid-empty-advice {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed #cbd5e1;
  color: var(--muted);
  font-size: 13px;
}

.grid-error-state {
  display: grid;
  justify-items: center;
  gap: 10px;
  padding: 34px 18px;
  border: 1px solid #fecaca;
  border-radius: var(--radius);
  color: #7f1d1d;
  background: #fff7f7;
  text-align: center;
}

.grid-error-state h3 {
  margin: 0;
  color: #7f1d1d;
}

.grid-error-state p {
  margin: 0;
  color: #991b1b;
}

.grid-error-state small {
  color: #b91c1c;
}

.grid-error-icon .icon,
.grid-error-icon svg {
  width: 30px;
  height: 30px;
}

.grid-error-actions {
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.field-check label {
  min-height: 44px;
  flex-direction: row;
  justify-content: flex-start;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
}

.radio-group {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.radio-pill input {
  position: absolute;
  opacity: 0;
}

.radio-pill span {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 14px;
  background: var(--surface);
  cursor: pointer;
}

.radio-pill input:checked + span {
  border-color: rgba(14, 155, 216, .5);
  background: var(--primary-soft);
  color: var(--primary-strong);
  box-shadow: inset 0 0 0 1px rgba(14,155,216,.12);
}

.account-list-mode-panel {
  padding: 14px 18px;
}

.account-list-mode {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.account-list-copy {
  min-width: 220px;
}

.account-list-copy strong {
  display: block;
  font-size: 16px;
  color: var(--text);
}

.account-list-copy p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.account-list-switch {
  align-items: center;
}

.ts-wrapper.erp-combobox,
.ts-wrapper {
  direction: rtl;
  width: 100%;
}

.ts-control {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 6px;
  min-height: 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  padding: 8px 12px 8px 42px;
  background: #fff !important;
  color: var(--text);
  line-height: 1.4;
}

.ts-wrapper.single .ts-control {
  overflow: hidden;
}

.ts-wrapper.erp-combobox-compact .ts-control {
  min-height: 40px;
  padding-block: 7px;
}

.ts-control input {
  flex: 1 1 auto !important;
  min-width: 10px !important;
  width: 1px !important;
  margin: 0 !important;
  padding: 0 !important;
  line-height: 1.4 !important;
  text-align: right;
}

.ts-control .item {
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ts-wrapper.single .ts-control::after {
  content: "";
  position: absolute;
  right: auto !important;
  left: 15px !important;
  top: 50%;
  width: 8px;
  height: 8px;
  margin: 0 !important;
  border-left: 2px solid var(--muted);
  border-bottom: 2px solid var(--muted);
  transform: translateY(-65%) rotate(-45deg);
  pointer-events: none;
}

.ts-wrapper.single.dropdown-active .ts-control::after {
  transform: translateY(-35%) rotate(135deg);
}

.ts-wrapper.focus .ts-control {
  border-color: rgba(14,155,216,.55);
  box-shadow: 0 0 0 3px rgba(14,155,216,.13);
}

.ts-wrapper.disabled .ts-control {
  color: var(--muted);
  background: #f3f7fb;
  opacity: 1;
}

.ts-wrapper.single .clear-button {
  display: none;
}

.ts-wrapper.multi .ts-control {
  padding-inline-start: 12px;
}

.ts-wrapper.multi .remove {
  margin-inline: 4px 0;
}

.ts-dropdown {
  direction: rtl;
  text-align: right;
  margin-top: 6px;
  border-color: var(--border);
  border-radius: 14px;
  box-shadow: var(--shadow);
  overflow: hidden;
  background: #fff;
  font-family: "Yekan", Tahoma, Arial, sans-serif;
}

.ts-dropdown .ts-dropdown-content {
  padding: 6px;
  max-height: 220px;
}

.ts-dropdown .option,
.ts-dropdown .create {
  min-height: 40px;
  display: flex;
  align-items: center;
  padding: 9px 12px;
  border-radius: 10px;
  line-height: 1.5;
}

.ts-dropdown .active,
.ts-dropdown .option:hover {
  background: rgba(14,155,216,.08);
  color: var(--primary-strong);
}

.ts-dropdown .no-results {
  padding: 12px;
  color: var(--muted);
  text-align: center;
}

.switch-field {
  align-items: center;
  min-height: 48px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface);
}

.switch-field input {
  position: absolute;
  opacity: 0;
}

.switch-field label {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
}

.switch-field label::before {
  content: "";
  width: 42px;
  height: 24px;
  border-radius: 999px;
  background: #d8e3eb;
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, .08);
  transition: background .18s ease;
}

.switch-field label::after {
  content: "";
  position: absolute;
  right: 3px;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 2px 8px rgba(15, 23, 42, .18);
  transition: transform .18s ease;
}

.switch-field input:checked + label::before {
  background: var(--primary);
}

.switch-field input:checked + label::after {
  transform: translateX(-18px);
}

.field-label {
  margin-bottom: 8px;
  font-weight: 800;
  color: var(--text);
}

.person-check-list {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 8px;
}

.person-check {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  min-height: 52px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fff;
  cursor: pointer;
}

.person-check input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--primary);
}

.person-check strong,
.person-check small {
  display: block;
}

.person-check small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.person-check:has(input:checked) {
  border-color: rgba(14,155,216,.45);
  background: var(--primary-soft);
}

.person-quick-add {
  margin-top: 10px;
}

.empty-inline {
  min-height: 52px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  color: var(--muted);
  background: var(--surface);
}

.jdp-container,
.jdp-years,
.jdp-months {
  direction: rtl;
  font-family: "Yekan", Tahoma, Arial, sans-serif;
  border-color: var(--border) !important;
  border-radius: 10px !important;
  box-shadow: var(--shadow) !important;
}

.jdp-day.selected,
.jdp-day:hover,
.jdp-btn-today {
  background: var(--primary) !important;
  color: #fff !important;
}

.money-entry,
.number-entry,
input[data-type="money"],
input[data-type="number"] {
  direction: ltr;
  text-align: right;
}

.sales-doc-modal {
  width: min(100%, 1120px);
}

.proforma-modal {
  width: min(100%, 1080px);
}

.proforma-form-grid {
  gap: 12px;
}

.proforma-terms-field textarea {
  min-height: 108px;
  line-height: 1.8;
}

.invoice-document-card {
  border: 1px solid rgba(14, 165, 216, .2);
  border-radius: 12px;
  padding: 14px;
  background:
    linear-gradient(180deg, rgba(248, 252, 255, .96), rgba(255, 255, 255, .98)),
    var(--surface);
}

.invoice-items-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.invoice-items-toolbar strong,
.invoice-items-toolbar span {
  display: block;
}

.invoice-items-toolbar strong {
  color: var(--text);
  font-size: 14px;
}

.invoice-items-toolbar span {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.invoice-items {
  display: grid;
  gap: 10px;
}

.invoice-line {
  display: grid;
  grid-template-columns: minmax(160px, 1.25fr) minmax(180px, 1.5fr) 78px 74px minmax(118px, .85fr) minmax(108px, .8fr) minmax(108px, .8fr) minmax(122px, .8fr) 44px;
  gap: 8px;
  align-items: end;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: linear-gradient(180deg, #fff, #f8fbfe);
  box-shadow: 0 10px 26px rgba(15, 23, 42, .04);
}

.invoice-line label,
.invoice-line-total-cell {
  display: grid;
  gap: 5px;
  min-width: 0;
}

.invoice-line label span,
.invoice-line-total-cell span {
  color: var(--muted);
  font-size: 11px;
  font-weight: 700;
}

.invoice-line input,
.invoice-line select {
  width: 100%;
  min-height: 40px;
}

.line-total {
  min-height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  padding: 0 10px;
  border-radius: var(--radius);
  background: var(--primary-soft);
  color: var(--primary-strong);
  white-space: nowrap;
}

.invoice-totals {
  display: grid;
  grid-template-columns: repeat(5, minmax(140px, 1fr));
  gap: 10px;
  margin-top: 16px;
}

.proforma-items-editor .invoice-totals {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

[data-document-kind="proforma"] .invoice-totals {
  grid-template-columns: repeat(4, minmax(140px, 1fr));
}

.invoice-totals div,
.account-center-summary div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 12px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, .05);
}

.invoice-totals .grand-total {
  border-color: rgba(14, 165, 216, .28);
  background: linear-gradient(135deg, var(--primary-soft), #fff);
}

.invoice-totals span,
.account-center-summary span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 8px;
}

.invoice-totals strong,
.account-center-summary strong {
  font-size: 17px;
}

.account-inline-panel {
  width: calc(100% - 24px);
  margin: 10px 12px 16px;
  border: 1px solid rgba(14, 165, 216, .26);
  border-radius: 12px;
  background:
    linear-gradient(135deg, rgba(219, 244, 255, .72), rgba(255,255,255,.94)),
    var(--surface);
  box-shadow: var(--shadow);
  padding: 14px;
  color: var(--text);
}

.account-center-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
  margin-bottom: 12px;
}

.account-center-head strong {
  display: block;
  font-size: 18px;
  margin-bottom: 5px;
}

.account-center-head span {
  color: var(--muted);
  font-size: 13px;
}

.account-center-summary {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 10px;
  margin-bottom: 12px;
}

.account-center-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.account-center-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.account-mini-section {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--surface);
}

.account-mini-section .modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  position: static;
}

.account-mini-section .modal-head span {
  color: var(--muted);
  font-size: 12px;
}

.compact-grid {
  width: 100%;
  table-layout: fixed;
}

.compact-grid td {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.account-center-page {
  display: grid;
  gap: 14px;
}

.account-center-header {
  align-items: center;
}

.account-compact-summary {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(0, 2.1fr) minmax(230px, .9fr);
  gap: 14px;
  align-items: center;
  padding: 14px;
  border-color: rgba(214, 226, 235, .78);
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .98), rgba(226, 237, 242, .92)),
    var(--surface);
  box-shadow:
    10px 10px 24px rgba(37, 67, 81, .12),
    -7px -7px 18px rgba(255, 255, 255, .82),
    inset 1px 1px 0 rgba(255, 255, 255, .9),
    inset -1px -1px 0 rgba(115, 143, 155, .14);
}

.account-summary-row {
  display: contents;
}

.account-summary-main {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.account-avatar {
  width: 52px;
  height: 52px;
  flex: 0 0 52px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 14px;
  color: var(--primary-strong);
  background:
    linear-gradient(135deg, rgba(14,155,216,.18), rgba(255,255,255,.84)),
    var(--surface);
  border: 1px solid rgba(14,155,216,.22);
  font-size: 22px;
  font-weight: 900;
}

.account-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.account-logo-editor {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 12px;
  padding: 12px;
  border-radius: 14px;
  background: linear-gradient(180deg, rgba(14,155,216,.08), rgba(255,255,255,.92));
  border: 1px solid rgba(14,155,216,.16);
}

.account-logo-preview {
  width: 74px;
  height: 74px;
  flex-basis: 74px;
  border-radius: 18px;
}

.account-logo-copy strong,
.account-logo-copy small {
  display: block;
}

.account-logo-copy strong {
  color: var(--text);
}

.account-logo-copy small {
  margin-top: 4px;
  color: var(--muted);
  line-height: 1.6;
}

.account-summary-main strong,
.account-summary-main span {
  display: block;
}

.account-summary-main strong {
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-summary-main span {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.account-summary-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(104px, 1fr));
  gap: 8px;
  min-width: 0;
}

.account-summary-grid div {
  min-width: 0;
  padding: 8px 10px;
  border-radius: 10px;
  border: 1px solid rgba(183, 205, 214, .72);
  background: linear-gradient(145deg, #f9fcfd, #e8f0f3);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .92),
    inset -1px -1px 0 rgba(137, 162, 173, .13),
    3px 3px 8px rgba(50, 79, 91, .06);
}

.account-summary-grid span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 4px;
}

.account-summary-grid strong {
  display: block;
  overflow: hidden;
  color: var(--text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-warning {
  grid-column: 3;
  max-width: 220px;
  padding: 9px 10px;
  border-radius: 10px;
  color: var(--danger);
  background: var(--danger-soft);
  font-size: 12px;
  font-weight: 800;
}

.account-center-workspace {
  display: grid;
  gap: 10px;
}

.account-center-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 6px;
  border: 1px solid rgba(184, 205, 214, .82);
  border-radius: 14px;
  background: linear-gradient(180deg, #f6fafb, #dfeaed);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .92),
    inset -1px -1px 0 rgba(111, 141, 153, .18),
    5px 6px 14px rgba(43, 75, 88, .08);
  scrollbar-width: thin;
}

.account-center-tabs .tab {
  flex: 0 0 auto;
  min-height: 42px;
  gap: 7px;
  border-color: #c5d7dd;
  color: var(--muted);
  background: linear-gradient(145deg, #f9fcfd, #e5eef1);
  box-shadow:
    2px 3px 7px rgba(42, 73, 86, .09),
    inset 1px 1px 0 rgba(255, 255, 255, .92);
}

.account-center-tabs .tab .icon {
  width: 18px;
  height: 18px;
}

.account-center-tabs .tab.active {
  color: var(--primary-strong);
  border-color: rgba(14,155,216,.28);
  background: linear-gradient(145deg, #e2f6ff, #bfe5f4);
  box-shadow:
    inset 2px 2px 5px rgba(19, 111, 145, .13),
    inset -1px -1px 0 rgba(255, 255, 255, .72);
}

.account-center-tabs .customer-only-tab:first-of-type {
  margin-inline-start: 8px;
}

.account-tab-panel {
  overflow: hidden;
  padding: 0;
}

.account-tab-toolbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, #fafdfe, #e6eff2);
  box-shadow: inset 0 -1px 0 rgba(255, 255, 255, .9);
}

.account-tab-toolbar h2 {
  margin: 0;
  font-size: 18px;
}

.account-tab-toolbar p {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 12px;
}

.account-tab-content {
  padding: 14px;
}

.account-center-table th,
.account-center-table td {
  padding: 9px 10px;
}

.account-file-cell {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 260px;
}

.account-file-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 46px;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(14, 155, 216, .18);
  border-radius: 14px;
  color: var(--primary);
  background: linear-gradient(145deg, rgba(231, 247, 255, .95), #fff);
  box-shadow: 0 8px 20px rgba(24, 82, 110, .07);
}

.account-file-icon .icon {
  width: 22px;
  height: 22px;
}

.account-file-icon b {
  position: absolute;
  right: 4px;
  bottom: 3px;
  min-width: 26px;
  padding: 1px 4px;
  border-radius: 999px;
  color: #fff;
  background: var(--primary);
  font-size: 9px;
  line-height: 1.45;
  letter-spacing: .02em;
}

.account-file-icon.pdf b {
  background: #d23b4d;
}

.account-file-icon.doc b {
  background: #2563eb;
}

.account-file-icon.image b {
  background: #059669;
}

.account-file-icon.archive b {
  background: #a16207;
}

.account-file-copy {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.account-file-copy strong,
.account-file-copy small,
.account-file-copy em {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-file-copy strong {
  color: var(--text);
}

.account-file-copy small,
.account-file-copy em {
  color: var(--muted);
  font-size: 12px;
}

.account-file-copy em {
  font-style: normal;
}

.account-org-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 8px;
  margin-bottom: 12px;
}

.account-org-strip article {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.account-org-strip strong,
.account-org-strip span,
.account-org-strip small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.account-org-strip span,
.account-org-strip small {
  color: var(--muted);
  font-size: 12px;
}

.print-sheet {
  width: min(100%, 900px);
  margin: 0 auto 32px;
  padding: 34px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.print-header,
.print-party,
.print-total-box,
.print-signatures {
  display: grid;
  gap: 12px;
}

.print-header {
  grid-template-columns: 1fr minmax(240px, .55fr);
  align-items: start;
  padding-bottom: 18px;
  border-bottom: 2px solid var(--primary);
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-lockup img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.brand-lockup h2 {
  margin: 0;
  font-size: 24px;
}

.brand-lockup span,
.print-meta span,
.print-party span,
.print-total-box span {
  color: var(--muted);
  font-size: 12px;
}

.print-meta,
.print-party,
.print-total-box {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.print-meta div,
.print-party div,
.print-total-box div {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: var(--surface-alt);
}

.print-meta strong,
.print-party strong,
.print-total-box strong {
  display: block;
  margin-top: 6px;
}

.print-items {
  width: 100%;
  margin: 18px 0;
  border-collapse: collapse;
}

.print-items th,
.print-items td {
  border: 1px solid var(--border);
  padding: 9px 10px;
  text-align: right;
  vertical-align: top;
}

.print-items th {
  background: var(--primary-soft);
  color: var(--primary-strong);
}

.print-items span {
  color: var(--muted);
  font-size: 12px;
}

.print-signatures {
  grid-template-columns: repeat(2, 1fr);
  margin-top: 34px;
}

.print-signatures div {
  min-height: 92px;
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 12px;
  color: var(--muted);
}

.company-settings-layout {
  display: grid;
  gap: 16px;
}

.company-profile-panel,
.company-bank-panel {
  border-radius: 8px;
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.section-heading h2 {
  margin: 2px 0 0;
  font-size: 18px;
  color: var(--text);
}

.section-kicker {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.company-profile-grid {
  gap: 12px;
}

.company-bank-table-wrap {
  overflow: auto;
}

.company-bank-table td small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.company-bank-table td[dir="ltr"] {
  text-align: left;
  font-family: Consolas, "Courier New", monospace;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(280px, 340px) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

.profile-identity-panel,
.profile-contact-panel,
.profile-password-panel {
  min-width: 0;
  border-radius: 8px;
  border-color: rgba(203, 213, 225, 0.9);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.98), rgba(248, 250, 252, 0.92)),
    var(--surface);
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.07);
}

.profile-identity-panel {
  position: sticky;
  top: 88px;
  display: grid;
  gap: 16px;
  padding: 20px;
  overflow: hidden;
}

.profile-avatar {
  width: 78px;
  height: 78px;
  display: inline-grid;
  place-items: center;
  border-radius: 8px;
  color: #fff;
  background: linear-gradient(135deg, #0f6090, #0f9f7a);
  box-shadow: 0 16px 30px rgba(15, 96, 144, 0.18);
  font-size: 24px;
  font-weight: 900;
}

.profile-identity-copy h2 {
  margin: 4px 0 16px;
  color: var(--text);
  font-size: 21px;
  line-height: 1.55;
}

.profile-facts {
  display: grid;
  gap: 8px;
  margin: 0;
}

.profile-facts div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(216, 224, 234, 0.78);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.profile-facts dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-facts dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
  text-align: left;
  direction: ltr;
  overflow-wrap: anywhere;
}

.profile-account-state {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  max-width: 100%;
  padding: 8px 10px;
  border: 1px solid rgba(5, 150, 105, 0.18);
  border-radius: 8px;
  color: #047857;
  background: rgba(209, 250, 229, 0.62);
  font-size: 12px;
  font-weight: 700;
}

.profile-state-dot {
  width: 9px;
  height: 9px;
  flex: 0 0 9px;
  border-radius: 999px;
  background: var(--success);
  box-shadow: 0 0 0 4px rgba(5, 150, 105, 0.12);
}

.profile-contact-panel,
.profile-password-panel {
  grid-column: 2;
  padding: 18px;
}

.profile-form {
  display: grid;
  gap: 14px;
}

.profile-form-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  min-height: 44px;
  padding-top: 2px;
}

.profile-inline-status {
  min-width: 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.profile-password-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 44px;
  gap: 8px;
  align-items: stretch;
}

.profile-password-control input {
  min-width: 0;
}

.profile-password-toggle {
  width: 44px;
  min-width: 44px;
  padding: 0;
}

.profile-password-strength {
  height: 6px;
  overflow: hidden;
  border-radius: 999px;
  background: #e2e8f0;
}

.profile-password-strength span {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--danger);
  transition: width 180ms ease, background 180ms ease;
}

.profile-password-strength[data-strength="medium"] span {
  background: var(--warning);
}

.profile-password-strength[data-strength="strong"] span {
  background: var(--success);
}

.user-profile-page .modal-body-grid {
  align-items: start;
}

.user-profile-page .form-field input:focus,
.user-profile-page .profile-password-toggle:focus-visible {
  border-color: rgba(37, 99, 235, 0.62);
  outline: 3px solid rgba(37, 99, 235, 0.14);
  outline-offset: 0;
}

.company-bank-modal {
  width: min(100%, 780px);
}

.company-seal-editor {
  display: grid;
  grid-template-columns: minmax(220px, 320px) 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface-alt);
}

.company-seal-preview {
  min-height: 112px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fff;
  overflow: hidden;
  color: var(--muted);
}

.company-seal-preview img {
  max-width: 100%;
  max-height: 128px;
  object-fit: contain;
}

.company-seal-actions {
  display: grid;
  gap: 10px;
  align-content: center;
}

.proforma-print-page {
  --print-accent: #0e9bd8;
}

.proforma-print-actions {
  align-items: center;
}

.proforma-print-sheet {
  width: min(100%, 960px);
  padding: 20px 22px;
  border-radius: 8px;
}

.proforma-print-header {
  display: grid;
  grid-template-columns: 1fr minmax(260px, .55fr);
  gap: 14px;
  align-items: stretch;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--print-accent);
}

.proforma-brand-lockup {
  align-items: flex-start;
}

.proforma-brand-lockup img {
  width: 58px;
  height: 58px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
}

.proforma-brand-lockup h2,
.proforma-brand-lockup p {
  margin: 0;
}

.proforma-brand-lockup h2 {
  margin-top: 2px;
  color: var(--text);
  font-size: 21px;
}

.proforma-brand-lockup p {
  margin-top: 2px;
  color: var(--muted);
  font-size: 12px;
}

.proforma-print-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 5px;
}

.proforma-print-meta div,
.proforma-print-summary div {
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 7px 9px;
  background: var(--surface-alt);
}

.proforma-print-meta span,
.proforma-print-summary span {
  display: block;
  color: var(--muted);
  font-size: 11px;
  margin-bottom: 3px;
}

.proforma-print-meta strong,
.proforma-print-summary strong {
  color: var(--text);
  white-space: nowrap;
}

.proforma-issuer-box {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 12px;
  margin-top: 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--border);
  color: var(--text);
  font-size: 10.5px;
  line-height: 1.7;
}

.proforma-issuer-box div {
  display: inline-flex;
  gap: 4px;
  align-items: baseline;
}

.proforma-party-box {
  margin-top: 7px;
  padding-bottom: 7px;
  border-bottom: 1px solid var(--border);
  font-size: 12px;
}

.proforma-party-box > div {
  display: inline-flex;
  gap: 6px;
  align-items: baseline;
}

.proforma-issuer-box span,
.proforma-party-box span {
  color: var(--muted);
  font-weight: 700;
}

.proforma-issuer-box strong,
.proforma-party-box strong {
  color: var(--text);
  font-weight: 800;
}

.proforma-print-items {
  margin-top: 8px;
  font-size: 11px;
  table-layout: fixed;
}

.proforma-print-items th {
  background: #eaf7fd;
  padding: 6px 5px;
}

.proforma-print-items td {
  padding: 6px 5px;
  line-height: 1.55;
}

.proforma-print-items th:nth-child(1),
.proforma-print-items td:nth-child(1) {
  width: 34px;
  text-align: center;
}

.proforma-print-items th:nth-child(4),
.proforma-print-items td:nth-child(4),
.proforma-print-items th:nth-child(5),
.proforma-print-items td:nth-child(5) {
  width: 54px;
  text-align: center;
}

.proforma-print-items th:nth-child(6),
.proforma-print-items td:nth-child(6),
.proforma-print-items th:nth-child(7),
.proforma-print-items td:nth-child(7),
.proforma-print-items th:nth-child(8),
.proforma-print-items td:nth-child(8),
.proforma-print-items th:nth-child(9),
.proforma-print-items td:nth-child(9) {
  width: 96px;
  white-space: nowrap;
}

.proforma-print-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 6px;
  margin-top: 8px;
}

.proforma-print-summary .final {
  border-color: rgba(14, 155, 216, .38);
  background: linear-gradient(135deg, #e9f8fe, #fff);
}

.proforma-print-summary .final strong {
  color: var(--primary-strong);
  font-size: 15px;
}

.proforma-bank-box {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 14px;
  padding: 14px;
  border: 1px solid rgba(14, 155, 216, .24);
  border-radius: 10px;
  background: #fbfdff;
}

.proforma-bank-box h3 {
  grid-column: 1 / -1;
  margin: 0;
  color: var(--primary-strong);
  font-size: 15px;
}

.proforma-description-box {
  margin-top: 8px;
  padding-top: 6px;
  border-top: 1px solid var(--border);
}

.proforma-description-box h3 {
  margin: 0 0 4px;
  color: var(--primary-strong);
  font-size: 12px;
}

.proforma-description-box p {
  margin: 0;
  line-height: 1.65;
  white-space: pre-line;
  font-size: 10.5px;
}

.proforma-signatures {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 12px;
}

.proforma-signatures div {
  min-height: 86px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 11px;
}

.proforma-signatures strong {
  display: block;
  margin-top: 10px;
  color: var(--text);
}

.proforma-seal-signature {
  display: block;
  max-width: 200px;
  max-height: 72px;
  object-fit: contain;
  margin: 4px auto 0;
  mix-blend-mode: multiply;
}

.sidebar-scrim {
  display: none;
}

@media (max-width: 1024px) {
  .shell,
  .shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    width: min(88vw, 320px);
    box-shadow: -18px 0 60px rgba(7, 20, 38, .38);
  }

  .shell.sidebar-open .sidebar-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 35;
    border: 0;
    background: rgba(7, 20, 38, .42);
  }

  .shell.sidebar-open .sidebar {
    z-index: 40;
  }

  .shell.sidebar-collapsed .sidebar-brand-text,
  .shell.sidebar-collapsed .nav-link > span:not(.icon),
  .shell.sidebar-collapsed .nav-parent > span:not(.icon):not(.nav-caret),
  .shell.sidebar-collapsed .brand-subtitle {
    opacity: 1;
    pointer-events: auto;
    position: static;
    transform: none;
  }

  .topbar {
    min-height: 68px;
    padding-inline: 14px;
  }

  .topbar-brand-title {
    font-size: 14px;
  }
}

@media (max-width: 720px) {
  .topbar-user-badge {
    display: none;
  }

  .filters,
  .modal-body-grid,
  .account-center-grid,
  .profile-layout,
  .print-header,
  .proforma-print-header,
  .proforma-print-meta,
  .proforma-issuer-box,
  .proforma-party-box,
  .proforma-bank-box,
  .print-meta,
  .print-party,
  .print-total-box,
  .print-signatures,
  .proforma-print-summary,
  .proforma-signatures {
    grid-template-columns: 1fr;
  }

  .profile-contact-panel,
  .profile-password-panel {
    grid-column: auto;
  }

  .profile-identity-panel {
    position: static;
  }

  .profile-contact-panel,
  .profile-password-panel,
  .profile-identity-panel {
    padding: 14px;
  }

  .profile-facts div,
  .profile-form-actions {
    align-items: stretch;
  }

  .profile-facts div,
  .profile-form-actions {
    flex-direction: column;
  }

  .profile-form-actions .btn {
    width: 100%;
  }

  .proforma-issuer-box .wide {
    grid-column: auto;
  }

  .company-seal-editor {
    grid-template-columns: 1fr;
  }

  .filter-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .filter-actions .btn {
    width: 100%;
  }

  .invoice-line {
    grid-template-columns: 1fr;
  }

  .invoice-totals,
  .proforma-items-editor .invoice-totals,
  .account-center-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .modal-panel {
    max-height: calc(100dvh - 20px);
  }

  .modal-body {
    max-height: calc(100dvh - 160px);
    padding: 14px;
  }

  .chart-card {
    min-height: 300px;
  }
}

@media (max-width: 1180px) {
  .invoice-line {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .line-total {
    justify-content: flex-start;
  }

  .account-center-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 720px) {
  .invoice-line,
  .account-center-grid,
  .print-header,
  .print-meta,
  .print-party,
  .print-total-box,
  .print-signatures {
    grid-template-columns: 1fr;
  }

  .invoice-totals,
  .account-center-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1180px) {
  .account-compact-summary {
    grid-template-columns: 1fr;
  }

  .account-summary-main,
  .account-summary-grid,
  .account-warning {
    grid-column: auto;
  }

  .account-summary-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .account-warning {
    max-width: none;
  }
}

@media (max-width: 720px) {
  .account-center-header,
  .account-tab-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .account-tab-toolbar .toolbar {
    display: grid;
    grid-template-columns: 1fr;
    width: 100%;
  }

  .account-summary-grid,
  .person-check-list {
    grid-template-columns: 1fr;
  }

  .account-center-tabs {
    margin-inline: -4px;
    padding-inline: 4px;
  }

  .account-list-mode {
    align-items: stretch;
  }

  .form-section-card {
    padding: 12px;
  }
}

.content-shell,
.main-content,
.dashboard-grid,
.grid-panel,
.grid-wrap,
.gridjs-container,
.gridjs-wrapper {
  min-width: 0;
  max-width: 100%;
}

.shell,
.app-root {
  width: 100%;
  max-width: 100vw;
  overflow-x: clip;
}

.filters {
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  align-items: end;
}

.filters input,
.filters select,
.filters .ts-wrapper {
  min-width: 0;
  width: 100%;
}

.grid-wrap {
  max-width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
}

.settings-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, .8fr);
  gap: 14px;
}

.settings-card {
  padding: 14px;
}

.settings-card .modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: static;
  padding: 0 0 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}

.definition-grid.compact {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.setting-row {
  min-height: 50px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
  color: var(--muted);
}

.setting-row:last-child {
  border-bottom: 0;
}

.setting-row strong {
  color: var(--text);
}

.profile-panel {
  max-width: 760px;
  padding: 18px;
}

.ticket-thread {
  display: grid;
  gap: 12px;
}

.thread-message {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: linear-gradient(180deg, #fff, #f8fbff);
}

.thread-message.internal {
  border-color: #fed7aa;
  background: #fff7ed;
}

.thread-message p {
  margin: 8px 0;
  line-height: 1.9;
}

.account-org-modal {
  width: min(100%, 1080px);
}

.account-org-head {
  align-items: center;
}

.account-org-title-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.account-org-title-icon {
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 auto;
  color: var(--primary);
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 12px;
}

.account-org-title-icon svg {
  width: 22px;
  height: 22px;
}

.account-org-title-wrap strong,
.account-org-title-wrap small {
  display: block;
}

.account-org-title-wrap strong {
  color: var(--text);
  font-size: 15px;
}

.account-org-title-wrap small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.account-org-modal .modal-body {
  padding: 22px;
  background: #f8fbfe;
}

.account-org-chart {
  --org-card-width: 300px;
  --org-line: #93c5fd;
  --org-line-soft: #dbeafe;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 28px;
  min-width: max-content;
  padding: 18px 16px 8px;
}

.org-node {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.org-card {
  position: relative;
  width: var(--org-card-width);
  min-height: 132px;
  display: grid;
  gap: 12px;
  padding: 14px;
  text-align: right;
  color: var(--text);
  background: #fff;
  border: 1px solid #cfe5f8;
  border-radius: 12px;
  box-shadow: 0 14px 34px rgba(15, 23, 42, .08);
}

.org-node.has-children > .org-card::after {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  top: 100%;
  width: 2px;
  height: 18px;
  background: var(--org-line);
  transform: translateX(-50%);
}

.org-card-top {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 46px;
  gap: 12px;
  align-items: center;
}

.org-card-avatar {
  grid-column: 2;
  grid-row: 1;
  width: 46px;
  height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #075985;
  background: linear-gradient(180deg, #e0f2fe, #dbeafe);
  border: 1px solid #bae6fd;
  border-radius: 14px;
  font-weight: 800;
  font-size: 16px;
}

.org-card-person {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
}

.org-card-person strong {
  display: block;
  color: #0f172a;
  font-size: 14px;
  line-height: 1.65;
  overflow-wrap: anywhere;
}

.org-card-person em {
  width: fit-content;
  min-height: 24px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 6px;
  margin-inline-start: auto;
  padding: 2px 8px;
  color: #0369a1;
  background: #e0f2fe;
  border: 1px solid #bae6fd;
  border-radius: 999px;
  font-style: normal;
  font-size: 11px;
  font-weight: 700;
}

.org-card-person em svg {
  width: 14px;
  height: 14px;
}

.org-card-meta {
  display: grid;
  gap: 7px;
}

.org-card-info {
  display: grid;
  grid-template-columns: 18px minmax(0, 1fr);
  gap: 8px;
  align-items: start;
  min-width: 0;
  color: #475569;
}

.org-card-info svg {
  width: 16px;
  height: 16px;
  margin-top: 3px;
  color: #0284c7;
}

.org-card-info small {
  color: inherit;
  font-size: 12px;
  line-height: 1.7;
  overflow-wrap: anywhere;
  white-space: normal;
}

.org-card-info[dir="ltr"] {
  direction: ltr;
  text-align: left;
  unicode-bidi: plaintext;
}

.org-children {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: 24px;
  padding-top: 34px;
}

.org-children::before {
  content: "";
  position: absolute;
  top: 17px;
  inset-inline: calc(var(--org-card-width) / 2);
  height: 2px;
  background: var(--org-line);
}

.org-children.org-children-single::before {
  display: none;
}

.org-children > .org-node::before {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  top: -17px;
  width: 2px;
  height: 17px;
  background: var(--org-line);
  transform: translateX(-50%);
}

.org-children > .org-node::after {
  content: "";
  position: absolute;
  inset-inline-start: 50%;
  top: -21px;
  width: 10px;
  height: 10px;
  background: #fff;
  border: 2px solid var(--org-line);
  border-radius: 999px;
  transform: translateX(-50%);
}

.org-node.is-primary > .org-card {
  border-color: #7dd3fc;
  box-shadow: 0 18px 42px rgba(14, 116, 144, .13);
}

.account-org-chart .org-node {
  display: flex;
}

.account-org-chart .org-card {
  min-width: 0;
  max-width: none;
  grid-template-columns: none;
}

.account-org-chart .org-card-top {
  width: 100%;
}

.account-org-chart .org-card-person,
.account-org-chart .org-card-person strong {
  width: auto;
  min-width: 0;
}

.account-org-chart .org-card strong,
.account-org-chart .org-card span,
.account-org-chart .org-card small {
  overflow: visible;
  text-overflow: clip;
  white-space: normal;
}

.account-org-chart .org-card-info {
  display: grid;
}

@media (max-width: 720px) {
  .account-org-modal .modal-body {
    padding: 14px;
  }

  .account-org-chart {
    --org-card-width: min(280px, calc(100vw - 88px));
    justify-content: flex-start;
    padding-inline: 4px;
  }

  .org-children {
    gap: 16px;
  }

  .org-card {
    min-height: 0;
  }
}

.org-chart {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.org-chart article {
  min-height: 110px;
  display: grid;
  align-content: start;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, .04);
}

.org-chart span,
.org-chart small {
  color: var(--muted);
}

.empty-state.small {
  padding: 18px;
  font-size: 13px;
}

.special-page-header .page-actions,
.erp-basic-data-page .page-actions {
  align-items: center;
}

.page-kpi-strip {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.special-workspace {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 330px);
  gap: 16px;
  align-items: start;
}

.special-primary-panel,
.special-side-panel,
.basic-grid-panel {
  min-width: 0;
}

.special-side-panel {
  position: sticky;
  top: 88px;
}

.compact-head {
  margin-bottom: 10px;
}

.detail-summary-list {
  display: grid;
  gap: 8px;
  margin: 0;
}

.detail-summary-list div {
  display: grid;
  grid-template-columns: 98px minmax(0, 1fr);
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface-alt);
}

.detail-summary-list dt {
  color: var(--muted);
  font-size: 12px;
}

.detail-summary-list dd {
  margin: 0;
  color: var(--text);
  font-weight: 800;
  min-width: 0;
  overflow-wrap: anywhere;
}

.quick-action-stack {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.detail-layout,
.detail-section {
  display: grid;
  gap: 16px;
}

.detail-section h3,
.basic-overview-card h3 {
  margin: 0;
  font-size: 15px;
}

.detail-key-table th {
  width: 180px;
  color: var(--muted);
  background: var(--surface-alt);
}

.mini-table-wrap {
  overflow-x: auto;
}

.mini-table th,
.mini-table td {
  white-space: nowrap;
}

.basic-table-cards,
.basic-overview-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-bottom: 16px;
}

.basic-table-card,
.basic-overview-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(180deg, rgba(14,155,216,.08), rgba(255,255,255,.02)),
    var(--surface);
  box-shadow: var(--shadow-sm);
  padding: 14px;
}

.basic-table-card {
  min-height: 84px;
  display: grid;
  justify-items: start;
  gap: 8px;
  color: var(--text);
  cursor: pointer;
  text-align: right;
}

.basic-table-card:hover,
.basic-table-card:focus-visible {
  border-color: rgba(14,155,216,.45);
  box-shadow: 0 16px 40px rgba(14,155,216,.12);
}

.basic-table-card.active {
  border-color: rgba(14,155,216,.38);
  background:
    linear-gradient(180deg, rgba(14,155,216,.16), rgba(255,255,255,.08)),
    var(--surface);
  box-shadow: 0 16px 40px rgba(14,155,216,.12);
}

.basic-table-card span {
  color: var(--muted);
  font-weight: 700;
}

.basic-table-card strong {
  font-size: 24px;
  color: var(--primary-strong);
}

.basic-grid-panel .panel-head {
  align-items: end;
}

.compact-select {
  min-width: 240px;
}

.basic-filters {
  margin-bottom: 12px;
}

.status-pill {
  display: inline-flex;
  min-height: 28px;
  align-items: center;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 800;
}

.status-pill.success {
  color: var(--success);
  background: var(--success-soft);
}

.status-pill.danger {
  color: var(--danger);
  background: var(--danger-soft);
}

.field b {
  color: var(--danger);
}

.check-field {
  align-content: center;
  grid-template-columns: auto 1fr;
  display: grid;
  column-gap: 8px;
}

.check-field input {
  width: 18px;
  height: 18px;
}

.field-wide {
  grid-column: 1 / -1;
}

.print-mode-page .content-shell,
.print-mode-page .main-content {
  background: #fff;
}

.server-kpis .metric {
  min-height: 132px;
  background:
    linear-gradient(180deg, rgba(22,137,216,.08), rgba(255,255,255,.02)),
    var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.metric-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 0 0 5px rgba(16,154,118,.12);
}

.detail-page-layout {
  display: grid;
  gap: 16px;
}

.production-detail,
.production-ticket {
  grid-template-columns: minmax(0, 1fr);
}

.production-dashboard {
  align-items: stretch;
}

.production-dashboard .detail-section {
  min-width: 0;
}

.production-dashboard .detail-section:first-of-type,
.production-dashboard .chart-card:first-child {
  grid-column: span 1;
}

.production-kanban {
  padding-bottom: 8px;
}

.production-kanban .kanban-column {
  box-shadow: var(--shadow-sm);
}

.production-kanban .kanban-card {
  display: grid;
  gap: 6px;
  box-shadow: 0 10px 22px rgba(15,23,42,.05);
}

.production-kanban .kanban-card span,
.production-kanban .kanban-card small {
  color: var(--muted);
}

.ticket-thread-panel {
  padding: 0;
}

.ticket-thread-panel .panel-head,
.detail-page-layout > .panel > .panel-head {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
}

.ticket-thread {
  padding: 16px;
}

.production-settings .form-field {
  margin-bottom: 12px;
}

.production-cleanup .settings-card,
.production-settings .settings-card {
  min-width: 0;
}

.production-print {
  color: #111827;
}

.production-print .print-party {
  margin-top: 16px;
}

.data-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
}

.data-table th,
.data-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: right;
  vertical-align: middle;
}

.data-table th {
  color: var(--muted);
  background: var(--surface-alt);
  font-size: 12px;
}

.mini-table {
  min-width: 620px;
}

.panel-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.page-subtitle {
  margin: 6px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.erp-special-page .page-header {
  align-items: center;
}

.erp-special-page .page-actions {
  flex-shrink: 0;
}

html {
  overflow-x: hidden;
}

@media (max-width: 920px) {
  .special-workspace {
    grid-template-columns: 1fr;
  }

  .special-side-panel {
    position: static;
  }

  .detail-summary-list div {
    grid-template-columns: 1fr;
  }

  .server-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .settings-grid,
  .definition-grid.compact {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 720px) {
  .server-kpis,
  .definition-grid {
    grid-template-columns: 1fr;
  }

  .erp-special-page .page-header {
    align-items: stretch;
  }
}

@media print {
  @page {
    size: A4;
    margin: 8mm;
  }

  body {
    background: #fff;
  }

  .sidebar,
  .topbar,
  .page-header,
  .sidebar-scrim,
  #toast-stack,
  .toast-stack {
    display: none !important;
  }

  .shell,
  .content-shell,
  .main-content,
  .erp-page,
  .main-area,
  .content {
    display: block !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  .print-sheet {
    width: auto;
    min-height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  .proforma-print-sheet {
    width: auto;
    max-width: none;
  }

  .proforma-print-header,
  .proforma-issuer-box,
  .proforma-party-box,
  .proforma-print-summary,
  .proforma-signatures {
    break-inside: avoid;
  }

  .proforma-print-items {
    page-break-inside: auto;
  }

  .proforma-print-items tr {
    break-inside: avoid;
    page-break-inside: avoid;
  }
}

/* Sales expert home dashboard */
.sales-dashboard {
  --sales-ink: #123040;
  --sales-muted: #667b87;
  --sales-navy: #164c73;
  --sales-cyan: #1689d8;
  --sales-emerald: #24a7d8;
  --sales-amber: #e89d1c;
  --sales-rose: #d84d63;
  --sales-panel: #ffffff;
  --sales-well: #f8fbfc;
  --sales-border: rgba(190, 211, 219, .82);
  display: grid;
  gap: 20px;
  color: var(--sales-ink);
}

.sales-dashboard-hero {
  min-height: 112px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px 22px;
  color: #f4fbfd;
  border: 1px solid rgba(255, 255, 255, .36);
  border-radius: 8px;
  background-color: #146fa8;
  background-image:
    linear-gradient(135deg, rgba(18, 111, 168, .98) 0%, rgba(22, 137, 216, .94) 48%, rgba(12, 100, 164, .92) 100%),
    linear-gradient(90deg, rgba(255, 255, 255, .15) 1px, transparent 1px),
    linear-gradient(0deg, rgba(255, 255, 255, .12) 1px, transparent 1px);
  background-size: auto, 28px 28px, 28px 28px;
  box-shadow:
    0 12px 28px rgba(18, 83, 126, .16),
    0 3px 8px rgba(10, 50, 82, .1),
    inset 1px 1px 0 rgba(255, 255, 255, .34),
    inset -1px -1px 0 rgba(14, 49, 63, .22);
  position: relative;
  overflow: hidden;
}

.sales-dashboard-hero::before {
  content: "";
  position: absolute;
  inset: 9px;
  border: 1px solid rgba(255, 255, 255, .18);
  border-radius: 5px;
  pointer-events: none;
}

.sales-dashboard-hero-copy,
.sales-dashboard-hero-actions {
  position: relative;
  z-index: 1;
}

.sales-dashboard-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 3px;
  color: #dff7ff;
  font-size: 12px;
  font-weight: 800;
}

.sales-dashboard-hero h1,
.sales-dashboard-hero h2 {
  margin: 0;
  color: #f7fcfe;
  font-size: clamp(24px, 2.5vw, 32px);
  line-height: 1.25;
  letter-spacing: 0;
}

.sales-dashboard-hero p {
  max-width: 720px;
  margin: 4px 0 0;
  color: rgba(239, 250, 253, .86);
  font-size: 13px;
  line-height: 1.65;
}

.sales-dashboard-hero-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.sales-dashboard-hero-actions .btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-color: rgba(255, 255, 255, .32);
  color: #eef8fb;
  background: rgba(255, 255, 255, .12);
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .16);
  backdrop-filter: blur(12px);
}

.sales-dashboard-hero-actions .btn:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, .18);
}

.sales-dashboard-hero-actions .btn-primary {
  border-color: rgba(255, 255, 255, .46);
  color: #123b56;
  background: linear-gradient(180deg, #e8f7ff, #9bdcff);
  box-shadow: 0 10px 22px rgba(7, 95, 148, .2);
}

.sales-dashboard-hero-actions .icon-btn {
  flex: 0 0 44px;
  width: 44px;
  padding: 0;
  justify-content: center;
}

.sales-dashboard-metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.sales-metric-card {
  min-height: 116px;
  display: grid;
  align-content: space-between;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--sales-border);
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff, #f2f9ff);
  box-shadow:
    0 8px 20px rgba(31, 70, 83, .08),
    inset 1px 1px 0 rgba(255, 255, 255, .92);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

.sales-metric-card:hover {
  transform: translateY(-2px);
  border-color: rgba(22, 137, 216, .32);
  box-shadow:
    0 22px 40px rgba(31, 70, 83, .16),
    0 8px 16px rgba(31, 70, 83, .1),
    inset 1px 1px 0 rgba(255, 255, 255, .94);
}

.sales-metric-top {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--sales-muted);
  font-size: 13px;
  font-weight: 800;
}

.sales-metric-icon,
.sales-row-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  flex: 0 0 38px;
  border-radius: 8px;
  color: #126da5;
  background: linear-gradient(145deg, #ebf8ff, #c7ebff);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .92),
    0 8px 16px rgba(15, 103, 160, .12);
}

.sales-metric-card strong {
  color: var(--sales-ink);
  font-size: clamp(23px, 2.3vw, 31px);
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}

.sales-metric-card small {
  min-height: 22px;
  color: var(--sales-muted);
  line-height: 1.7;
}

.sales-metric-pulse {
  width: 10px;
  height: 10px;
  margin-inline-start: auto;
  flex: 0 0 10px;
  border-radius: 999px;
  background: linear-gradient(145deg, var(--sales-cyan), var(--sales-emerald));
  box-shadow: 0 0 0 5px rgba(10, 155, 212, .13);
}

.sales-dashboard-main {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .75fr);
  gap: 16px;
  align-items: stretch;
}

.sales-chart-panel,
.sales-focus-panel,
.sales-list-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--sales-border);
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff, #f5fafb);
  box-shadow:
    0 8px 20px rgba(31, 70, 83, .07),
    inset 1px 1px 0 rgba(255, 255, 255, .9);
}

.sales-chart-panel-wide {
  min-height: 320px;
}

.sales-chart-panel-compact {
  min-height: 292px;
}

.sales-chart-panel h2,
.sales-focus-panel h2,
.sales-list-panel h2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  color: var(--sales-ink);
  font-size: 16px;
}

.sales-dashboard-chart {
  display: block;
  width: 100%;
  height: auto !important;
  aspect-ratio: 2.35 / 1;
  max-height: 232px;
  margin-top: 12px;
  box-sizing: border-box;
  border: 1px solid rgba(208, 225, 231, .7);
  border-radius: 8px;
  background:
    radial-gradient(circle at 88% 12%, rgba(15, 169, 216, .12), transparent 28%),
    linear-gradient(180deg, rgba(255, 255, 255, .76), rgba(240, 248, 250, .48));
  box-shadow: inset 1px 1px 0 rgba(255, 255, 255, .86), inset 0 -18px 26px rgba(15, 104, 129, .025);
}

/* Doughnut charts need a square drawing area. The generic chart ratio is deliberately wide for bars. */
.sales-dashboard-chart.sales-dashboard-chart-pie {
  width: min(100%, 232px);
  height: auto !important;
  aspect-ratio: 1;
  max-height: none;
  margin-inline: auto;
}

.sales-focus-panel {
  display: grid;
  align-content: start;
}

.sales-task-list,
.sales-account-list,
.sales-document-list {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}

.sales-task-item,
.sales-account-item,
.sales-document-item {
  min-width: 0;
  min-height: 62px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid rgba(218, 231, 236, .86);
  border-radius: 8px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, .9), rgba(244, 250, 251, .74));
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .92),
    0 8px 16px rgba(28, 68, 84, .06);
  transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
}

.sales-task-item:hover,
.sales-account-item:hover,
.sales-document-item:hover {
  transform: translateY(-1px);
  border-color: rgba(15, 169, 216, .28);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .94),
    0 12px 22px rgba(28, 68, 84, .1);
}

.sales-task-item div,
.sales-account-item div:not(.sales-account-avatar),
.sales-document-item div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.sales-task-item strong,
.sales-account-item strong,
.sales-document-item strong {
  color: var(--sales-ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-task-item span,
.sales-task-item time,
.sales-account-item span,
.sales-account-item small,
.sales-document-item span,
.sales-document-item small {
  color: var(--sales-muted);
  font-size: 12px;
  line-height: 1.6;
}

.sales-task-item time,
.sales-document-item div:last-child {
  flex: 0 0 auto;
  text-align: left;
}

.sales-document-item b {
  color: var(--sales-ink);
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}

.sales-dashboard-bottom {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(320px, .75fr);
  gap: 16px;
  align-items: stretch;
}

.sales-dashboard-dimensions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  align-items: stretch;
}

.sales-section-heading {
  grid-column: 1 / -1;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 16px;
  padding: 4px 2px 0;
}

.sales-section-kicker {
  display: block;
  margin-bottom: 4px;
  color: #0c819f;
  font-size: 12px;
  font-weight: 800;
}

.sales-section-heading h2 {
  margin: 0;
  color: var(--sales-ink);
  font-size: 20px;
}

.sales-section-heading p {
  margin: 5px 0 0;
  color: var(--sales-muted);
  font-size: 13px;
}

.sales-section-count {
  flex: 0 0 auto;
  padding: 7px 10px;
  border: 1px solid #c8e9f1;
  border-radius: 8px;
  color: #0b718d;
  background: #eefbfe;
  font-size: 12px;
  font-weight: 800;
}

.sales-dashboard-dimensions > .sales-chart-panel {
  min-height: 304px;
  display: flex;
  flex-direction: column;
}

.sales-account-item {
  justify-content: start;
}

.sales-account-avatar {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  color: #ffffff;
  border-radius: 8px;
  background: linear-gradient(145deg, #0fa9d8, #16a77a);
  box-shadow:
    inset 1px 1px 0 rgba(255, 255, 255, .34),
    0 10px 18px rgba(15, 104, 129, .16);
  font-weight: 800;
}

.sales-account-item small {
  margin-inline-start: auto;
  padding: 4px 8px;
  border-radius: 999px;
  color: #205f4a;
  background: #dff8ec;
  font-weight: 800;
  white-space: nowrap;
}

.sales-inline-icon {
  width: 19px;
  height: 19px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.sales-inline-icon svg {
  width: 100%;
  height: 100%;
  display: block;
}

.sales-metric-icon .sales-inline-icon,
.sales-row-icon .sales-inline-icon {
  width: 20px;
  height: 20px;
}

@media (max-width: 1180px) {
  .sales-dashboard-metrics,
  .sales-dashboard-bottom {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-dashboard-dimensions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .sales-dashboard-dimensions > .sales-chart-panel:nth-of-type(5) {
    grid-column: 1 / -1;
    min-height: 304px;
  }

  .sales-dashboard-main {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .sales-dashboard-hero {
    display: grid;
    grid-template-columns: 1fr;
    align-items: start;
    padding: 16px;
  }

  .sales-dashboard-hero-actions {
    justify-content: stretch;
  }

  .sales-dashboard-hero-actions .btn {
    flex: 1 1 140px;
  }

  .sales-dashboard-metrics,
  .sales-dashboard-bottom,
  .sales-dashboard-dimensions {
    grid-template-columns: 1fr;
  }

  .sales-section-heading {
    display: grid;
    align-items: start;
  }

  .sales-dashboard-dimensions > .sales-chart-panel:nth-of-type(5) {
    grid-column: auto;
    min-height: 304px;
  }

  .sales-task-item,
  .sales-document-item {
    align-items: start;
  }

  .sales-document-item {
    display: grid;
  }

  .sales-task-item time,
  .sales-document-item div:last-child {
    text-align: right;
  }
}

@media (prefers-reduced-motion: reduce) {
  .sales-metric-card,
  .sales-dashboard-hero-actions .btn,
  .sales-task-item,
  .sales-account-item,
  .sales-document-item {
    transition: none;
  }

  .sales-metric-card:hover,
  .sales-dashboard-hero-actions .btn:hover,
  .sales-task-item:hover,
  .sales-account-item:hover,
  .sales-document-item:hover {
    transform: none;
  }
}

/* Lead dashboard rebuild */
.sales-dashboard-hero-compact {
  min-height: 96px;
  padding-block: 16px;
}

.sales-dashboard-hero-compact h1 {
  font-size: clamp(22px, 2.2vw, 29px);
}

.sales-dashboard-metrics {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.sales-dashboard-section {
  display: grid;
  gap: 14px;
  min-width: 0;
}

.sales-dashboard-grid {
  display: grid;
  gap: 16px;
  align-items: stretch;
  min-width: 0;
}

.sales-dashboard-grid-two {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.sales-dashboard-grid-three {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.sales-dashboard-grid-quality {
  grid-template-columns: minmax(0, 1.35fr) minmax(300px, .65fr);
}

.sales-dashboard-section .sales-chart-panel,
.sales-table-panel,
.sales-quality-panel {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--sales-border);
  border-radius: 8px;
  background: linear-gradient(145deg, #ffffff, #f6fafb);
  box-shadow:
    0 8px 20px rgba(31, 70, 83, .07),
    inset 1px 1px 0 rgba(255, 255, 255, .92);
}

.sales-dashboard-section .sales-chart-panel {
  min-height: 318px;
}

.sales-dashboard-section .sales-chart-panel-wide {
  min-height: 336px;
}

.sales-dashboard-section .sales-dashboard-chart {
  height: auto !important;
  max-height: none;
  aspect-ratio: 1.7 / 1;
}

.sales-dashboard-section .sales-dashboard-chart-line,
.sales-dashboard-section .sales-dashboard-chart-bar {
  aspect-ratio: 2.05 / 1;
}

.sales-dashboard-section .sales-dashboard-chart-horizontal {
  aspect-ratio: 1.42 / 1;
}

.sales-quality-list {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

.sales-quality-item {
  display: grid;
  gap: 8px;
  padding: 12px;
  border: 1px solid rgba(210, 226, 232, .9);
  border-radius: 8px;
  background: rgba(255, 255, 255, .78);
}

.sales-quality-item > div:first-child {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.sales-quality-item strong {
  color: var(--sales-ink);
  font-size: 13px;
}

.sales-quality-item span,
.sales-quality-item small {
  color: var(--sales-muted);
  font-size: 12px;
  font-weight: 700;
}

.sales-quality-progress {
  height: 9px;
  overflow: hidden;
  border-radius: 999px;
  background: #e9f1f4;
  box-shadow: inset 0 1px 2px rgba(19, 49, 64, .08);
}

.sales-quality-progress span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--sales-cyan), var(--sales-emerald));
}

.sales-quality-badge {
  display: inline-flex;
  min-width: 52px;
  justify-content: center;
  padding: 4px 8px;
  border-radius: 999px;
  color: #8a4f00;
  background: #fff4d8;
  font-size: 12px;
  font-weight: 800;
}

.sales-table-panel {
  min-height: 360px;
}

.sales-table-wrap {
  max-width: 100%;
  margin-top: 12px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.sales-dashboard-table {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0 8px;
  table-layout: fixed;
}

.sales-dashboard-table th {
  padding: 0 8px 2px;
  text-align: right;
  color: var(--sales-muted);
  font-size: 12px;
  font-weight: 800;
}

.sales-dashboard-table th button {
  min-height: 34px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  width: 100%;
  padding: 6px 0;
  border: 0;
  color: inherit;
  background: transparent;
  font: inherit;
  text-align: right;
  cursor: pointer;
}

.sales-dashboard-table th button::after {
  content: "↕";
  margin-inline-start: auto;
  color: #9bb0ba;
  font-size: 11px;
}

.sales-dashboard-table th[aria-sort="ascending"] button::after {
  content: "↑";
  color: var(--sales-cyan);
}

.sales-dashboard-table th[aria-sort="descending"] button::after {
  content: "↓";
  color: var(--sales-cyan);
}

.sales-dashboard-table td {
  padding: 11px 8px;
  color: var(--sales-ink);
  background: rgba(255, 255, 255, .84);
  border-block: 1px solid rgba(216, 230, 235, .9);
  font-size: 13px;
  line-height: 1.7;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sales-dashboard-table td:first-child {
  border-inline-start: 1px solid rgba(216, 230, 235, .9);
  border-radius: 0 8px 8px 0;
  font-weight: 800;
}

.sales-dashboard-table td:last-child {
  border-inline-end: 1px solid rgba(216, 230, 235, .9);
  border-radius: 8px 0 0 8px;
}

.sales-dashboard-table tbody tr:hover td {
  background: #f2fbfd;
}

@media (max-width: 1280px) {
  .sales-dashboard-metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sales-dashboard-grid-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 980px) {
  .sales-dashboard-grid-two,
  .sales-dashboard-grid-three,
  .sales-dashboard-grid-quality {
    grid-template-columns: 1fr;
  }

  .sales-dashboard-section .sales-dashboard-chart-line,
  .sales-dashboard-section .sales-dashboard-chart-bar,
  .sales-dashboard-section .sales-dashboard-chart-horizontal {
    aspect-ratio: 1.55 / 1;
  }
}

@media (max-width: 760px) {
  .sales-dashboard-metrics {
    grid-template-columns: 1fr;
  }

  .sales-dashboard-section .sales-chart-panel,
  .sales-table-panel,
  .sales-quality-panel {
    padding: 14px;
  }

  .sales-dashboard-section .sales-dashboard-chart-line,
  .sales-dashboard-section .sales-dashboard-chart-bar,
  .sales-dashboard-section .sales-dashboard-chart-horizontal {
    aspect-ratio: 1.18 / 1;
  }

  .sales-dashboard-table {
    min-width: 560px;
  }
}

/* Production login surface */
.login-page {
  --login-page: #f2f8fb;
  --login-panel: #ffffff;
  --login-well: #ffffff;
  --login-border-light: rgba(178, 205, 218, 0.76);
  --login-border-dark: #b8cbd6;
  --login-ink: #132c3a;
  --login-muted: #607482;
  --login-navy: #102a3d;
  --login-cyan: #0a9bd4;
  --login-cyan-dark: #0878a7;
  min-height: 100dvh;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  align-items: center;
  justify-content: stretch;
  justify-items: center;
  gap: 0;
  padding: 32px;
  overflow: auto;
  background-color: var(--login-page);
  background-image:
    radial-gradient(circle at 8% 15%, rgba(14, 126, 169, 0.22) 0 1px, transparent 1.45px),
    radial-gradient(circle at 18% 78%, rgba(14, 126, 169, 0.18) 0 1px, transparent 1.45px),
    radial-gradient(circle at 32% 24%, rgba(80, 103, 126, 0.13) 0 1px, transparent 1.35px),
    radial-gradient(circle at 48% 82%, rgba(80, 103, 126, 0.13) 0 1px, transparent 1.35px),
    radial-gradient(circle at 68% 18%, rgba(14, 126, 169, 0.16) 0 1px, transparent 1.45px),
    radial-gradient(circle at 84% 70%, rgba(80, 103, 126, 0.12) 0 1px, transparent 1.35px),
    radial-gradient(ellipse at 72% 38%, rgba(56, 189, 248, 0.18), transparent 36%),
    radial-gradient(ellipse at 32% 64%, rgba(165, 180, 252, 0.16), transparent 42%),
    radial-gradient(ellipse at 50% 100%, rgba(255, 255, 255, 0.8), transparent 54%),
    linear-gradient(135deg, #fbfdff 0%, #e7f5fa 50%, #f7fbfd 100%);
  background-repeat: no-repeat;
}

.login-page::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    linear-gradient(115deg, transparent 0 38%, rgba(255, 255, 255, 0.62) 48%, transparent 58%),
    radial-gradient(ellipse at 50% 50%, transparent 0 52%, rgba(14, 65, 94, 0.06) 100%);
  opacity: 0.72;
}

.login-shell {
  width: min(100%, 452px);
  min-height: 584px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(320px, 452px);
  grid-template-areas: "panel";
  gap: 0;
  align-items: stretch;
  justify-content: center;
  direction: ltr;
  position: relative;
  z-index: 1;
}

.login-panel,
.login-showcase {
  direction: rtl;
}

.login-panel {
  grid-area: panel;
  width: 100%;
  min-height: 584px;
  margin: 0;
  padding: 38px;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.94);
  border: 1px solid var(--login-border-light);
  border-radius: 8px;
  box-shadow:
    0 24px 60px rgba(26, 61, 82, 0.18),
    0 2px 8px rgba(26, 61, 82, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  position: relative;
  overflow: hidden;
}

.login-panel::before {
  content: "";
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(184, 205, 216, 0.54);
  border-radius: 6px;
  box-shadow: none;
  pointer-events: none;
}

.login-panel > * {
  position: relative;
  z-index: 1;
}

.login-panel-header {
  margin-bottom: 30px;
}

.login-page .brand-lockup {
  align-items: center;
  gap: 14px;
  margin: 0;
}

.login-logo-shell {
  width: 56px;
  height: 56px;
  padding: 8px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid #bdd0d9;
  border-radius: 6px;
  background: #f8fbfd;
  box-shadow:
    0 8px 18px rgba(35, 72, 94, 0.12),
    inset 1px 1px 0 rgba(255, 255, 255, 0.86);
}

.login-page .brand-lockup img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.login-page .brand-subtitle {
  margin: 0 0 3px;
  color: #0c7da9;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.4;
  letter-spacing: 0;
  transition: none;
}

.login-page .brand-title {
  margin: 0;
  color: var(--login-ink);
  font-size: 25px;
  font-weight: 800;
  line-height: 1.35;
}

.login-intro {
  margin: 18px 0 0;
  color: var(--login-muted);
  font-size: 14px;
  line-height: 1.85;
}

.login-fields {
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.login-page .field {
  gap: 8px;
  margin-bottom: 20px;
}

.login-page .field label {
  color: var(--login-ink);
  font-size: 14px;
  font-weight: 700;
}

.login-page .field input {
  width: 100%;
  min-height: 52px;
  padding: 12px 14px;
  color: var(--login-ink);
  border: 1px solid var(--login-border-dark);
  border-radius: 6px;
  background: var(--login-well);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.9),
    inset 0 1px 2px rgba(41, 76, 94, 0.07);
  transition: border-color 180ms ease, box-shadow 180ms ease, background-color 180ms ease;
}

.login-page .field input:hover {
  border-color: #9db7c2;
}

.login-page .field input:focus {
  border-color: var(--login-cyan);
  background: #fff;
  box-shadow:
    0 0 0 3px rgba(10, 155, 212, 0.16),
    0 8px 18px rgba(10, 155, 212, 0.08);
}

.password-row {
  display: block;
  position: relative;
}

.login-page .password-row input {
  padding-left: 58px;
}

.login-page .password-toggle {
  width: 40px;
  height: 40px;
  min-height: 40px;
  padding: 0;
  position: absolute;
  top: 6px;
  left: 6px;
  display: grid;
  place-items: center;
  color: #426270;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  box-shadow: none;
}

.login-page .password-toggle:hover {
  color: var(--login-cyan-dark);
  border-color: #b8cbd3;
  background: #eef7fa;
  box-shadow: none;
}

.login-page .password-toggle:focus-visible,
.login-page .login-submit:focus-visible {
  outline: 3px solid rgba(10, 155, 212, 0.42);
  outline-offset: 2px;
}

.login-error {
  margin: 2px 0 18px;
  padding: 11px 13px;
  color: #9d1c2d;
  border: 1px solid #e9b8c0;
  border-radius: 6px;
  background: #fff1f3;
  box-shadow: inset 1px 1px 2px rgba(157, 28, 45, 0.08);
  font-size: 13px;
  line-height: 1.65;
}

.login-error[hidden] {
  display: none;
}

.login-page .login-submit {
  min-height: 52px;
  margin-top: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: #fff;
  border: 1px solid #08749e;
  border-radius: 6px;
  background: linear-gradient(180deg, #14a9df, #087eab);
  box-shadow:
    0 14px 24px rgba(8, 112, 153, 0.22),
    inset 0 1px 0 rgba(255, 255, 255, 0.28);
  font-weight: 800;
  transition: transform 180ms ease, box-shadow 180ms ease, filter 180ms ease;
}

.login-page .login-submit:hover {
  background: linear-gradient(180deg, #20b8ea, #0785b6);
  filter: saturate(1.05);
  transform: translateY(-1px);
}

.login-page .login-submit:active {
  transform: translateY(1px);
  box-shadow:
    0 8px 18px rgba(8, 95, 131, 0.18),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

.login-page .login-submit[aria-busy="true"] {
  opacity: 0.86;
}

.login-submit-loader {
  width: 16px;
  height: 16px;
  display: none;
  border: 2px solid rgba(255, 255, 255, 0.42);
  border-top-color: #fff;
  border-radius: 50%;
  animation: login-spin 700ms linear infinite;
}

.login-submit[aria-busy="true"] .login-submit-loader {
  display: inline-block;
}

.login-support {
  margin: 20px 0 0;
  color: var(--login-muted);
  font-size: 12px;
  line-height: 1.75;
  text-align: center;
}

.login-version {
  margin: 8px 0 0;
  color: #7b8f9a;
  font-family: Arial, sans-serif;
  font-size: 11px;
  line-height: 1.4;
  text-align: center;
}

.login-showcase {
  display: none;
}

.login-showcase::before {
  width: auto;
  height: auto;
  top: 12px;
  right: 12px;
  bottom: 12px;
  left: 12px;
  border: 1px solid rgba(165, 205, 220, 0.2);
  border-radius: 5px;
  background: none;
}

.login-showcase::after {
  content: "";
  width: 96px;
  height: 3px;
  top: auto;
  right: 42px;
  bottom: 40px;
  left: auto;
  border: 0;
  border-radius: 0;
  background: #19b3e8;
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.24);
}

.login-showcase > * {
  position: relative;
  z-index: 1;
}

.showcase-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #d9f2fb;
  font-size: 15px;
  font-weight: 700;
  direction: ltr;
  text-align: left;
}

.showcase-brand img {
  width: 38px;
  height: 38px;
  padding: 4px;
  object-fit: contain;
  border: 1px solid rgba(165, 205, 220, 0.34);
  border-radius: 5px;
  background: rgba(1, 14, 24, 0.28);
  box-shadow: inset 1px 1px 2px rgba(0, 0, 0, 0.26);
}

.showcase-main {
  margin-top: auto;
}

.showcase-eyebrow {
  margin: 0 0 12px;
  color: #6ed2f4;
  font-size: 13px;
  font-weight: 700;
}

.login-showcase h2 {
  max-width: 560px;
  margin: 0;
  color: #f7fcfe;
  font-size: 38px;
  font-weight: 700;
  line-height: 1.4;
}

.login-showcase p:not(.showcase-eyebrow):not(.showcase-footer) {
  max-width: 580px;
  margin: 16px 0 0;
  color: #c7dce5;
  font-size: 15px;
  line-height: 1.9;
}

.showcase-grid {
  margin: 34px 0 0;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.showcase-grid div {
  min-height: 116px;
  padding: 15px;
  border: 1px solid rgba(144, 187, 204, 0.3);
  border-radius: 6px;
  background: linear-gradient(145deg, rgba(54, 92, 113, 0.7), rgba(14, 39, 56, 0.62));
  box-shadow:
    4px 5px 10px rgba(0, 11, 18, 0.2),
    inset 1px 1px 0 rgba(184, 222, 234, 0.14);
}

.showcase-grid dt {
  color: #f4fbfd;
  font-size: 15px;
  font-weight: 700;
}

.showcase-grid dd {
  margin: 8px 0 0;
  color: #b6d0da;
  font-size: 12px;
  line-height: 1.75;
}

.showcase-footer {
  margin: 28px 0 0;
  padding-bottom: 8px;
  color: #9ec0ce;
  font-size: 12px;
}

@keyframes login-spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 1024px) {
  .login-page {
    align-items: start;
    padding: 24px;
  }

  .login-shell {
    width: min(100%, 440px);
    min-height: 0;
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas:
      "panel"
      "showcase";
    gap: 20px;
    justify-content: center;
  }

  .login-panel,
  .login-showcase {
    min-height: 0;
  }

  .login-panel {
    padding: 36px;
  }

  .login-showcase {
    padding: 32px 36px;
  }

  .showcase-main {
    margin-top: 48px;
  }
}

@media (max-width: 640px) {
  .login-page {
    padding: 16px;
  }

  .login-shell {
    gap: 16px;
  }

  .login-panel {
    padding: 28px 22px;
  }

  .login-panel::before {
    inset: 8px;
  }

  .login-page .brand-title {
    font-size: 21px;
  }

  .login-panel-header {
    margin-bottom: 26px;
  }

  .login-showcase {
    padding: 28px 22px;
  }

  .login-showcase::after {
    right: 22px;
    bottom: 26px;
  }

  .showcase-main {
    margin-top: 36px;
  }

  .login-showcase h2 {
    font-size: 30px;
  }

  .showcase-grid {
    grid-template-columns: 1fr;
    margin-top: 24px;
  }

  .showcase-grid div {
    min-height: 0;
  }
}
