:root {
  --app-primary: #635bff;
  --app-primary-hover: #5147eb;
  --app-primary-soft: #eeedff;
  --app-cyan: #0ea5e9;
  --app-success: #16a36a;
  --app-success-soft: #e8f8f0;
  --app-warning: #f59e0b;
  --app-danger: #dc3545;
  --app-bg: #f5f7fb;
  --app-surface: #ffffff;
  --app-surface-muted: #f8fafc;
  --app-border: #e5e9f0;
  --app-text: #172033;
  --app-muted: #667085;
  --app-subtle: #98a2b3;
  --app-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 8px 24px rgba(16, 24, 40, .06);
  --app-shadow-lg: 0 24px 70px rgba(38, 31, 99, .16);
  --app-radius: 16px;
  --app-header-height: 76px;
  --app-sidebar-width: 248px;
  color-scheme: light;
}

[data-bs-theme="dark"] {
  --app-primary: #8b83ff;
  --app-primary-hover: #a39dff;
  --app-primary-soft: rgba(139, 131, 255, .14);
  --app-success: #45d99a;
  --app-success-soft: rgba(69, 217, 154, .12);
  --app-bg: #0c111d;
  --app-surface: #151b28;
  --app-surface-muted: #1a2231;
  --app-border: #273142;
  --app-text: #f1f5f9;
  --app-muted: #a9b4c5;
  --app-subtle: #77849a;
  --app-shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 12px 32px rgba(0, 0, 0, .2);
  --app-shadow-lg: 0 28px 80px rgba(0, 0, 0, .42);
  color-scheme: dark;
}

html {
  font-size: 15px;
  min-height: 100%;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--app-bg);
  color: var(--app-text);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: background-color .2s ease, color .2s ease;
}

a {
  color: var(--app-primary);
  text-decoration: none;
}

a:hover {
  color: var(--app-primary-hover);
}

button,
input {
  font: inherit;
}

svg {
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.eyebrow {
  display: inline-block;
  margin-bottom: .75rem;
  font-size: .75rem;
  font-weight: 750;
  letter-spacing: .09em;
  text-transform: uppercase;
}

.text-primary {
  color: var(--app-primary) !important;
}

.text-secondary,
.text-muted {
  color: var(--app-muted) !important;
}

.theme-toggle,
.icon-button,
.mobile-menu-button {
  position: relative;
  display: inline-grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background: var(--app-surface-muted);
  color: var(--app-muted);
  transition: border-color .18s ease, color .18s ease, background-color .18s ease, transform .18s ease;
}

.theme-toggle:hover,
.icon-button:hover,
.mobile-menu-button:hover {
  border-color: var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-text);
}

.theme-toggle svg,
.icon-button svg,
.mobile-menu-button svg {
  width: 20px;
  height: 20px;
}

.theme-icon-sun {
  display: none;
}

[data-bs-theme="dark"] .theme-icon-sun {
  display: block;
}

[data-bs-theme="dark"] .theme-icon-moon {
  display: none;
}

/* Authentication */
.auth-body {
  overflow-x: hidden;
  background: var(--app-surface);
}

.auth-shell,
.login-page {
  min-height: 100vh;
}

.auth-theme-toggle {
  position: fixed;
  top: 24px;
  right: 28px;
  z-index: 20;
  box-shadow: var(--app-shadow);
}

.login-page {
  display: grid;
  grid-template-columns: minmax(390px, 47%) 1fr;
}

.login-showcase {
  position: relative;
  display: flex;
  min-height: 100vh;
  overflow: hidden;
  padding: clamp(32px, 5vw, 68px);
  background:
    radial-gradient(circle at 18% 18%, rgba(103, 232, 249, .28), transparent 28%),
    linear-gradient(145deg, #312e81 0%, #635bff 48%, #7c3aed 100%);
  color: #fff;
  isolation: isolate;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  color: var(--app-text);
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -.035em;
}

.brand:hover {
  color: var(--app-text);
}

.brand-on-dark,
.brand-on-dark:hover {
  position: relative;
  z-index: 2;
  align-self: flex-start;
  color: #fff;
}

.brand-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 11px;
  background: var(--app-primary);
  color: #fff;
  font-size: 1rem;
  box-shadow: none;
}

.brand-on-dark .brand-mark {
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .25);
  box-shadow: none;
  backdrop-filter: blur(10px);
}

.showcase-copy {
  position: relative;
  z-index: 2;
  width: min(580px, 92%);
  margin: auto 0;
  padding: 80px 0 30px;
}

.showcase-copy .eyebrow {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  background: rgba(255, 255, 255, .1);
  color: rgba(255, 255, 255, .9);
  backdrop-filter: blur(8px);
}

.showcase-copy h1 {
  max-width: 560px;
  margin: 12px 0 22px;
  font-size: clamp(2.55rem, 4.2vw, 4.8rem);
  font-weight: 780;
  letter-spacing: -.055em;
  line-height: 1.02;
}

.showcase-copy > p {
  max-width: 510px;
  margin: 0;
  color: rgba(255, 255, 255, .74);
  font-size: clamp(1rem, 1.3vw, 1.18rem);
  line-height: 1.75;
}

.showcase-stats {
  display: flex;
  gap: 44px;
  margin-top: 48px;
}

.showcase-stats div {
  display: grid;
  gap: 4px;
}

.showcase-stats strong {
  font-size: 1.08rem;
}

.showcase-stats span {
  color: rgba(255, 255, 255, .65);
  font-size: .82rem;
}

.showcase-orbit {
  position: absolute;
  z-index: -1;
  border: 1px solid rgba(255, 255, 255, .14);
  border-radius: 50%;
}

.orbit-one {
  right: -220px;
  bottom: -230px;
  width: 620px;
  height: 620px;
}

