/* AYA-2026 premium operational workspace. Loaded after the legacy stylesheet. */
@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin.938c6e8019b6.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "Manrope";
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url("../fonts/manrope-latin-ext.6d36d5bdedfa.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

:root {
  --font-ui: "Manrope", "Segoe UI Variable Text", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  --premium-canvas: #f5f7fa;
  --premium-canvas-deep: #edf1f5;
  --premium-surface: #ffffff;
  --premium-surface-raised: #ffffff;
  --premium-ink: #182230;
  --premium-ink-soft: #344054;
  --premium-muted: #667085;
  --premium-faint: #98a2b3;
  --premium-line: #dfe4ea;
  --premium-line-strong: #cbd3dc;
  --premium-focus: #2f6fb3;
  --premium-teal: #0f766e;
  --premium-amber: #b05f05;
  --premium-red: #b4232c;
  --premium-blue: #2463a8;
  --premium-green: #13795b;
  --premium-sidebar: #ffffff;
  --premium-sidebar-ink: #344054;
  --premium-sidebar-muted: #7d8998;
  --premium-shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.04), 0 5px 14px rgba(16, 24, 40, 0.035);
  --premium-shadow-md: 0 12px 30px rgba(16, 24, 40, 0.09);
  --premium-shadow-lg: 0 24px 70px rgba(16, 24, 40, 0.16);
  --premium-radius: 8px;
  --premium-control-radius: 7px;
  --sidebar-width: 272px;
  --sidebar-collapsed-width: 76px;
  --motion-standard: 180ms cubic-bezier(0.2, 0, 0, 1);
  --motion-layout: 240ms cubic-bezier(0.2, 0, 0, 1);
}

html,
body,
button,
input,
select,
textarea {
  font-family: var(--font-ui);
  letter-spacing: 0;
  font-kerning: normal;
  font-optical-sizing: auto;
}

html {
  color-scheme: light;
  scrollbar-color: #aab4c0 #edf1f5;
}

body.app-body {
  color: var(--premium-ink);
  background: var(--premium-canvas);
  background-image: none;
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

button,
a,
input,
select,
textarea {
  -webkit-tap-highlight-color: transparent;
}

button,
a,
select,
input[type="checkbox"],
input[type="radio"] {
  cursor: pointer;
}

::selection {
  color: #ffffff;
  background: var(--role-accent);
}

:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--role-accent) 24%, transparent);
  outline-offset: 2px;
}

/* Navigation */
.premium-navigation.sidebar {
  width: var(--sidebar-width);
  border-top: 0;
  border-right: 1px solid var(--premium-line);
  color: var(--premium-sidebar-ink);
  background: var(--premium-sidebar);
  box-shadow: 10px 0 32px rgba(16, 24, 40, 0.035);
}

.premium-navigation .brand-block {
  min-height: 84px;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--premium-line);
  background: var(--premium-surface);
}

.premium-navigation .brand-block::after {
  position: absolute;
  right: 0;
  bottom: -1px;
  left: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--role-accent) 0 34%, var(--premium-teal) 34% 68%, var(--premium-amber) 68% 100%);
  content: "";
}

.premium-navigation .brand-block {
  position: relative;
}

.premium-navigation .brand-mark {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid color-mix(in srgb, var(--role-accent) 18%, var(--premium-line));
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 8px 20px rgba(16, 24, 40, 0.1);
}

.premium-navigation .brand-name {
  color: var(--premium-ink);
  font-size: 17px;
  font-weight: 800;
  line-height: 1.2;
}

.premium-navigation .brand-company {
  display: flex;
  max-width: 172px;
  align-items: center;
  gap: 6px;
  color: var(--premium-muted);
  font-size: 11px;
  font-weight: 600;
}

.brand-status-dot {
  width: 7px;
  height: 7px;
  flex: 0 0 7px;
  border: 2px solid #d7f4e7;
  border-radius: 50%;
  background: #149164;
  box-shadow: 0 0 0 2px rgba(20, 145, 100, 0.09);
}

.premium-navigation .nav-list {
  gap: 3px;
  padding: 13px 10px 18px;
  scrollbar-width: thin;
  scrollbar-color: #b7c0cb transparent;
}

.premium-navigation .nav-list > .nav-item {
  margin-bottom: 5px;
}

.nav-group {
  display: grid;
  gap: 2px;
  margin-top: 6px;
}

