/* Final desktop dashboard polish. Visual only: keeps existing ids, buttons and data bindings. */
:root {
  --dm-dashboard-bg: #f4f7fc;
  --dm-dashboard-card: #ffffff;
  --dm-dashboard-ink: #071638;
  --dm-dashboard-muted: #5f6f8f;
  --dm-dashboard-line: #dce6f3;
  --dm-dashboard-blue: #0b63df;
  --dm-dashboard-green: #13a56b;
  --dm-dashboard-red: #ef1736;
  --dm-dashboard-amber: #f97316;
  --dm-dashboard-shadow: 0 14px 34px rgba(7, 22, 56, 0.07);
}

.top-title {
  display: grid;
  gap: 4px;
  min-width: 0;
}

.view-subtitle {
  display: none;
  margin: 0;
  color: #637395;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.15;
}

.sidebar {
  background:
    radial-gradient(circle at 30% 0%, rgba(22, 103, 216, 0.38), transparent 34%),
    linear-gradient(180deg, #083f88 0%, #062d69 42%, #031943 100%);
  gap: 14px;
  overflow-x: hidden;
}

.brand {
  gap: 6px;
}

.brand-logo {
  width: 122px;
  height: 76px;
}

.brand span {
  color: #ffffff;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0;
}

.sidebar-user {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 10px;
  min-height: 58px;
  padding: 10px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.12);
}

.sidebar-user-avatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: #0b63df;
  color: #ffffff;
  font-size: 12px;
  font-weight: 900;
}

.sidebar-user strong,
.sidebar-user small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user strong {
  color: #ffffff;
  font-size: 13px;
  line-height: 1.1;
}

.sidebar-user small {
  margin-top: 4px;
  color: #dbe8ff;
  font-size: 11px;
  font-weight: 800;
}

.sidebar-user small::before {
  content: "";
  width: 7px;
  height: 7px;
  display: inline-block;
  margin-right: 6px;
  border-radius: 50%;
  background: #22c55e;
  vertical-align: 1px;
}

.sidebar-user-caret {
  width: 9px;
  height: 9px;
  border-right: 2px solid rgba(255, 255, 255, 0.85);
  border-bottom: 2px solid rgba(255, 255, 255, 0.85);
  transform: rotate(45deg);
}

.menu-tree {
  gap: 6px;
}

.menu-group-title {
  min-height: 40px;
  padding: 8px 10px;
  border-radius: 8px;
  color: #edf4ff;
  font-size: 13px;
}

.menu-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.menu-arrow {
  flex: 0 0 auto;
}

.menu-group.active > .menu-group-title,
.menu-group.open > .menu-group-title,
.nav-tab.active {
  background: linear-gradient(135deg, #0b63df, #0749aa);
  box-shadow: 0 12px 24px rgba(2, 18, 52, 0.22);
}

.menu-group:not(.open) > .menu-group-title:hover,
.nav-tab:hover {
  background: rgba(255, 255, 255, 0.1);
}

.menu-icon {
  width: 24px;
  height: 24px;
  color: #ffffff;
}

.menu-icon::before {
  width: 20px;
  height: 20px;
}

.menu-icon-reception::before,
.menu-icon-warehouse::before {
  width: 21px;
  height: 21px;
  border: 0;
  border-radius: 0;
  background: currentColor;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-size: contain;
  mask-size: contain;
}

.menu-icon-reception::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v11'/%3E%3Cpath d='m7 9 5 5 5-5'/%3E%3Cpath d='M5 17h14'/%3E%3Cpath d='M5 17v3h14v-3'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 3v11'/%3E%3Cpath d='m7 9 5 5 5-5'/%3E%3Cpath d='M5 17h14'/%3E%3Cpath d='M5 17v3h14v-3'/%3E%3C/g%3E%3C/svg%3E");
}

.menu-icon-warehouse::before {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21V9l9-6 9 6v12'/%3E%3Cpath d='M9 21v-7h6v7'/%3E%3Cpath d='M3 21h18'/%3E%3Cpath d='M8 10h8'/%3E%3C/g%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 21V9l9-6 9 6v12'/%3E%3Cpath d='M9 21v-7h6v7'/%3E%3Cpath d='M3 21h18'/%3E%3Cpath d='M8 10h8'/%3E%3C/g%3E%3C/svg%3E");
}