.orbit-two {
  right: -80px;
  bottom: -90px;
  width: 340px;
  height: 340px;
}

.showcase-glow {
  position: absolute;
  right: 6%;
  bottom: 10%;
  width: 190px;
  height: 190px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .13);
  filter: blur(2px);
}

.login-form-panel {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 90px clamp(28px, 7vw, 110px) 52px;
  background: var(--app-surface);
}

.login-card {
  width: min(440px, 100%);
}

.mobile-brand {
  display: none;
  align-items: center;
  gap: 10px;
  margin-bottom: 46px;
  font-size: 1.15rem;
  font-weight: 800;
}

.login-heading h2 {
  margin: 0 0 12px;
  color: var(--app-text);
  font-size: clamp(2rem, 3vw, 2.65rem);
  font-weight: 760;
  letter-spacing: -.045em;
}

.login-heading p {
  margin: 0;
  color: var(--app-muted);
}

.auth-form {
  display: grid;
  gap: 20px;
  margin-top: 38px;
}

.form-field {
  display: grid;
  gap: 8px;
}

.form-field > label,
.form-label {
  color: var(--app-text);
  font-size: .86rem;
  font-weight: 680;
}

.input-shell {
  position: relative;
}

.input-shell > svg {
  position: absolute;
  top: 50%;
  left: 16px;
  z-index: 2;
  width: 19px;
  height: 19px;
  color: var(--app-subtle);
  transform: translateY(-50%);
  pointer-events: none;
}

.input-shell .form-control {
  min-height: 52px;
  padding: 12px 48px 12px 46px;
}

.form-control {
  border: 1px solid var(--app-border);
  border-radius: 12px;
  background-color: var(--app-surface-muted);
  color: var(--app-text);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.form-control::placeholder {
  color: var(--app-subtle);
}

.form-control:focus {
  border-color: color-mix(in srgb, var(--app-primary) 72%, white);
  background-color: var(--app-surface);
  color: var(--app-text);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-primary) 12%, transparent);
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 9px;
  background: transparent;
  color: var(--app-subtle);
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.password-toggle svg {
  width: 19px;
  height: 19px;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  font-size: .86rem;
}

.remember-option {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--app-muted);
  cursor: pointer;
}

.form-check-input {
  border-color: var(--app-border);
  background-color: var(--app-surface-muted);
}

.form-check-input:checked {
  border-color: var(--app-primary);
  background-color: var(--app-primary);
}

.login-submit,
.btn-primary {
  border-color: var(--app-primary);
  background: var(--app-primary);
  box-shadow: none;
}

.login-submit {
  display: flex;
  min-height: 52px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 12px;
  font-weight: 700;
}

.login-submit:hover,
.btn-primary:hover,
.btn-primary:focus {
  border-color: var(--app-primary-hover);
  background: var(--app-primary-hover);
}

.login-submit svg {
  width: 18px;
  height: 18px;
}

.login-help {
  margin: 30px 0 0;
  color: var(--app-muted);
  font-size: .84rem;
  text-align: center;
}

.validation-summary,
.field-validation,
.text-danger {
  color: #dc4c64 !important;
  font-size: .82rem;
}

.validation-summary:empty,
.field-validation:empty {
  display: none;
}

.validation-summary ul {
  margin: 0;
  padding: 12px 14px 12px 30px;
  border: 1px solid rgba(220, 76, 100, .22);
  border-radius: 10px;
  background: rgba(220, 76, 100, .08);
}

/* Application shell */
.app-body {
  overflow-x: hidden;
}

.app-shell {
  min-height: 100vh;
  padding-top: var(--app-header-height);
  padding-left: var(--app-sidebar-width);
  transition: padding-left .22s ease;
}

.app-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 1030;
  display: flex;
  height: var(--app-header-height);
  align-items: center;
  justify-content: space-between;
  padding: 0 28px;
  border-bottom: 1px solid var(--app-border);
  background: color-mix(in srgb, var(--app-surface) 92%, transparent);
  backdrop-filter: blur(16px);
}

.header-leading {
  display: flex;
  align-items: center;
  gap: 14px;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-dot {
  position: absolute;
  top: 9px;
  right: 9px;
  width: 7px;
  height: 7px;
  border: 2px solid var(--app-surface-muted);
  border-radius: 50%;
  background: #ef4444;
}

.notification-menu {
  position: relative;
  padding-bottom: 8px;
  margin-bottom: -8px;
}

.notification-count {
  position: absolute;
  top: -5px;
  right: -5px;
  display: grid;
  min-width: 19px;
  height: 19px;
  place-items: center;
  padding: 0 5px;
  border: 2px solid var(--app-surface);
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: .6rem;
  font-weight: 800;
  line-height: 1;
}

.notification-popover {
  position: absolute;
  top: calc(100% + 10px);
  right: -10px;
  z-index: 1060;
  width: min(390px, calc(100vw - 28px));
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-surface);
  box-shadow: 0 22px 60px rgba(15, 23, 42, .2);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-7px);
  transition: opacity .16s ease, visibility .16s ease, transform .16s ease;
}

.notification-popover::before {
  position: absolute;
  top: -6px;
  right: 24px;
  width: 11px;
  height: 11px;
  border-top: 1px solid var(--app-border);
  border-left: 1px solid var(--app-border);
  background: var(--app-surface);
  content: "";
  transform: rotate(45deg);
}

.notification-menu:hover .notification-popover,
.notification-menu:focus-within .notification-popover {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.notification-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 18px 19px 14px;
  border-bottom: 1px solid var(--app-border);
}

.notification-heading > div {
  display: grid;
  gap: 2px;
}

.notification-heading strong {
  font-size: .92rem;
}