.nav-group-toggle {
  display: flex;
  width: 100%;
  min-height: 30px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border: 0;
  border-radius: 6px;
  color: var(--premium-sidebar-muted);
  background: transparent;
  font: inherit;
  font-size: 9px;
  font-weight: 800;
  text-align: left;
  text-transform: uppercase;
  transition: color var(--motion-standard), background-color var(--motion-standard);
}

.nav-group-toggle:hover {
  color: var(--premium-ink-soft);
  background: #f3f5f8;
}

.nav-group-toggle svg {
  width: 14px;
  height: 14px;
  transition: transform var(--motion-layout);
}

.nav-group.is-collapsed .nav-group-toggle svg {
  transform: rotate(-90deg);
}

.nav-group-items {
  display: grid;
  gap: 2px;
  max-height: 760px;
  min-height: 0;
  overflow: hidden;
  opacity: 1;
  transition: max-height var(--motion-layout), opacity var(--motion-standard);
}

.nav-group.is-collapsed .nav-group-items {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}

.nav-group-items > .nav-item {
  flex-shrink: 0;
}

.premium-navigation .nav-item {
  min-height: 42px;
  gap: 11px;
  padding: 8px 11px;
  border: 1px solid transparent;
  border-radius: 7px;
  color: var(--premium-sidebar-ink);
  background: transparent;
  font-size: 13px;
  font-weight: 650;
  transition: border-color var(--motion-standard), color var(--motion-standard), background-color var(--motion-standard), transform var(--motion-standard);
}

.premium-navigation .nav-item::before {
  inset: 7px auto 7px 0;
  width: 3px;
  border-radius: 0 3px 3px 0;
}

.premium-navigation .nav-item svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  color: #64748b;
  stroke-width: 1.8;
  transition: color var(--motion-standard), transform var(--motion-standard);
}

.premium-navigation .nav-item:hover {
  transform: translateX(2px);
  border-color: #e1e6ec;
  color: var(--premium-ink);
  background: #f7f9fb;
}

.premium-navigation .nav-item:hover svg {
  color: var(--role-accent);
  transform: scale(1.04);
}