.menu-branch {
  margin-left: 34px;
  padding-left: 16px;
}

.menu-child {
  min-height: 30px;
  padding: 7px 8px;
  font-size: 12px;
}

.sync-card {
  min-height: 70px;
  padding: 14px 16px;
  border-radius: 8px;
  background: rgba(0, 17, 51, 0.28);
}

.sync-card strong,
.sync-card small {
  color: #ffffff;
}

.sync-card small {
  color: #46f08a;
}

body[data-active-view="dashboard"] .main {
  background: var(--dm-dashboard-bg);
}

body[data-active-view="dashboard"] .topbar {
  height: 104px;
  min-height: 104px;
  padding: 0 28px;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid #dce6f3;
}

body[data-active-view="dashboard"] .topbar-left {
  gap: 16px;
}

body[data-active-view="dashboard"] .top-menu-button {
  width: 36px;
  height: 36px;
}

body[data-active-view="dashboard"] .topbar h1 {
  color: var(--dm-dashboard-ink);
  font-size: 24px;
  line-height: 1;
}

body[data-active-view="dashboard"] .view-subtitle {
  display: block;
}

body[data-active-view="dashboard"] .top-actions {
  gap: 10px;
}

body[data-active-view="dashboard"] #installBtn {
  display: none;
}

body[data-active-view="dashboard"] #refreshBtn {
  width: auto;
  min-width: 112px;
  height: 42px;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 7px;
  background: #ffffff;
  border-color: #cddbf0;
  color: #06245a;
  box-shadow: 0 4px 14px rgba(7, 22, 56, 0.04);
}

body[data-active-view="dashboard"] .notification-button,
body[data-active-view="dashboard"] .admin-avatar {
  display: grid;
}

body[data-active-view="dashboard"] .notification-button {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #f6f9ff;
}

body[data-active-view="dashboard"] .admin-avatar {
  width: 42px;
  height: 42px;
  background: #0b63df;
  color: #ffffff;
  font-size: 12px;
}

.top-account {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.account-menu-button {
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #092457;
  cursor: pointer;
}

.account-menu-button .admin-avatar {
  display: grid;
}

.account-caret {
  width: 8px;
  height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
}

.account-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 10px);
  z-index: 30;
  min-width: 168px;
  padding: 8px;
  border: 1px solid #dce6f3;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 18px 36px rgba(7, 22, 56, 0.16);
}

.account-menu-item {
  width: 100%;
  min-height: 40px;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 12px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  color: var(--dm-dashboard-red);
  font-size: 13px;
  font-weight: 900;
  text-align: left;
  cursor: pointer;
}

.account-menu-item::before {
  content: "";
  width: 16px;
  height: 16px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='M16 17l5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4'/%3E%3Cpath d='M16 17l5-5-5-5'/%3E%3Cpath d='M21 12H9'/%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat;
}

.account-menu-item:hover {
  background: #fff1f4;
}

#dashboard.view.active {
  padding: 22px 26px 18px;
}