.notification-heading span,
.notification-item small,
.notification-empty small {
  color: var(--app-muted);
  font-size: .68rem;
}

.live-indicator {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--app-success) !important;
  font-weight: 700;
}

.live-indicator i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
}

.notification-list {
  max-height: min(480px, calc(100vh - 130px));
  overflow-y: auto;
  padding: 7px;
}

.notification-item {
  display: flex;
  gap: 11px;
  padding: 12px;
  border-radius: 12px;
}

.notification-item + .notification-item {
  border-top: 1px solid var(--app-border);
  border-radius: 0;
}

.notification-item:hover {
  background: var(--app-surface-muted);
}

.notification-item-icon {
  display: grid;
  width: 36px;
  height: 36px;
  flex: 0 0 36px;
  place-items: center;
  border-radius: 10px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.notification-item-icon svg {
  width: 18px;
  height: 18px;
}

.notification-item > div {
  min-width: 0;
  flex: 1;
}

.notification-item strong {
  display: block;
  margin-bottom: 3px;
  font-size: .78rem;
}

.notification-item p {
  display: -webkit-box;
  overflow: hidden;
  margin: 0 0 4px;
  color: var(--app-muted);
  font-size: .72rem;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.notification-item form {
  margin-top: 8px;
}

.notification-item form button {
  padding: 6px 9px;
  border: 0;
  border-radius: 8px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: .68rem;
  font-weight: 750;
}

.notification-empty {
  display: grid;
  place-items: center;
  padding: 34px 20px;
  text-align: center;
}

.notification-empty > span {
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  margin-bottom: 10px;
  border-radius: 12px;
  background: var(--app-success-soft);
  color: var(--app-success);
}

.notification-empty svg {
  width: 21px;
  height: 21px;
}

.notification-empty strong {
  margin-bottom: 3px;
  font-size: .82rem;
}

.user-menu {
  display: flex;
  min-width: 190px;
  align-items: center;
  gap: 10px;
  padding: 5px 8px;
  border: 0;
  border-radius: 12px;
  background: transparent;
  color: var(--app-text);
  text-align: left;
}

.user-menu:hover {
  background: var(--app-surface-muted);
}

.user-avatar {
  display: grid;
  width: 38px;
  height: 38px;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 11px;
  background: var(--app-primary);
  color: #fff;
  font-weight: 750;
}

.user-copy {
  display: grid;
  min-width: 0;
  flex: 1;
}

.user-copy strong,
.user-copy small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.user-copy strong {
  font-size: .82rem;
}

.user-copy small {
  color: var(--app-muted);
  font-size: .7rem;
}

.user-menu > svg {
  width: 16px;
  height: 16px;
  color: var(--app-subtle);
}

.app-dropdown {
  min-width: 200px;
  padding: 8px;
  border-color: var(--app-border);
  border-radius: 12px;
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

.app-dropdown .dropdown-item {
  padding: 9px 11px;
  border-radius: 8px;
  color: var(--app-text);
  font-size: .85rem;
}

.app-dropdown .dropdown-item:hover {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.app-sidebar {
  position: fixed;
  top: var(--app-header-height);
  bottom: 0;
  left: 0;
  z-index: 1020;
  display: flex;
  width: var(--app-sidebar-width);
  flex-direction: column;
  justify-content: space-between;
  padding: 28px 18px 22px;
  border-right: 1px solid var(--app-border);
  background: var(--app-surface);
  transition: transform .22s ease;
}

.sidebar-nav {
  display: grid;
  gap: 5px;
}

.nav-label {
  margin: 18px 12px 8px;
  color: var(--app-subtle);
  font-size: .68rem;
  font-weight: 750;
  letter-spacing: .1em;
  text-transform: uppercase;
}

.nav-label:first-child {
  margin-top: 0;
}

.nav-link-app {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 12px;
  border-radius: 10px;
  color: var(--app-muted);
  font-size: .88rem;
  font-weight: 620;
  transition: background-color .18s ease, color .18s ease, transform .18s ease;
}

.nav-link-app svg {
  width: 20px;
  height: 20px;
}

.nav-link-app:hover,
.nav-link-app.active {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.nav-link-app:hover {
  transform: none;
}

.nav-tree {
  padding: 7px;
  border-radius: 11px;
}

.nav-tree.active {
  background: var(--app-surface-muted);
}

.nav-tree-title {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 5px 8px;
  color: var(--app-muted);
  font-size: .88rem;
  font-weight: 650;
}

.nav-tree-title svg {
  width: 20px;
  height: 20px;
}

.nav-tree-links {
  display: grid;
  gap: 2px;
  margin-left: 15px;
  padding-left: 16px;
  border-left: 1px solid var(--app-border);
}

.nav-tree-links a {
  padding: 7px 9px;
  border-radius: 8px;
  color: var(--app-subtle);
  font-size: .74rem;
  font-weight: 650;
}

.nav-tree-links a:hover,
.nav-tree-links a.active {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.sidebar-support {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px;
  border: 1px solid var(--app-border);
  border-radius: 13px;
  background: var(--app-surface-muted);
}

.support-icon {
  display: grid;
  width: 32px;
  height: 32px;
  flex: 0 0 32px;
  place-items: center;
  border-radius: 9px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 800;
}

.sidebar-support div {
  display: grid;
  gap: 2px;
}

.sidebar-support strong {
  font-size: .75rem;
}

.sidebar-support small {
  color: var(--app-muted);
  font-size: .64rem;
}

.sidebar-backdrop {
  display: none;
}

@media (min-width: 992px) {
  html.sidebar-is-hidden .app-shell {
    padding-left: 0;
  }

  html.sidebar-is-hidden .app-sidebar {
    transform: translateX(-100%);
  }
}

.app-content {
  min-height: calc(100vh - var(--app-header-height));
  padding: 34px clamp(22px, 3.2vw, 48px) 50px;
}

.app-alert {
  width: min(1460px, 100%);
  margin: 0 auto 18px;
}

/* Dashboard */
.dashboard-page {
  width: min(1460px, 100%);
  margin: 0 auto;
}

.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 28px;
}

.page-heading .eyebrow {
  margin-bottom: 7px;
}

.page-heading h1 {
  margin: 0 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.35rem);
  font-weight: 760;
  letter-spacing: -.04em;
}

.page-heading p,
.panel-heading p,
.welcome-panel p {
  margin: 0;
  color: var(--app-muted);
}

.date-chip,
.panel-action {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface);
  color: var(--app-muted);
  font-size: .8rem;
  font-weight: 600;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .03);
}

.date-chip svg {
  width: 17px;
  height: 17px;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
}

.metric-card,
.panel {
  border: 1px solid var(--app-border);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

.metric-card {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 15px;
  padding: 19px;
  border-radius: 15px;
  transition: border-color .2s ease, background-color .2s ease;
}

.metric-card:hover {
  border-color: var(--app-border);
  box-shadow: var(--app-shadow);
}

.metric-icon {
  display: grid;
  width: 46px;
  height: 46px;
  flex: 0 0 46px;
  place-items: center;
  border-radius: 13px;
}

.metric-icon svg {
  width: 22px;
  height: 22px;
}

.metric-icon.purple {
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.metric-icon.blue {
  background: rgba(14, 165, 233, .12);
  color: #0ea5e9;
}

.metric-icon.orange {
  background: rgba(245, 158, 11, .13);
  color: #f59e0b;
}

.metric-icon.green {
  background: var(--app-success-soft);
  color: var(--app-success);
}

.metric-content {
  display: grid;
  min-width: 0;
  gap: 2px;
}

.metric-content > span,
.metric-content small {
  overflow: hidden;
  color: var(--app-muted);
  font-size: .72rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-content strong {
  overflow: hidden;
  color: var(--app-text);
  font-size: 1.05rem;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.metric-content .positive {
  color: var(--app-success);
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.75fr) minmax(300px, .8fr);
  gap: 18px;
  margin-top: 18px;
}

.panel {
  border-radius: var(--app-radius);
}

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  padding: 22px 24px 0;
}

.panel-heading h2,
.welcome-panel h2 {
  margin: 0 0 5px;
  color: var(--app-text);
  font-size: .98rem;
  font-weight: 720;
}

.panel-heading p,
.welcome-panel p {
  font-size: .75rem;
}

.panel-action {
  cursor: default;
  box-shadow: none;
}

.bar-chart {
  position: relative;
  display: flex;
  height: 280px;
  align-items: flex-end;
  justify-content: space-around;
  gap: 18px;
  padding: 38px 30px 27px;
}

.chart-lines {
  position: absolute;
  inset: 28px 28px 48px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.chart-lines span {
  width: 100%;
  border-top: 1px dashed var(--app-border);
}

.bar-item {
  z-index: 1;
  display: flex;
  height: 100%;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
}

.bar-item i {
  width: min(26px, 60%);
  height: var(--bar-height);
  border-radius: 7px 7px 3px 3px;
  background: color-mix(in srgb, var(--app-primary) 35%, var(--app-primary-soft));
  transition: height .5s ease, background-color .2s ease;
}

.bar-item:nth-of-type(even) i {
  background: color-mix(in srgb, var(--app-primary) 55%, var(--app-primary-soft));
}

.bar-item.active i {
  background: linear-gradient(180deg, #8b83ff, var(--app-primary));
  box-shadow: none;
}

.bar-item span {
  color: var(--app-subtle);
  font-size: .68rem;
  font-style: normal;
}

.quick-links {
  display: grid;
  gap: 5px;
  padding: 15px;
}

.quick-links a {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 12px;
  color: var(--app-text);
  transition: background-color .18s ease, transform .18s ease;
}

.quick-links a:hover {
  background: var(--app-surface-muted);
  color: var(--app-text);
  transform: none;
}

.quick-icon {
  display: grid;
  width: 39px;
  height: 39px;
  flex: 0 0 39px;
  place-items: center;
  border-radius: 11px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
}

.quick-icon svg {
  width: 19px;
  height: 19px;
}

.quick-links a > span:nth-child(2) {
  display: grid;
  min-width: 0;
  flex: 1;
  gap: 2px;
}

.quick-links strong,
.quick-links small {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.quick-links strong {
  font-size: .8rem;
}

.quick-links small {
  color: var(--app-muted);
  font-size: .68rem;
}

.quick-arrow {
  width: 17px;
  height: 17px;
  color: var(--app-subtle);
}

.welcome-panel {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 18px;
  padding: 19px 22px;
}

.welcome-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--app-success-soft);
  color: var(--app-success);
}

.welcome-icon svg {
  width: 21px;
  height: 21px;
}

.welcome-panel > div:nth-child(2) {
  min-width: 0;
  flex: 1;
}

.system-badge {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--app-success-soft);
  color: var(--app-success);
  font-size: .7rem;
  font-weight: 680;
  white-space: nowrap;
}

.system-badge i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: currentColor;
  box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 16%, transparent);
}

/* User catalog */
.catalog-page,
.form-page {
  width: min(1460px, 100%);
  margin: 0 auto;
}

.catalog-heading {
  align-items: center;
}

.catalog-create {
  display: inline-flex;
  min-height: 43px;
  align-items: center;
  gap: 8px;
  padding: 9px 15px;
  border-radius: 11px;
  font-size: .82rem;
  font-weight: 700;
}

.catalog-create svg {
  width: 18px;
  height: 18px;
}

.catalog-panel,
.entity-form {
  border: 1px solid var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  box-shadow: var(--app-shadow);
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 16px 19px;
  border-bottom: 1px solid var(--app-border);
}

.catalog-search {
  position: relative;
  width: min(360px, 100%);
}

.catalog-search svg {
  position: absolute;
  top: 50%;
  left: 13px;
  width: 17px;
  height: 17px;
  color: var(--app-subtle);
  transform: translateY(-50%);
}

.catalog-search input {
  width: 100%;
  min-height: 40px;
  padding: 8px 12px 8px 39px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  outline: 0;
  background: var(--app-surface-muted);
  color: var(--app-text);
  font-size: .8rem;
}

.catalog-search input:focus {
  border-color: var(--app-primary);
  box-shadow: 0 0 0 2px color-mix(in srgb, var(--app-primary) 10%, transparent);
}

.catalog-count {
  color: var(--app-muted);
  font-size: .75rem;
  white-space: nowrap;
}

.catalog-table {
  width: 100%;
  border-collapse: collapse;
}

.catalog-table th,
.catalog-table td {
  padding: 14px 18px;
  border-bottom: 1px solid var(--app-border);
  vertical-align: middle;
}

.catalog-table th {
  background: var(--app-surface-muted);
  color: var(--app-subtle);
  font-size: .66rem;
  font-weight: 760;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.catalog-table td {
  color: var(--app-muted);
  font-size: .78rem;
}

.catalog-table tbody tr:last-child td {
  border-bottom: 0;
}

.catalog-table tbody tr:hover td {
  background: var(--app-surface-muted);
}

.table-user {
  display: flex;
  min-width: 210px;
  align-items: center;
  gap: 11px;
}

.table-user > span {
  display: grid;
  width: 37px;
  height: 37px;
  flex: 0 0 37px;
  place-items: center;
  border-radius: 10px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-weight: 750;
}

.table-user > div {
  display: grid;
  gap: 2px;
}

.table-user strong {
  color: var(--app-text);
  font-size: .8rem;
}

.table-user small {
  color: var(--app-subtle);
  font-size: .68rem;
}

.role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}

.role-list span {
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--app-primary-soft);
  color: var(--app-primary);
  font-size: .6rem;
  font-weight: 750;
}

.state-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: .66rem;
  font-weight: 700;
}