.premium-navigation .nav-item.active {
  border-color: color-mix(in srgb, var(--role-accent) 16%, var(--premium-line));
  color: var(--role-accent-dark);
  background: color-mix(in srgb, var(--role-accent-soft) 70%, #ffffff);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.premium-navigation .nav-item.active svg {
  color: var(--role-accent);
  stroke-width: 2.2;
}

.premium-navigation .nav-count {
  min-width: 21px;
  height: 21px;
  padding: 0 5px;
  border: 2px solid #ffffff;
  color: #ffffff;
  background: var(--premium-red);
  font-size: 9px;
  box-shadow: 0 3px 8px rgba(180, 35, 44, 0.18);
}

.premium-navigation .sidebar-footer {
  min-height: 76px;
  padding: 12px;
  border-top: 1px solid var(--premium-line);
  background: #fbfcfd;
  box-shadow: 0 -8px 22px rgba(16, 24, 40, 0.025);
}

.premium-navigation .avatar {
  width: 38px;
  height: 38px;
  flex-basis: 38px;
  border: 1px solid color-mix(in srgb, var(--role-accent) 22%, transparent);
  border-radius: 8px;
  background: var(--role-accent);
  box-shadow: none;
}

.premium-navigation .user-copy strong {
  color: var(--premium-ink);
  font-size: 12px;
  font-weight: 750;
}

.premium-navigation .user-copy small {
  color: var(--premium-muted);
  font-size: 10px;
  font-weight: 600;
}

.sidebar-collapsed .premium-navigation {
  width: var(--sidebar-collapsed-width);
}

.sidebar-collapsed .premium-navigation .brand-block {
  padding-inline: 15px;
}

.sidebar-collapsed .premium-navigation .nav-list {
  padding-inline: 10px;
}

.sidebar-collapsed .nav-group-toggle {
  display: none;
}

.sidebar-collapsed .nav-group-items,
.sidebar-collapsed .nav-group.is-collapsed .nav-group-items {
  display: grid;
  max-height: 760px;
  opacity: 1;
  pointer-events: auto;
}

.sidebar-collapsed .premium-navigation .nav-item {
  min-height: 44px;
  padding: 8px;
  overflow: visible;
}

.sidebar-collapsed .premium-navigation .nav-item::after {
  position: fixed;
  z-index: 120;
  left: 84px;
  display: block;
  padding: 7px 9px;
  border: 1px solid #344054;
  border-radius: 6px;
  color: #ffffff;
  background: #182230;
  box-shadow: var(--premium-shadow-md);
  content: attr(data-nav-label);
  font-size: 10px;
  font-weight: 700;
  opacity: 0;
  pointer-events: none;
  transform: translateX(-4px);
  transition: opacity var(--motion-standard), transform var(--motion-standard);
  white-space: nowrap;
}

.sidebar-collapsed .premium-navigation .nav-item:hover::after,
.sidebar-collapsed .premium-navigation .nav-item:focus-visible::after {
  opacity: 1;
  transform: translateX(0);
}

.sidebar-collapsed .app-shell {
  margin-left: var(--sidebar-collapsed-width);
}

/* Top workspace bar */
.app-shell {
  margin-left: var(--sidebar-width);
  transition: margin-left var(--motion-layout);
}

.topbar {
  height: 70px;
  gap: 12px;
  padding: 0 24px;
  border-bottom: 1px solid rgba(203, 211, 220, 0.9);
  background: rgba(255, 255, 255, 0.93);
  box-shadow: 0 4px 18px rgba(16, 24, 40, 0.04);
  backdrop-filter: blur(16px) saturate(1.15);
}

.desktop-sidebar-toggle,
.topbar .mobile-menu {
  border-color: var(--premium-line);
  color: var(--premium-ink-soft);
  background: #f7f9fb;
}

.topbar-company {
  color: var(--premium-ink);
  font-size: 13px;
  font-weight: 750;
}

.topbar-role {
  color: var(--premium-muted);
  font-size: 10px;
  font-weight: 600;
}

.topbar-context {
  display: grid;
  min-width: 0;
  gap: 1px;
  margin-left: 5px;
  padding-left: 17px;
  border-left: 1px solid var(--premium-line);
}

.topbar-context span {
  color: var(--premium-faint);
  font-size: 9px;
  font-weight: 750;
  text-transform: uppercase;
}

.topbar-context strong {
  overflow: hidden;
  max-width: 260px;
  color: var(--premium-ink-soft);
  font-size: 12px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.topbar-actions {
  gap: 8px;
}

.topbar .theme-switch {
  border-color: var(--premium-line-strong);
  background: #f7f9fb;
  box-shadow: none;
}

.topbar .theme-option {
  min-height: 29px;
  color: var(--premium-muted);
  font-size: 9px;
}

.topbar .theme-option.active {
  color: #ffffff;
  background: var(--premium-ink);
}

.day-chip {
  padding: 7px 9px;
  border-left: 1px solid var(--premium-line);
  color: var(--premium-muted);
  font-size: 9px;
}

.live-badge {
  min-height: 29px;
  border-color: #b5dfce;
  color: #09613f;
  background: #f0faf6;
  font-size: 9px;
}

.workspace-progress {
  position: fixed;
  z-index: 90;
  top: 69px;
  right: 0;
  left: var(--sidebar-width);
  height: 2px;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  transition: left var(--motion-layout), opacity 100ms ease;
}

.workspace-progress span {
  display: block;
  width: 36%;
  height: 100%;
  background: linear-gradient(90deg, var(--role-accent), var(--premium-teal), var(--premium-amber));
  transform: translateX(-110%);
}

.workspace-progress.is-active {
  opacity: 1;
}

.workspace-progress.is-active span {
  animation: premium-progress 900ms cubic-bezier(0.25, 0.1, 0.25, 1) infinite;
}

.workspace-progress.is-complete span {
  width: 100%;
  animation: none;
  transform: translateX(0);
}

.sidebar-collapsed .workspace-progress {
  left: var(--sidebar-collapsed-width);
}

@keyframes premium-progress {
  from { transform: translateX(-110%); }
  to { transform: translateX(310%); }
}

/* Common workspace surfaces */
.content {
  width: min(100%, 1600px);
  padding: 26px clamp(20px, 2.4vw, 38px) 40px;
}

.content > * {
  animation: premium-enter 180ms cubic-bezier(0.2, 0, 0, 1) both;
}

@keyframes premium-enter {
  from { opacity: 0; transform: translateY(4px); }
  to { opacity: 1; transform: translateY(0); }
}

.page-heading,
.dashboard-heading {
  min-height: 70px;
  align-items: flex-start;
  margin-bottom: 20px;
}

.page-heading h1,
.dashboard-heading h1 {
  margin: 5px 0 4px;
  color: var(--premium-ink);
  font-size: clamp(27px, 2vw, 34px);
  font-weight: 800;
  line-height: 1.16;
}

.page-heading p,
.dashboard-heading p {
  max-width: 760px;
  color: var(--premium-muted);
  font-size: 12px;
  font-weight: 500;
  line-height: 1.55;
}

.eyebrow,
.login-kicker {
  color: var(--role-accent-dark);
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.heading-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
}

.section-gap {
  margin-top: 18px;
}

.premium-surface,
.section-block,
.form-surface,
.detail-group,
.quick-panel,
.analytics-panel,
.dashboard-command-bar,
.filter-bar {
  border: 1px solid var(--premium-line);
  border-radius: var(--premium-radius);
  color: var(--premium-ink);
  background: var(--premium-surface);
  box-shadow: var(--premium-shadow-sm);
}

.section-block:hover,
.form-surface:hover,
.detail-group:hover,
.analytics-panel:hover,
.executive-stat:hover,
.stat-card:hover {
  transform: none;
}

.section-block:hover,
.form-surface:hover,
.detail-group:hover,
.analytics-panel:hover {
  border-color: var(--premium-line-strong);
  box-shadow: var(--premium-shadow-sm);
}

.section-head {
  min-height: 68px;
  padding: 15px 18px;
  border-bottom-color: var(--premium-line);
  background: #fbfcfd;
}

.section-head h2,
.analytics-title h2 {
  color: var(--premium-ink);
  font-size: 15px;
  font-weight: 750;
}

.section-head p,
.analytics-title p {
  margin: 3px 0 0;
  color: var(--premium-muted);
  font-size: 11px;
  line-height: 1.45;
}

.stat-grid,
.executive-stat-grid {
  gap: 12px;
  margin-bottom: 18px;
}

.stat-card,
.executive-stat {
  min-height: 108px;
  gap: 14px;
  padding: 17px;
  border: 1px solid var(--premium-line);
  border-radius: var(--premium-radius);
  background: var(--premium-surface-raised);
  box-shadow: var(--premium-shadow-sm);
  transition: border-color var(--motion-standard), box-shadow var(--motion-standard);
}

.stat-card:hover,
.executive-stat:hover {
  border-color: color-mix(in srgb, var(--role-accent) 22%, var(--premium-line));
  box-shadow: 0 7px 20px rgba(16, 24, 40, 0.07);
}

.stat-icon,
.executive-stat > svg {
  width: 42px;
  height: 42px;
  flex-basis: 42px;
  border: 1px solid currentColor;
  border-color: color-mix(in srgb, currentColor 14%, transparent);
  border-radius: 8px;
  box-shadow: none;
}

.stat-card span,
.executive-stat span {
  color: var(--premium-muted);
  font-size: 11px;
  font-weight: 650;
}

.stat-card strong,
.executive-stat strong {
  margin-top: 5px;
  color: var(--premium-ink);
  font-size: clamp(21px, 2vw, 26px);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.quick-panel > a {
  min-height: 52px;
  border-bottom-color: var(--premium-line);
  color: var(--premium-ink-soft);
  font-size: 11px;
  font-weight: 700;
  transition: color var(--motion-standard), background-color var(--motion-standard), padding-left var(--motion-standard);
}

.quick-panel > a:hover {
  padding-left: 19px;
  color: var(--role-accent-dark);
  background: color-mix(in srgb, var(--role-accent-soft) 42%, #ffffff);
}

/* Controls and forms */
.form-surface {
  padding: 20px;
}

.form-grid,
.standard-form,
.filter-bar {
  gap: 14px;
}

.field label,
.filter-bar label,
.standard-form label,
.settlement-fieldset label {
  margin-bottom: 6px;
  color: var(--premium-ink-soft);
  font-size: 11px;
  font-weight: 700;
}

input:not([type="checkbox"]):not([type="radio"]),
select,
textarea,
.search-box {
  border-color: var(--premium-line-strong);
  border-radius: var(--premium-control-radius);
  color: var(--premium-ink);
  background: #ffffff;
  box-shadow: inset 0 1px 1px rgba(16, 24, 40, 0.025);
  font-size: 13px;
  font-weight: 520;
}

input:not([type="checkbox"]):not([type="radio"]),
select {
  min-height: 44px;
}

textarea {
  min-height: 100px;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  color: #98a2b3;
}

input:focus,
select:focus,
textarea:focus,
.search-box:focus-within {
  border-color: var(--premium-focus);
  outline: 0;
  box-shadow: 0 0 0 3px rgba(47, 111, 179, 0.12);
  transform: none;
}

input[type="checkbox"],
input[type="radio"] {
  accent-color: var(--role-accent);
}

.filter-bar {
  margin-bottom: 14px;
  padding: 12px;
  background: #ffffff;
}

.search-box svg {
  width: 18px;
  height: 18px;
  color: var(--premium-muted);
}

.primary-button,
.secondary-button,
.danger-button,
.small-button {
  min-height: 42px;
  gap: 8px;
  padding: 9px 14px;
  border-radius: var(--premium-control-radius);
  font-family: var(--font-ui);
  font-size: 11px;
  font-weight: 750;
  box-shadow: none;
}

.primary-button {
  border-color: var(--role-accent-dark);
  color: #ffffff;
  background: var(--role-accent);
}

.primary-button:hover {
  border-color: var(--role-accent-dark);
  background: var(--role-accent-dark);
  box-shadow: 0 8px 18px color-mix(in srgb, var(--role-accent) 20%, transparent);
}

.secondary-button,
.small-button {
  border-color: var(--premium-line-strong);
  color: var(--premium-ink-soft);
  background: #ffffff;
}

.secondary-button:hover,
.small-button:hover {
  border-color: #aeb8c4;
  color: var(--premium-ink);
  background: #f7f9fb;
}

.danger-button {
  border-color: #efc0c4;
  color: #a51d27;
  background: #fff7f7;
}

.danger-button:hover {
  border-color: #d89096;
  color: #871820;
  background: #fdebec;
}

.icon-button {
  border-radius: 7px;
}

.form-actions {
  margin-top: 4px;
  padding-top: 15px;
  border-top-color: var(--premium-line);
}

.form-alert,
.message {
  border-radius: 7px;
  font-size: 11px;
  font-weight: 620;
  box-shadow: var(--premium-shadow-sm);
}

/* Tables and records */
.table-wrap {
  border-radius: 0 0 var(--premium-radius) var(--premium-radius);
  scrollbar-width: thin;
  scrollbar-color: #aab4c0 #eef2f6;
}

.section-block > .table-wrap:first-child,
.table-wrap.premium-surface {
  border-radius: var(--premium-radius);
}

.premium-table,
table {
  color: var(--premium-ink-soft);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}

.premium-table thead,
table thead {
  background: #f3f5f7;
}

.premium-table th,
table th {
  position: sticky;
  z-index: 2;
  top: 0;
  height: 44px;
  padding: 11px 14px;
  border-bottom: 1px solid var(--premium-line-strong);
  color: #536071;
  background: #f3f5f7;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
}

.premium-table td,
table td {
  min-height: 48px;
  padding: 12px 14px;
  border-bottom-color: #e8ecf0;
  color: var(--premium-ink-soft);
  background: transparent;
  font-weight: 540;
}

.premium-table tbody tr,
table tbody tr {
  background: #ffffff;
  transition: background-color var(--motion-standard), box-shadow var(--motion-standard);
}

.premium-table tbody tr:hover,
table tbody tr:hover {
  background: #f7fafc;
  box-shadow: inset 3px 0 0 var(--role-accent);
}

.premium-table tbody tr:hover td,
table tbody tr:hover td {
  background: transparent;
}

.numeric-cell {
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.table-link {
  color: var(--role-accent-dark);
  font-weight: 780;
}

.table-link:hover {
  color: var(--role-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.empty-cell {
  height: 118px;
  color: var(--premium-muted);
  background: #fbfcfd;
}

.status-badge {
  min-height: 25px;
  padding: 5px 8px;
  border: 1px solid transparent;
  font-size: 10px;
  font-weight: 750;
}

.status-badge.active,
.status-badge.open,
.status-badge.completed,
.status-badge.accepted,
.status-badge.delivered,
.status-badge.paid {
  border-color: #b7dfce;
  color: #0a6844;
  background: #edf9f3;
}

.status-badge.pending,
.status-badge.on_hold,
.status-badge.partially_paid {
  border-color: #ecd39c;
  color: #875008;
  background: #fff8e8;
}

.status-badge.inactive,
.status-badge.closed,
.status-badge.rejected,
.status-badge.unpaid {
  border-color: #efc0c4;
  color: #8e1c25;
  background: #fff2f3;
}

/* Details, operational tools and charts */
.detail-layout,
.dashboard-grid,
.analytics-grid {
  gap: 16px;
}

.detail-list {
  padding: 8px 18px 18px;
}

.detail-list > div {
  border-bottom-color: var(--premium-line);
}

.detail-list dt {
  color: var(--premium-muted);
  font-size: 10px;
  font-weight: 780;
}

.detail-list dd {
  color: var(--premium-ink);
  font-size: 13px;
  font-weight: 650;
}

.dashboard-command-bar,
.month-control,
.dashboard-controls {
  border-color: var(--premium-line);
  border-radius: var(--premium-radius);
  background: #ffffff;
  box-shadow: var(--premium-shadow-sm);
}

.analytics-panel,
.executive-stat,
.metric-matrix > a,
.metric-matrix-three > a {
  border-color: var(--premium-line);
  border-radius: var(--premium-radius);
  background: #ffffff;
  box-shadow: var(--premium-shadow-sm);
}

.metric-matrix > a:hover,
.metric-matrix-three > a:hover {
  transform: none;
  border-color: color-mix(in srgb, var(--role-accent) 20%, var(--premium-line));
  background: #f8fafc;
  box-shadow: var(--premium-shadow-sm);
}

.settlement-fieldset,
.cash-count-review div,
.reconciliation-grid > div,
.denomination-total-row,
.visit-location-panel,
.choice-list-panel {
  border-color: var(--premium-line);
  border-radius: var(--premium-radius);
  background: #fbfcfd;
}

.order-customer-section,
.order-article-section,
.order-notes-section,
.quick-article-entry,
.selected-item-strip,
.order-total-bar {
  border-color: var(--premium-line);
  border-radius: var(--premium-radius);
  box-shadow: var(--premium-shadow-sm);
}

.shop-photo-band img {
  border: 1px solid var(--premium-line);
  border-radius: 7px;
  box-shadow: var(--premium-shadow-sm);
}

.operator-reminder-panel,
.article-ad-panel,
.ai-assistant-panel,
.day-lock-panel {
  border-color: var(--premium-line);
  border-radius: var(--premium-radius);
  box-shadow: var(--premium-shadow-lg);
}

body:has(.order-submit-bar) .ai-assistant:not(.is-positioned) {
  bottom: 92px;
}

.operator-reminder-panel header,
.operator-reminder-panel footer,
.article-ad-head {
  background: #f8fafc;
}

/* Login and account recovery */
.login-page,
.password-page {
  font-family: var(--font-ui);
}

.login-page .login-shade {
  background: rgba(11, 18, 30, 0.46);
  backdrop-filter: blur(3px) saturate(0.92);
}

.login-brand {
  gap: 12px;
}

.login-brand-mark {
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(11, 18, 30, 0.2);
}

.login-brand-name {
  font-size: clamp(21px, 2.5vw, 30px);
  font-weight: 800;
}

.login-brand-company {
  margin-top: 4px;
  font-size: 9px;
  font-weight: 700;
}

.login-panel,
.password-panel {
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.97);
  box-shadow: 0 28px 80px rgba(11, 18, 30, 0.25);
  backdrop-filter: blur(16px);
}

.login-product-line {
  color: var(--premium-ink);
  font-weight: 800;
}

.login-panel-head h1 {
  color: var(--premium-ink);
  font-size: clamp(27px, 4vw, 34px);
  font-weight: 800;
}

.login-panel-head p,
.login-footer {
  color: var(--premium-muted);
}

.login-button {
  min-height: 50px;
  font-size: 11px;
}

.secure-chip {
  border-color: #b7dfce;
  color: #09613f;
  background: #effaf5;
}

/* Dark mode */
html[data-theme="dark"] {
  color-scheme: dark;
  --premium-canvas: #0d131b;
  --premium-canvas-deep: #090f16;
  --premium-surface: #151d27;
  --premium-surface-raised: #18222d;
  --premium-ink: #f2f4f7;
  --premium-ink-soft: #d0d5dd;
  --premium-muted: #98a2b3;
  --premium-faint: #7c8796;
  --premium-line: #2a3441;
  --premium-line-strong: #3a4655;
  --premium-sidebar: #111923;
  --premium-sidebar-ink: #d0d5dd;
  --premium-sidebar-muted: #8995a5;
  scrollbar-color: #536171 #111923;
}

html[data-theme="dark"] body.app-body {
  color: var(--premium-ink);
  background: var(--premium-canvas);
  background-image: none;
}

html[data-theme="dark"] .premium-navigation.sidebar,
html[data-theme="dark"] .premium-navigation .brand-block,
html[data-theme="dark"] .premium-navigation .sidebar-footer,
html[data-theme="dark"] .topbar,
html[data-theme="dark"] .premium-surface,
html[data-theme="dark"] .section-block,
html[data-theme="dark"] .form-surface,
html[data-theme="dark"] .detail-group,
html[data-theme="dark"] .quick-panel,
html[data-theme="dark"] .analytics-panel,
html[data-theme="dark"] .dashboard-command-bar,
html[data-theme="dark"] .filter-bar,
html[data-theme="dark"] .stat-card,
html[data-theme="dark"] .executive-stat,
html[data-theme="dark"] .metric-matrix > a,
html[data-theme="dark"] .metric-matrix-three > a,
html[data-theme="dark"] .month-control,
html[data-theme="dark"] .dashboard-controls {
  border-color: var(--premium-line);
  color: var(--premium-ink);
  background: var(--premium-surface);
  box-shadow: none;
}

html[data-theme="dark"] .premium-navigation .brand-mark,
html[data-theme="dark"] .login-brand-mark {
  border-color: var(--premium-line-strong);
  background: #ffffff;
}

html[data-theme="dark"] .premium-navigation .brand-name,
html[data-theme="dark"] .premium-navigation .user-copy strong,
html[data-theme="dark"] .topbar-company,
html[data-theme="dark"] .topbar-context strong,
html[data-theme="dark"] .page-heading h1,
html[data-theme="dark"] .dashboard-heading h1,
html[data-theme="dark"] .section-head h2,
html[data-theme="dark"] .analytics-title h2,
html[data-theme="dark"] .stat-card strong,
html[data-theme="dark"] .executive-stat strong,
html[data-theme="dark"] .detail-list dd {
  color: var(--premium-ink);
}

html[data-theme="dark"] .premium-navigation .nav-item {
  color: var(--premium-sidebar-ink);
}

html[data-theme="dark"] .premium-navigation .nav-item:hover,
html[data-theme="dark"] .nav-group-toggle:hover {
  border-color: var(--premium-line);
  color: #ffffff;
  background: #1b2632;
}

html[data-theme="dark"] .premium-navigation .nav-item.active {
  border-color: color-mix(in srgb, var(--role-accent) 34%, var(--premium-line));
  color: #ffffff;
  background: color-mix(in srgb, var(--role-accent) 18%, #151d27);
}

html[data-theme="dark"] .topbar .desktop-sidebar-toggle,
html[data-theme="dark"] .topbar .mobile-menu,
html[data-theme="dark"] .topbar .theme-switch,
html[data-theme="dark"] .secondary-button,
html[data-theme="dark"] .small-button {
  border-color: var(--premium-line-strong);
  color: var(--premium-ink-soft);
  background: #111923;
}

html[data-theme="dark"] .topbar .theme-option.active {
  color: #101820;
  background: #f2f4f7;
}

html[data-theme="dark"] .section-head,
html[data-theme="dark"] .operator-reminder-panel header,
html[data-theme="dark"] .operator-reminder-panel footer,
html[data-theme="dark"] .article-ad-head,
html[data-theme="dark"] .empty-cell,
html[data-theme="dark"] .settlement-fieldset,
html[data-theme="dark"] .cash-count-review div,
html[data-theme="dark"] .reconciliation-grid > div,
html[data-theme="dark"] .denomination-total-row,
html[data-theme="dark"] .visit-location-panel,
html[data-theme="dark"] .choice-list-panel {
  border-color: var(--premium-line);
  color: var(--premium-ink-soft);
  background: #111923;
}

html[data-theme="dark"] input:not([type="checkbox"]):not([type="radio"]),
html[data-theme="dark"] select,
html[data-theme="dark"] textarea,
html[data-theme="dark"] .search-box {
  border-color: var(--premium-line-strong);
  color: var(--premium-ink);
  background: #0e151e;
}

html[data-theme="dark"] table thead,
html[data-theme="dark"] table th {
  border-color: var(--premium-line-strong);
  color: #b7c0cc;
  background: #111923;
}

html[data-theme="dark"] table tbody tr,
html[data-theme="dark"] table td {
  border-color: var(--premium-line);
  color: var(--premium-ink-soft);
  background: var(--premium-surface);
}

html[data-theme="dark"] table tbody tr:hover,
html[data-theme="dark"] table tbody tr:hover td {
  background: #1b2632;
}

html[data-theme="dark"] .login-panel,
html[data-theme="dark"] .password-panel {
  border-color: #344050;
  color: var(--premium-ink);
  background: rgba(17, 25, 35, 0.97);
}

/* Responsive reflow */
@media (max-width: 1180px) {
  :root {
    --sidebar-width: 252px;
  }

  .content {
    padding-inline: 20px;
  }

  .topbar-context {
    display: none;
  }

  .topbar .day-chip {
    display: none;
  }
}

@media (max-width: 800px) {
  :root {
    --sidebar-width: min(302px, calc(100vw - 46px));
  }

  .premium-navigation.sidebar,
  .sidebar-collapsed .premium-navigation.sidebar {
    width: var(--sidebar-width);
    transform: translateX(-102%);
    transition: transform var(--motion-layout);
  }

  .premium-navigation.sidebar.open {
    transform: translateX(0);
    box-shadow: 24px 0 70px rgba(10, 18, 28, 0.24);
  }

  .sidebar-collapsed .premium-navigation .brand-block > div,
  .sidebar-collapsed .premium-navigation .nav-item > span,
  .sidebar-collapsed .premium-navigation .sidebar-footer .user-copy,
  .sidebar-collapsed .premium-navigation .sidebar-footer form {
    display: block;
  }

  .sidebar-collapsed .premium-navigation .nav-item {
    justify-content: flex-start;
    padding-inline: 11px;
  }

  .sidebar-collapsed .nav-group-toggle {
    display: flex;
  }

  .sidebar-collapsed .nav-group.is-collapsed .nav-group-items {
    max-height: 0;
    opacity: 0;
    pointer-events: none;
  }

  .app-shell,
  .sidebar-collapsed .app-shell {
    margin-left: 0;
  }

  .workspace-progress,
  .sidebar-collapsed .workspace-progress {
    left: 0;
  }

  .topbar {
    height: 62px;
    padding: 0 12px;
  }

  .workspace-progress {
    top: 61px;
  }

  .topbar .mobile-menu {
    display: grid;
  }

  .topbar-actions {
    gap: 5px;
  }

  .topbar .theme-option span,
  .topbar .live-badge,
  .topbar-role {
    display: none;
  }

  .topbar .theme-option {
    width: 30px;
    justify-content: center;
    padding: 5px;
  }

  .content {
    padding: 18px 14px 34px;
  }

  .page-heading,
  .dashboard-heading {
    min-height: 0;
    gap: 13px;
    margin-bottom: 17px;
  }

  .page-heading h1,
  .dashboard-heading h1 {
    font-size: 24px;
  }

  .stat-grid,
  .executive-stat-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stat-card,
  .executive-stat {
    min-height: 98px;
    padding: 14px;
  }

  .filter-bar {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .form-grid,
  .detail-layout,
  .detail-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-list .wide,
  .full-span {
    grid-column: auto;
  }

  .heading-actions,
  .form-actions {
    width: 100%;
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .content {
    padding: 15px 11px 30px;
  }

  .topbar-company {
    max-width: 118px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .page-heading,
  .dashboard-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .page-heading h1,
  .dashboard-heading h1 {
    font-size: 22px;
    overflow-wrap: anywhere;
  }

  .heading-actions > *,
  .heading-actions form,
  .form-actions > * {
    flex: 1 1 auto;
    justify-content: center;
  }

  .stat-grid,
  .executive-stat-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .stat-card,
  .executive-stat {
    min-height: 88px;
  }

  .stat-card strong,
  .executive-stat strong {
    font-size: 22px;
  }

  .form-surface {
    padding: 15px;
  }

  .premium-table,
  table {
    font-size: 10px;
  }

  .premium-table th,
  .premium-table td,
  table th,
  table td {
    padding: 10px 12px;
  }

  .login-brand {
    right: 18px;
    left: 18px;
  }

  .login-brand-name {
    font-size: 20px;
  }

  .login-theme-control {
    top: 88px;
    right: 18px;
  }
}

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