body[data-active-view="dashboard"] .dashboard-frame {
  min-height: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

body[data-active-view="dashboard"] .dashboard-tab {
  display: none;
}

body[data-active-view="dashboard"] .dashboard-grid {
  display: grid;
  grid-template-columns: minmax(420px, 1.24fr) minmax(320px, 0.95fr) minmax(360px, 1.05fr);
  gap: 16px;
  align-items: stretch;
}

body[data-active-view="dashboard"] .dashboard-card,
body[data-active-view="dashboard"] .dashboard-card.compact {
  position: relative;
  height: auto;
  min-height: 0;
  padding: 20px 22px;
  border: 1px solid #e1e9f5;
  border-radius: 8px;
  background: var(--dm-dashboard-card);
  box-shadow: var(--dm-dashboard-shadow);
  overflow: hidden;
}

body[data-active-view="dashboard"] .dashboard-card:nth-child(-n + 3) {
  min-height: 250px;
}

body[data-active-view="dashboard"] .dashboard-card:nth-child(n + 4):nth-child(-n + 6) {
  min-height: 190px;
}

body[data-active-view="dashboard"] .dashboard-card:nth-child(n + 7) {
  min-height: 238px;
}

body[data-active-view="dashboard"] .dashboard-count-analysis-card {
  grid-template-rows: auto minmax(108px, 1fr) auto;
  gap: 12px;
}

body[data-active-view="dashboard"] .dashboard-card-head {
  min-height: 0;
  align-items: flex-start;
  gap: 14px;
}

body[data-active-view="dashboard"] .dashboard-card-head h2 {
  color: var(--dm-dashboard-ink);
  font-size: 15px;
  line-height: 1.1;
}

body[data-active-view="dashboard"] .dashboard-card-head span {
  color: var(--dm-dashboard-muted);
  font-size: 12px;
  line-height: 1.2;
  text-align: left;
}

body[data-active-view="dashboard"] .dashboard-year-pill {
  padding: 7px 11px;
  border-radius: 7px;
  color: #173b77;
  background: #f6f9ff;
}

body[data-active-view="dashboard"] .erp-card-icon {
  width: 54px;
  height: 54px;
  border-radius: 8px;
}

body[data-active-view="dashboard"] .erp-card-icon::before {
  width: 32px;
  height: 32px;
}

body[data-active-view="dashboard"] .erp-card-icon.blue {
  background: #eaf2ff;
  color: #0b63df;
}

body[data-active-view="dashboard"] .erp-card-icon.green {
  background: #e8f8ef;
  color: #16a34a;
}

body[data-active-view="dashboard"] .erp-card-icon.purple {
  background: #f0e8ff;
  color: #7c3aed;
}

body[data-active-view="dashboard"] .erp-card-icon.cyan {
  background: #def8fb;
  color: #0891b2;
}

body[data-active-view="dashboard"] .erp-card-icon.red {
  background: #ffe7eb;
  color: var(--dm-dashboard-red);
}

body[data-active-view="dashboard"] .dashboard-month-bars {
  min-height: 120px;
  gap: 9px;
  border-bottom: 1px solid #edf2f8;
}

body[data-active-view="dashboard"] .dashboard-month-bar {
  height: 112px;
  grid-template-rows: 18px 1fr 16px;
}

body[data-active-view="dashboard"] .dashboard-month-bar strong {
  color: #173b77;
  font-size: 11px;
}

body[data-active-view="dashboard"] .dashboard-month-bar i {
  width: 18px;
  max-height: 78px;
  border-radius: 7px 7px 2px 2px;
  background: linear-gradient(180deg, #7ea6ff, #236be5);
}

body[data-active-view="dashboard"] .dashboard-month-bar.empty i {
  width: 5px;
  background: #d9e4f3;
}

body[data-active-view="dashboard"] .dashboard-month-summary article {
  min-height: 50px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f7faff;
}

body[data-active-view="dashboard"] .dashboard-month-summary .erp-card-icon {
  width: 34px;
  height: 34px;
}

body[data-active-view="dashboard"] .dashboard-month-summary .erp-card-icon::before {
  width: 22px;
  height: 22px;
}

body[data-active-view="dashboard"] .dashboard-kpi-row,
body[data-active-view="dashboard"] .dashboard-split-kpi {
  min-height: 92px;
  gap: 0;
}

body[data-active-view="dashboard"] .dashboard-kpi-row strong,
body[data-active-view="dashboard"] .dashboard-split-kpi strong {
  color: var(--dm-dashboard-ink);
  font-size: 28px;
  font-weight: 900;
}

body[data-active-view="dashboard"] .dashboard-kpi-row span,
body[data-active-view="dashboard"] .dashboard-split-kpi span {
  color: #294778;
  font-size: 11px;
  line-height: 1.2;
}

body[data-active-view="dashboard"] .dashboard-kpi-row article + article,
body[data-active-view="dashboard"] .dashboard-split-kpi div + div {
  border-left: 1px solid var(--dm-dashboard-line);
}

body[data-active-view="dashboard"] .dashboard-kpi-row .danger strong,
body[data-active-view="dashboard"] .dashboard-card:nth-child(6) .dashboard-kpi-row .danger strong {
  color: var(--dm-dashboard-red);
}

body[data-active-view="dashboard"] .dashboard-kpi-row .warning strong {
  color: var(--dm-dashboard-amber);
}

body[data-active-view="dashboard"] .dashboard-progress {
  display: grid;
  gap: 9px;
  padding-top: 14px;
  border-top: 1px solid #eef3fb;
}

body[data-active-view="dashboard"] .dashboard-progress > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: #173b77;
  font-size: 12px;
  font-weight: 900;
}

body[data-active-view="dashboard"] .dashboard-progress > i {
  height: 10px;
  overflow: hidden;
  border-radius: 999px;
  background: #e8eef7;
}

body[data-active-view="dashboard"] .dashboard-progress b {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, #0b63df, #0466ff);
}

body[data-active-view="dashboard"] .dashboard-import-meta {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0;
  min-height: 58px;
  padding: 12px 14px;
  border-radius: 8px;
  background: #eef5ff;
}

body[data-active-view="dashboard"] .dashboard-import-meta article {
  display: grid;
  gap: 3px;
  padding: 0 12px;
}

body[data-active-view="dashboard"] .dashboard-import-meta article + article {
  border-left: 1px solid #d5e2f3;
}

body[data-active-view="dashboard"] .dashboard-import-meta span {
  color: #5e7090;
  font-size: 11px;
  font-weight: 800;
}

body[data-active-view="dashboard"] .dashboard-import-meta strong {
  color: #0b244d;
  font-size: 13px;
  font-weight: 900;
}

body[data-active-view="dashboard"] .dashboard-donut-row {
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 22px;
}

body[data-active-view="dashboard"] .dashboard-donut {
  width: 106px;
  background: conic-gradient(#0b63df 0 var(--donut-value, 0%), #f59e0b var(--donut-value, 0%) 100%);
}

body[data-active-view="dashboard"] .dashboard-donut::after {
  inset: 30px;
}

body[data-active-view="dashboard"] .dashboard-donut span {
  color: var(--dm-dashboard-ink);
  font-size: 16px;
}

body[data-active-view="dashboard"] .dashboard-legend {
  gap: 9px;
}

body[data-active-view="dashboard"] .dashboard-legend div {
  color: #294778;
  font-size: 12px;
  font-weight: 900;
}

body[data-active-view="dashboard"] .dashboard-legend i {
  width: 10px;
  height: 10px;
}

body[data-active-view="dashboard"] .horizontal-bars {
  margin-top: 14px;
  gap: 10px;
}

body[data-active-view="dashboard"] .horizontal-bar-row {
  grid-template-columns: 62px minmax(0, 1fr) 48px;
  gap: 12px;
}

body[data-active-view="dashboard"] .horizontal-bar-row span,
body[data-active-view="dashboard"] .horizontal-bar-row strong {
  color: #153467;
  font-size: 12px;
  font-weight: 900;
}

body[data-active-view="dashboard"] .horizontal-bar-row div {
  height: 15px;
  border-radius: 4px;
  background: #e9eff7;
}

body[data-active-view="dashboard"] .horizontal-bar-row i {
  border-radius: inherit;
  background: #236be5;
}

body[data-active-view="dashboard"] .dashboard-list {
  margin-top: 14px;
}

body[data-active-view="dashboard"] .dashboard-list-item {
  min-height: 39px;
  padding: 8px 0;
  border-bottom: 1px solid #edf2f8;
}

body[data-active-view="dashboard"] .dashboard-list-item strong {
  color: #092457;
  font-size: 12px;
}

body[data-active-view="dashboard"] .dashboard-list-item span {
  color: #5c6d8a;
  font-size: 11px;
}

body[data-active-view="dashboard"] .number-mark {
  min-height: 26px;
  width: 68px;
  border-radius: 7px;
}

@media (max-width: 1500px) {
  body[data-active-view="dashboard"] .dashboard-grid {
    grid-template-columns: repeat(2, minmax(320px, 1fr));
  }

  body[data-active-view="dashboard"] .dashboard-card:nth-child(-n + 3),
  body[data-active-view="dashboard"] .dashboard-card:nth-child(n + 4):nth-child(-n + 6),
  body[data-active-view="dashboard"] .dashboard-card:nth-child(n + 7) {
    min-height: 210px;
  }
}