.state-badge i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
}

.state-badge.active {
  background: var(--app-success-soft);
  color: var(--app-success);
}

.state-badge.inactive {
  background: rgba(239, 68, 68, .1);
  color: #ef4444;
}

.table-action {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  color: var(--app-muted);
}

.table-action:hover {
  border-color: var(--app-border);
  background: var(--app-surface-muted);
  color: var(--app-text);
}

.table-action svg {
  width: 16px;
  height: 16px;
}

.empty-state {
  display: grid;
  place-items: center;
  padding: 48px 20px;
  color: var(--app-muted);
  text-align: center;
}

.empty-state strong {
  margin-bottom: 4px;
  color: var(--app-text);
}

.empty-state span {
  font-size: .78rem;
}

/* Entity forms */
.catalog-modal .modal-content {
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: 0 18px 45px rgba(15, 23, 42, .14);
}

.catalog-modal .modal-header {
  align-items: flex-start;
  padding: 22px 24px 18px;
  border-bottom-color: var(--app-border);
}

.modal-kicker {
  display: block;
  margin-bottom: 5px;
  color: var(--app-muted);
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .04em;
}

.catalog-modal .modal-title {
  margin: 0 0 4px;
  font-size: 1.2rem;
  font-weight: 700;
}

.catalog-modal .modal-header p {
  margin: 0;
  color: var(--app-muted);
  font-size: .74rem;
}

.catalog-modal .btn-close {
  margin-top: 0;
}

.catalog-modal .modal-body {
  padding: 0;
}

.modal-entity-form {
  display: flex;
  width: 100%;
  max-height: calc(100vh - 48px);
  flex-direction: column;
}

.modal-loading,
.modal-error {
  display: flex;
  min-height: 190px;
  align-items: center;
  justify-content: center;
  gap: 10px;
  color: var(--app-muted);
}

.modal-error {
  flex-direction: column;
}

.user-form-body {
  overflow-y: auto;
  padding: 0 24px 8px !important;
}

.user-form-body > .validation-summary:not(:empty) {
  margin-top: 20px;
}

.user-form-section {
  padding: 22px 0;
  border-bottom: 1px solid var(--app-border);
}

.user-form-heading {
  margin-bottom: 15px;
}

.user-form-heading h3 {
  margin: 0 0 3px;
  font-size: .84rem;
  font-weight: 700;
}

.user-form-heading p {
  margin: 0;
  color: var(--app-muted);
  font-size: .7rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 15px 16px;
}

.form-grid-full {
  grid-column: 1 / -1;
}

.modal-entity-form .form-control {
  min-height: 43px;
  padding: 9px 11px;
  border-radius: 9px;
  background: var(--app-surface);
  font-size: .82rem;
}

.form-hint {
  color: var(--app-muted);
  font-size: .66rem;
}

.role-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.role-options label,
.account-status-option {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  background: var(--app-surface-muted);
  cursor: pointer;
}

.role-options label:has(input:checked),
.account-status-option:has(input:checked) {
  border-color: color-mix(in srgb, var(--app-primary) 35%, var(--app-border));
  background: color-mix(in srgb, var(--app-primary-soft) 45%, var(--app-surface));
}

.role-options input,
.account-status-option input {
  margin-top: 3px;
}

.role-options label > span,
.account-status-option > span {
  display: grid;
  gap: 2px;
}

.role-options strong,
.account-status-option strong {
  font-size: .74rem;
}

.role-options small,
.account-status-option small {
  color: var(--app-muted);
  font-size: .66rem;
}

.account-status-option {
  margin-top: 0;
}

.form-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 15px 24px;
  border-top: 1px solid var(--app-border);
  background: var(--app-surface-muted);
}

.form-actions .btn {
  min-width: 120px;
  padding: 9px 15px;
  border-radius: 9px;
  font-size: .78rem;
  font-weight: 680;
}

.form-actions .btn-light {
  border-color: var(--app-border);
  background: var(--app-surface);
  color: var(--app-text);
}

/* Existing content pages */
.app-content .card,
.app-content .list-group-item {
  border-color: var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: var(--app-shadow);
}

.auth-shell > .container .card {
  border-color: var(--app-border);
  border-radius: var(--app-radius);
  background: var(--app-surface);
  color: var(--app-text);
  box-shadow: var(--app-shadow-lg) !important;
}

.alert {
  border-radius: 12px;
}

/* Slots */
.slot-page {
  display: grid;
  gap: 20px;
}

.slot-page .catalog-heading {
  margin-bottom: 0;
}

.slot-import-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 20px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-surface);
}

.slot-import-copy,
.slot-import-form {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slot-import-copy > div {
  display: grid;
  gap: 3px;
}

.slot-import-copy strong {
  font-size: .9rem;
}

.slot-import-copy span,
.slot-file span {
  color: var(--app-muted);
  font-size: .76rem;
}

.slot-import-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 12px;
  background: var(--app-primary-soft);
  color: var(--app-primary) !important;
}

.slot-import-icon svg,
.slot-file svg,
.slot-import-form .btn svg {
  width: 19px;
  height: 19px;
}

.slot-file {
  display: flex;
  min-width: 220px;
  height: 42px;
  align-items: center;
  gap: 9px;
  padding: 0 13px;
  overflow: hidden;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
  color: var(--app-muted);
  cursor: pointer;
}

.slot-file input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.slot-file span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.slot-import-form .btn {
  display: inline-flex;
  height: 42px;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.slot-period-field,
.slot-range-form label {
  display: grid;
  gap: 4px;
}

.slot-period-field span,
.slot-range-form span {
  color: var(--app-muted);
  font-size: .62rem;
  font-weight: 700;
}

.slot-period-field input,
.slot-range-form input {
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--app-border);
  border-radius: 10px;
  background: var(--app-surface-muted);
  color: var(--app-text);
  font-size: .7rem;
  outline: none;
}

.slot-period-field input:focus,
.slot-range-form input:focus {
  border-color: color-mix(in srgb, var(--app-primary) 50%, var(--app-border));
}

.slot-range-form {
  display: flex;
  align-items: end;
  gap: 8px;
  margin-left: auto;
}

.slot-range-form input {
  height: 36px;
}

.slot-range-form .btn {
  height: 36px;
  font-size: .7rem;
}

.slot-summary {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.slot-summary article {
  display: grid;
  gap: 6px;
  padding: 17px 18px;
  border: 1px solid var(--app-border);
  border-radius: 14px;
  background: var(--app-surface);
}

.slot-summary span {
  color: var(--app-muted);
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
}

.slot-summary strong {
  overflow: hidden;
  font-size: 1.15rem;
  letter-spacing: -.025em;
  text-overflow: ellipsis;
}

.slot-table {
  min-width: 1390px;
}

.dashboard-v2 .metric-card { color: inherit; text-decoration: none; }
.dashboard-v2 .panel-heading > a { color: var(--app-primary); font-size: .7rem; font-weight: 700; white-space: nowrap; }
.admin-dashboard-grid { grid-template-columns: minmax(0, 1.45fr) minmax(340px, .8fr); }
.dashboard-real-chart { display: flex; height: 290px; align-items: flex-end; gap: 13px; padding: 34px 25px 22px; }
.dashboard-real-bar { display: grid; height: 100%; min-width: 0; flex: 1; grid-template-rows: 30px 1fr 22px; align-items: end; justify-items: center; }
.dashboard-real-bar > span { max-width: 100%; overflow: hidden; color: var(--app-muted); font-size: .62rem; font-weight: 650; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-real-bar i { width: min(34px, 68%); height: var(--bar-height); min-height: 16px; border-radius: 7px 7px 3px 3px; background: color-mix(in srgb, var(--app-success) 72%, var(--app-surface)); }
.dashboard-real-bar.negative i { background: color-mix(in srgb, #ef4444 72%, var(--app-surface)); }
.dashboard-real-bar small { color: var(--app-muted); font-size: .62rem; }
.dashboard-list { display: grid; gap: 1px; padding: 14px; }
.dashboard-list-row { display: grid; grid-template-columns: 8px minmax(0, 1fr) auto; align-items: center; gap: 11px; padding: 13px 10px; border-radius: 10px; color: var(--app-text); text-decoration: none; }
.dashboard-list-row:hover { background: var(--app-surface-muted); color: var(--app-text); }
.dashboard-list-row > i { width: 7px; height: 28px; border-radius: 999px; background: var(--item-color, var(--app-primary)); }
.dashboard-list-row > div { display: grid; min-width: 0; gap: 3px; }
.dashboard-list-row strong, .dashboard-list-row span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dashboard-list-row strong { font-size: .74rem; }
.dashboard-list-row span, .dashboard-list-row > small { color: var(--app-muted); font-size: .65rem; }
.dashboard-empty { display: grid; min-height: 240px; place-content: center; gap: 5px; padding: 24px; color: var(--app-muted); text-align: center; }
.dashboard-empty strong { color: var(--app-text); font-size: .8rem; }
.dashboard-empty span { font-size: .7rem; }
.dashboard-empty.compact { min-height: 110px; }
.dashboard-payments-panel { margin-top: 18px; }
.dashboard-payment-grid { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 9px; padding: 16px; }
.dashboard-payment-grid > a { display: grid; gap: 11px; padding: 15px; border: 1px solid var(--app-border); border-radius: 11px; background: var(--app-surface-muted); color: var(--app-text); text-decoration: none; }
.dashboard-payment-grid > a:hover { border-color: color-mix(in srgb, var(--app-primary) 25%, var(--app-border)); color: var(--app-text); }
.dashboard-payment-grid a > div { display: grid; gap: 2px; }
.dashboard-payment-grid span, .dashboard-payment-grid time { color: var(--app-muted); font-size: .62rem; }
.dashboard-payment-grid strong { overflow: hidden; font-size: .72rem; text-overflow: ellipsis; white-space: nowrap; }
.technician-shift-hero { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; align-items: center; gap: 18px; padding: 24px; }
.technician-shift-icon { display: grid; width: 52px; height: 52px; place-items: center; border-radius: 14px; background: var(--app-primary-soft); color: var(--app-primary); }
.technician-shift-icon svg { width: 25px; height: 25px; }
.technician-shift-copy { display: grid; gap: 3px; }
.technician-shift-copy > span { color: var(--app-muted); font-size: .66rem; font-weight: 700; text-transform: uppercase; }
.technician-shift-copy h2 { margin: 0; font-size: 1.2rem; }
.technician-shift-copy p { margin: 0; color: var(--app-muted); font-size: .74rem; }
.technician-metric-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 18px; margin-top: 18px; }
.technician-metric-grid article { display: grid; gap: 4px; padding: 18px 20px; border: 1px solid var(--app-border); border-radius: 14px; background: var(--app-surface); box-shadow: var(--app-shadow); }
.technician-metric-grid span, .technician-metric-grid small { color: var(--app-muted); font-size: .68rem; }
.technician-metric-grid strong { font-size: 1.15rem; }
.technician-dashboard-grid { grid-template-columns: minmax(0, 1.45fr) minmax(300px, .7fr); }

.technician-schedule-action {
  display: inline-flex;
  min-height: 36px;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border: 1px solid var(--app-border);
  border-radius: 9px;
  background: var(--app-surface-muted);
  color: var(--app-muted);
  font-size: .7rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.technician-schedule-action svg {
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.8;
}

.technician-schedule-action:hover {
  border-color: color-mix(in srgb, var(--app-primary) 28%, var(--app-border));
  background: var(--app-surface);
  color: var(--app-text);
}

.machine-table { min-width: 1120px; }

.status-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--status-color) 22%, var(--app-border));
  border-radius: 999px;
  background: color-mix(in srgb, var(--status-color) 8%, var(--app-surface));
  color: var(--app-text);
  font-size: .72rem;
  font-weight: 650;
  white-space: nowrap;
}

.status-chip i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--status-color);
}

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

.machine-form-grid .form-field {
  display: grid;
  gap: 7px;
}

.machine-form-grid .form-field > span {
  color: var(--app-muted);
  font-size: .72rem;
  font-weight: 700;
}

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

.slot-file-actions,
.slot-record-header,
.slot-record-grid {
  display: flex;
  gap: 12px;
}

.slot-record-header {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-bottom: 18px;
  padding: 18px;
  border: 1px solid var(--app-border);
  border-radius: 16px;
  background: var(--app-surface);
}

.slot-record-header > div { display: grid; gap: 7px; }
.slot-record-header > div > span { color: var(--app-muted); font-size: .7rem; }
.slot-record-totals { margin-bottom: 18px; }
.slot-record-grid { align-items: flex-start; margin-bottom: 18px; }
.slot-record-grid > :first-child { flex: 2; }
.slot-record-grid > :last-child { flex: 1; }
.slot-record-grid .catalog-card { width: 100%; }
.slot-document-form { display: grid; grid-template-columns: 1fr 1fr 1fr 1.5fr auto; gap: 9px; padding: 16px; }
.slot-document-list { display: grid; padding: 0 16px 16px; }
.slot-document-item { display: flex; align-items: center; gap: 10px; border-top: 1px solid var(--app-border); }
.slot-document-open { display: grid; min-width: 0; flex: 1; grid-template-columns: 46px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 12px 0; border: 0; background: transparent; color: var(--app-text); text-align: left; }
.slot-document-icon { display: grid; width: 42px; height: 42px; place-items: center; border-radius: 10px; background: var(--app-primary-soft); color: var(--app-primary); font-size: .61rem; font-weight: 800; }
.slot-document-name,
.slot-document-meta { display: grid; min-width: 0; gap: 3px; }
.slot-document-name strong,
.slot-document-name small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.slot-document-meta { text-align: right; }
.slot-document-actions { display: flex; align-items: center; gap: 5px; }
.slot-document-actions button,
.slot-document-actions a { border: 0; border-radius: 7px; background: var(--app-surface-muted); color: var(--app-muted); padding: 7px 9px; font-size: .66rem; font-weight: 700; text-decoration: none; }
.slot-document-actions button:hover,
.slot-document-actions a:hover { background: var(--app-primary-soft); color: var(--app-primary); }
.slot-document-list small { color: var(--app-muted); font-size: .68rem; }
.slot-document-preview-dialog { height: calc(100vh - 42px); }
.slot-document-preview-modal { height: 100%; overflow: hidden; border: 1px solid var(--app-border); border-radius: 16px; background: var(--app-surface); color: var(--app-text); }
.slot-document-preview-modal .modal-header,
.slot-document-preview-modal .modal-footer { border-color: var(--app-border); }
.slot-document-preview-modal .modal-header > div { display: grid; gap: 2px; }
.slot-document-preview-modal .modal-header span { color: var(--app-primary); font-size: .62rem; font-weight: 750; text-transform: uppercase; }
.slot-document-preview-modal .modal-title { font-size: .95rem; }
.slot-document-zoom { display: flex; align-items: center; gap: 8px; padding: 8px 16px; border-bottom: 1px solid var(--app-border); background: var(--app-surface); }
.slot-document-zoom input { min-width: 140px; flex: 1; accent-color: var(--app-primary); }
.slot-document-zoom button { min-width: 30px; height: 30px; border: 1px solid var(--app-border); border-radius: 7px; background: var(--app-surface-muted); color: var(--app-text); font-size: .72rem; font-weight: 700; }
.slot-document-zoom button:last-child { padding: 0 10px; }
.slot-document-zoom strong { min-width: 42px; color: var(--app-muted); font-size: .68rem; text-align: center; }
.slot-document-preview-modal .modal-body { display: block; min-height: 0; padding: 0; overflow: auto; background: var(--app-surface-muted); }
.slot-document-image-stage { display: grid; min-width: 100%; min-height: 100%; padding: 16px; place-items: center; }
.slot-document-preview-modal img { display: block; max-width: none; max-height: none; object-fit: contain; user-select: none; }
.slot-document-preview-modal iframe { width: 100%; height: 100%; border: 0; background: #fff; }
.slot-document-unavailable { display: grid; max-width: 440px; gap: 6px; padding: 28px; text-align: center; }
.slot-document-unavailable span { color: var(--app-muted); font-size: .75rem; }
.slot-record-notes p { margin: 0; padding: 18px; color: var(--app-muted); white-space: pre-wrap; }
.import-guidance { padding: 20px; }
.import-guidance > strong { display: block; margin-bottom: 15px; }

.slot-casino {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 8px;
  background: var(--app-surface-muted);
  color: var(--app-muted);
  font-size: .7rem;
  font-weight: 700;
}

@media (max-width: 1180px) {
  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .slot-import-panel {
    align-items: stretch;
    flex-direction: column;
  }

  .slot-summary {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dashboard-payment-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 991.98px) {
  :root {
    --app-header-height: 68px;
  }

  .login-page {
    grid-template-columns: 1fr;
  }

  .login-showcase {
    display: none;
  }

  .login-form-panel {
    padding: 88px 26px 46px;
  }

  .mobile-brand {
    display: flex;
  }

  .app-shell {
    padding-left: 0;
  }

  .app-header {
    padding: 0 18px;
  }

  .app-header .brand {
    margin-right: auto;
  }

  .app-sidebar {
    box-shadow: 16px 0 42px rgba(0, 0, 0, .16);
    transform: translateX(-105%);
    transition: transform .22s ease;
  }

  .app-sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-backdrop {
    position: fixed;
    inset: var(--app-header-height) 0 0;
    z-index: 1010;
    width: 100%;
    border: 0;
    background: rgba(15, 23, 42, .48);
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
  }

  .sidebar-backdrop.is-open {
    display: block;
    opacity: 1;
    pointer-events: auto;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-payment-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 767.98px) {
  .auth-theme-toggle {
    top: 16px;
    right: 16px;
  }

  .header-actions {
    gap: 6px;
  }

  .slot-import-form {
    align-items: stretch;
    flex-direction: column;
  }

  .slot-range-form {
    width: 100%;
    align-items: stretch;
    flex-direction: column;
    margin-left: 0;
  }

  .slot-file {
    width: 100%;
  }

  .slot-import-form .btn {
    justify-content: center;
  }

  .slot-summary {
    grid-template-columns: 1fr;
  }

  .header-actions .user-copy,
  .user-menu > svg {
    display: none;
  }

  .user-menu {
    min-width: 0;
    padding: 2px;
  }

  .app-content {
    padding: 26px 16px 38px;
  }

  .page-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .technician-shift-hero {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .technician-shift-hero > :last-child {
    grid-column: 1 / -1;
    justify-self: stretch;
    text-align: center;
  }

  .technician-metric-grid,
  .dashboard-payment-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-real-chart {
    min-width: 620px;
  }

  .dashboard-trend-panel {
    overflow-x: auto;
  }

  .panel-heading {
    padding: 19px 18px 0;
  }

  .bar-chart {
    height: 245px;
    gap: 8px;
    padding-right: 16px;
    padding-left: 16px;
  }

  .welcome-panel {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .system-badge {
    margin-left: 56px;
  }

  .notification-popover {
    position: fixed;
    top: calc(var(--app-header-height) - 2px);
    right: 12px;
  }

  .catalog-heading {
    align-items: stretch;
  }

  .catalog-create {
    justify-content: center;
  }

  .catalog-toolbar {
    align-items: stretch;
    flex-direction: column;
    gap: 10px;
  }

  .catalog-search {
    width: 100%;
  }

  .form-grid,
  .role-options,
  .machine-form-grid {
    grid-template-columns: 1fr;
  }

  .slot-record-header { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .slot-record-grid { flex-direction: column; }
  .slot-document-form { grid-template-columns: 1fr; }
  .slot-document-item { align-items: stretch; flex-direction: column; padding: 10px 0; }
  .slot-document-open { width: 100%; grid-template-columns: 42px minmax(0, 1fr); padding: 0; }
  .slot-document-meta { grid-column: 2; text-align: left; }
  .slot-document-actions { justify-content: flex-end; }

  .form-actions {
    padding: 16px 18px;
  }

  .catalog-modal .modal-dialog {
    margin: 10px;
  }

  .user-form-body {
    padding-right: 18px !important;
    padding-left: 18px !important;
  }
}

@media (max-width: 420px) {
  .app-header {
    padding: 0 12px;
  }

  .app-header .brand span:last-child {
    display: none;
  }

  .form-options {
    align-items: flex-start;
    flex-direction: column;
    gap: 10px;
  }

  .showcase-stats {
    gap: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}
