@font-face {
  font-family: "Vazirmatn";
  src: url("../fonts/vazirmatn/Vazirmatn-Regular.woff2") format("woff2");
  font-weight: 100 900;
  font-style: normal;
  font-display: swap;
}

/* Premium dark dashboard refresh */
.kouch-app-screen {
  background:
    radial-gradient(circle at 18% 0%, rgba(154, 203, 40, 0.08), transparent 28rem),
    var(--kouch-bg);
}

.kouch-app {
  grid-template-columns: var(--kouch-sidebar) minmax(0, 1fr);
}

.kouch-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-left: 1px solid var(--kouch-border);
  background: var(--kouch-sidebar-bg);
  padding: 18px 14px;
}

.kouch-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 14px;
  border-bottom: 1px solid rgba(215, 166, 58, 0.18);
}

.kouch-sidebar__brand strong {
  display: block;
  color: var(--kouch-gold);
  font-size: 18px;
  line-height: 1.2;
}

.kouch-sidebar__brand small,
.kouch-sidebar__user small,
.kouch-data-list small,
.kouch-card__head p,
.kouch-kpi small {
  display: block;
  color: var(--kouch-text-muted);
  font-size: 12px;
  font-weight: 500;
}

.kouch-user-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(215, 166, 58, 0.36);
  border-radius: 12px;
  background: rgba(215, 166, 58, 0.1);
  color: var(--kouch-gold);
  font-weight: 900;
}

.kouch-nav {
  gap: 4px;
  margin-top: 0;
  padding-left: 2px;
}

.kouch-nav__group {
  margin: 14px 8px 5px;
  color: #747b83;
  font-size: 11px;
  letter-spacing: 0;
}

.kouch-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #cbd0d5;
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 750;
}

.kouch-nav a:hover {
  border-color: var(--kouch-border);
  background: var(--kouch-surface-hover);
}

.kouch-nav a.is-active {
  border-color: rgba(154, 203, 40, 0.42);
  background: rgba(154, 203, 40, 0.14);
  color: var(--kouch-text);
}

.kouch-nav__icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--kouch-lime);
  font-size: 13px;
  line-height: 1;
}

.kouch-sidebar__user {
  display: grid;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--kouch-border);
  padding-top: 12px;
}

.kouch-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.kouch-user-chip strong {
  display: block;
  max-width: 180px;
  overflow: hidden;
  color: var(--kouch-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kouch-sidebar__logout {
  display: inline-flex;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--kouch-border);
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--kouch-surface);
  color: var(--kouch-text-muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.kouch-sidebar__logout:hover {
  color: var(--kouch-text);
  background: var(--kouch-surface-hover);
}

.kouch-topbar {
  min-height: 62px;
  border-bottom: 1px solid var(--kouch-border);
  background: rgba(9, 11, 13, 0.94);
  backdrop-filter: blur(10px);
  padding: 0 22px;
}

.kouch-topbar__title strong {
  color: var(--kouch-text);
  font-size: 17px;
}

.kouch-global-search {
  max-width: 460px;
}

.kouch-global-search input,
.kouch-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.kouch-form select,
.kouch-form textarea,
.kouch-toolbar input,
.kouch-toolbar select {
  border-color: var(--kouch-border);
  background: #101214;
  color: var(--kouch-text);
}

.kouch-global-search input:focus,
.kouch-form input:focus,
.kouch-form select:focus,
.kouch-form textarea:focus,
.kouch-toolbar input:focus,
.kouch-toolbar select:focus,
.kouch-button:focus,
.kouch-icon-button:focus,
.kouch-nav a:focus {
  outline: 3px solid rgba(154, 203, 40, 0.22);
}

.kouch-button {
  border-radius: 10px;
}

.kouch-button--primary {
  background: var(--kouch-blue);
}

.kouch-button--ghost {
  border-color: var(--kouch-border);
  background: var(--kouch-surface-elevated);
  color: var(--kouch-text);
}

.kouch-button--danger {
  background: #ef4444;
}

.kouch-content {
  gap: 18px;
  padding: 22px;
}

.kouch-card,
.kouch-login__panel {
  border-color: var(--kouch-border);
  border-radius: 16px;
  background: var(--kouch-surface);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.kouch-card {
  padding: 16px;
}

.kouch-card h1,
.kouch-card h2 {
  margin-bottom: 12px;
  color: var(--kouch-text);
}

.kouch-dashboard {
  display: grid;
  gap: 18px;
}

.kouch-kpi-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.55fr) repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.kouch-kpi {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 116px;
  align-content: space-between;
}

.kouch-kpi__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.kouch-kpi:has(.kouch-kpi__link):hover {
  border-color: rgba(154, 203, 40, 0.38);
  background: var(--kouch-surface-elevated);
}

.kouch-kpi span {
  color: var(--kouch-text-muted);
  font-size: 13px;
  font-weight: 800;
}

.kouch-kpi strong {
  color: var(--kouch-text);
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.15;
}

.kouch-kpi--hero {
  grid-row: span 2;
  min-height: 244px;
  border-color: rgba(154, 203, 40, 0.46);
  background:
    linear-gradient(145deg, rgba(154, 203, 40, 0.22), rgba(79, 111, 12, 0.1) 48%, var(--kouch-surface-elevated)),
    var(--kouch-surface-elevated);
}

.kouch-kpi--hero strong {
  color: #f8ffe8;
  font-size: clamp(34px, 4.6vw, 56px);
}

.kouch-dashboard-grid {
  display: grid;
  gap: 16px;
}

.kouch-dashboard-grid--charts {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
}

.kouch-dashboard-grid--panels {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kouch-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.kouch-card__head h1,
.kouch-card__head h2,
.kouch-card__head p {
  margin: 0;
}

.kouch-chart-card {
  min-width: 0;
}

.kouch-chart {
  min-height: 260px;
  border-radius: 14px;
  background:
    linear-gradient(to top, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 100% 25%,
    #121416;
  padding: 16px 12px 10px;
}

.kouch-chart--thirty {
  grid-template-columns: repeat(30, minmax(13px, 1fr));
  gap: 5px;
  overflow-x: auto;
}

.kouch-chart__day {
  min-width: 16px;
}

.kouch-chart__bars {
  height: 188px;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.kouch-chart__bars span {
  width: 8px;
  border-radius: 999px 999px 4px 4px;
}

.kouch-chart__bars .entry,
.kouch-chart-legend .entry {
  background: var(--kouch-lime);
}

.kouch-chart__bars .exit,
.kouch-chart-legend .exit {
  background: var(--kouch-gold);
}

.kouch-chart__day small {
  color: #7f8790;
  font-size: 10px;
  writing-mode: vertical-rl;
}

.kouch-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  color: var(--kouch-text-muted);
  font-size: 12px;
  font-weight: 800;
}

.kouch-chart-legend span,
.kouch-data-list--compact span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.kouch-chart-legend i,
.kouch-data-list--compact i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.kouch-chart-fallback {
  margin-top: 10px;
  color: var(--kouch-text-muted);
  font-size: 12px;
}

.kouch-chart-fallback summary {
  cursor: pointer;
  font-weight: 800;
}

.kouch-distribution-card {
  display: grid;
  align-content: start;
}

.kouch-donut {
  position: relative;
  display: grid;
  width: min(190px, 70vw);
  aspect-ratio: 1;
  place-items: center;
  margin: 4px auto 16px;
  border-radius: 50%;
  background: conic-gradient(var(--kouch-lime), var(--kouch-gold));
}

.kouch-donut::after {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: var(--kouch-surface);
  content: "";
}

.kouch-donut strong {
  position: relative;
  z-index: 1;
  color: var(--kouch-text);
  font-size: 20px;
}

.kouch-list-card {
  min-height: 0;
}

.kouch-alert-card {
  border-color: rgba(215, 166, 58, 0.34);
}

.kouch-data-list {
  gap: 0;
}

.kouch-data-list li,
.kouch-table-list li {
  border-bottom-color: rgba(255, 255, 255, 0.07);
  padding: 9px 0;
}

.kouch-data-list li:last-child,
.kouch-table-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.kouch-data-list span {
  min-width: 0;
  color: var(--kouch-text);
  overflow-wrap: anywhere;
}

.kouch-data-list strong {
  color: var(--kouch-text);
  font-size: 13px;
  white-space: nowrap;
}

.kouch-empty {
  border: 1px dashed rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--kouch-text-muted);
}

.kouch-table-wrap {
  border-radius: 12px;
}

.kouch-table th,
.kouch-table td {
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.kouch-table th {
  color: var(--kouch-text-muted);
}

.kouch-sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(0, 0, 0, 0.56);
}

@media (max-width: 1280px) {
  .kouch-dashboard-grid--panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .kouch-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kouch-kpi--hero {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 150px;
  }

  .kouch-dashboard-grid--charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .kouch-sidebar {
    box-shadow: -22px 0 48px rgba(0, 0, 0, 0.38);
  }

  .kouch-topbar {
    min-height: 58px;
    padding: 8px 12px;
  }

  .kouch-topbar > .kouch-button {
    min-height: 36px;
    padding: 5px 10px;
  }

  .kouch-kpi-grid,
  .kouch-dashboard-grid--panels {
    grid-template-columns: 1fr;
  }

  .kouch-chart--thirty {
    grid-template-columns: repeat(30, 18px);
  }

  .kouch-chart__day {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .kouch-chart__bars {
    height: 150px;
  }

  .kouch-chart__day small {
    writing-mode: vertical-rl;
  }
}

:root {
  --kouch-bg: #090b0d;
  --kouch-sidebar-bg: #111315;
  --kouch-surface: #17191b;
  --kouch-surface-elevated: #1d2023;
  --kouch-surface-hover: #24272a;
  --kouch-border: #2a2e32;
  --kouch-text: #f5f7f8;
  --kouch-text-muted: #9da3aa;
  --kouch-brand-text: #e4e7eb;
  --kouch-lime: #9acb28;
  --kouch-lime-dark: #4f6f0c;
  --kouch-gold: #d7a63a;
  --kouch-action: #8fbf24;
  --kouch-action-hover: #a1d52b;
  --kouch-warning: #d99a32;
  --kouch-danger: #d84b4b;
  --kouch-secondary: #25292d;
  --kouch-secondary-hover: #30353a;
  --kouch-export: #34383d;
  --kouch-info: #4f86e8;
  --kouch-black: var(--kouch-bg);
  --kouch-ink: var(--kouch-text);
  --kouch-muted: var(--kouch-text-muted);
  --kouch-line: var(--kouch-border);
  --kouch-card: var(--kouch-surface);
  --kouch-field: #0f1113;
  --kouch-blue: var(--kouch-info);
  --kouch-success: #35b96f;
  --kouch-sidebar: 292px;
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
  margin: 0;
}

.kouch-body {
  direction: rtl;
  background: var(--kouch-bg);
  color: var(--kouch-ink);
  font-family: "Vazirmatn", Tahoma, Arial, sans-serif;
  line-height: 1.65;
}

.kouch-login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 24px;
}

.kouch-login {
  width: min(100%, 440px);
}

.kouch-login__panel,
.kouch-card {
  background: var(--kouch-card);
  border: 1px solid var(--kouch-line);
  border-radius: 8px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
}

.kouch-login__panel {
  padding: 32px;
}

.kouch-login__brand,
.kouch-sidebar__brand {
  color: var(--kouch-gold);
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0;
}

.kouch-login h1,
.kouch-card h1,
.kouch-card h2 {
  margin: 0 0 18px;
  font-size: 24px;
  line-height: 1.35;
}

.kouch-card h2 {
  font-size: 18px;
}

.kouch-form {
  display: grid;
  gap: 12px;
}

.kouch-form label,
.kouch-check {
  color: var(--kouch-ink);
  font-size: 14px;
  font-weight: 700;
}

.kouch-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.kouch-form select,
.kouch-form textarea,
.kouch-toolbar input,
.kouch-toolbar select {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--kouch-line);
  border-radius: 8px;
  padding: 10px 12px;
  background: var(--kouch-field);
  color: var(--kouch-ink);
  font: inherit;
}

.kouch-form input::placeholder,
.kouch-form textarea::placeholder,
.kouch-toolbar input::placeholder {
  color: var(--kouch-muted);
  opacity: 1;
}

.kouch-form input:read-only,
.kouch-form textarea:read-only,
.kouch-toolbar input:read-only {
  background: rgba(255, 255, 255, 0.04);
}

.kouch-form input:disabled,
.kouch-form select:disabled,
.kouch-form textarea:disabled,
.kouch-toolbar input:disabled,
.kouch-toolbar select:disabled {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.035);
  color: rgba(229, 231, 235, 0.52);
  cursor: not-allowed;
  opacity: 1;
}

.kouch-form input:-webkit-autofill,
.kouch-form input:-webkit-autofill:hover,
.kouch-form input:-webkit-autofill:focus,
.kouch-form textarea:-webkit-autofill,
.kouch-form textarea:-webkit-autofill:hover,
.kouch-form textarea:-webkit-autofill:focus,
.kouch-form select:-webkit-autofill,
.kouch-form select:-webkit-autofill:hover,
.kouch-form select:-webkit-autofill:focus,
.kouch-toolbar input:-webkit-autofill,
.kouch-toolbar input:-webkit-autofill:hover,
.kouch-toolbar input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--kouch-ink);
  caret-color: var(--kouch-ink);
  box-shadow: 0 0 0 1000px var(--kouch-field) inset;
  transition: background-color 9999s ease-out;
}

.kouch-form input[type="number"] {
  appearance: textfield;
  -moz-appearance: textfield;
}

.kouch-form input[type="number"]::-webkit-outer-spin-button,
.kouch-form input[type="number"]::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.kouch-form input:focus,
.kouch-button:focus,
.kouch-icon-button:focus,
.kouch-nav a:focus {
  outline: 3px solid rgba(29, 78, 216, 0.28);
  outline-offset: 2px;
}

.kouch-check {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 400;
}

.kouch-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 8px 16px;
  color: #fff;
  font: inherit;
  font-weight: 800;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
}

.kouch-button--primary {
  background: var(--kouch-blue);
}

.kouch-button--ghost {
  background: #27272a;
}

.kouch-button--danger {
  background: var(--kouch-danger);
}

.kouch-button--small {
  min-height: 34px;
  padding: 5px 10px;
  font-size: 13px;
}

.kouch-button:disabled,
.kouch-button[aria-disabled="true"] {
  opacity: 0.48;
  cursor: not-allowed;
  filter: grayscale(0.35);
}

.kouch-button[hidden] {
  display: none;
}

.kouch-date-field {
  position: relative;
}

.kouch-date-field small {
  display: block;
  margin-top: 6px;
  color: var(--kouch-muted);
  font-size: 12px;
  font-weight: 400;
}

.kouch-date-field__control {
  position: relative;
  display: grid;
  grid-template-columns: minmax(160px, 1fr) auto auto;
  gap: 8px;
  align-items: start;
}

.kouch-date-field__control input {
  cursor: pointer;
  text-align: center;
}

.kouch-jalali-picker {
  position: absolute;
  z-index: 30;
  top: calc(100% + 8px);
  right: 0;
  width: min(320px, 92vw);
  max-width: calc(100vw - 28px);
  max-height: min(460px, calc(100vh - 96px));
  overflow: auto;
  border: 1px solid var(--kouch-line);
  border-radius: 8px;
  padding: 12px;
  background: var(--kouch-card);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.28);
}

.kouch-jalali-picker__head,
.kouch-jalali-picker__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.kouch-jalali-picker__head button,
.kouch-jalali-picker__foot button,
.kouch-jalali-picker__grid button {
  border: 1px solid var(--kouch-line);
  border-radius: 8px;
  background: var(--kouch-field);
  color: var(--kouch-ink);
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

.kouch-jalali-picker__head button,
.kouch-jalali-picker__foot button {
  min-height: 34px;
  padding: 4px 10px;
}

.kouch-jalali-picker__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin: 12px 0;
  text-align: center;
}

.kouch-jalali-picker__grid span {
  color: var(--kouch-muted);
  font-size: 12px;
  font-weight: 800;
}

.kouch-jalali-picker__grid i {
  min-height: 34px;
}

.kouch-jalali-picker__grid button {
  min-width: 0;
  min-height: 34px;
  padding: 4px;
}

.kouch-jalali-picker__grid button:hover,
.kouch-jalali-picker__grid button.is-selected {
  border-color: var(--kouch-blue);
  background: var(--kouch-blue);
  color: #fff;
}

.kouch-jalali-picker__grid button.is-today {
  border-color: var(--kouch-gold);
  box-shadow: inset 0 0 0 1px var(--kouch-gold);
}

.kouch-jalali-picker__grid button:focus-visible,
.kouch-jalali-picker__head button:focus-visible,
.kouch-jalali-picker__foot button:focus-visible {
  outline: 3px solid rgba(79, 140, 255, 0.38);
  outline-offset: 2px;
}

.kouch-alert {
  margin: 16px 0;
  border-radius: 8px;
  padding: 10px 12px;
  font-weight: 700;
}

.kouch-alert--error {
  background: rgba(255, 107, 107, 0.14);
  color: var(--kouch-danger);
}

.kouch-alert--success {
  background: rgba(69, 194, 118, 0.14);
  color: var(--kouch-success);
}

.kouch-alert--warning {
  background: rgba(228, 182, 90, 0.14);
  color: var(--kouch-gold);
}

.kouch-alert a {
  color: inherit;
  font-weight: 900;
}

.kouch-app {
  display: grid;
  min-height: 100vh;
  grid-template-columns: var(--kouch-sidebar) 1fr;
}

.kouch-sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: var(--kouch-black);
  color: #fff;
  padding: 22px 18px;
}

.kouch-nav {
  display: grid;
  gap: 6px;
  margin-top: 28px;
}

.kouch-nav a {
  border-radius: 8px;
  color: #d4d4d8;
  padding: 11px 12px;
  text-decoration: none;
}

.kouch-nav__group {
  display: block;
  margin: 16px 0 4px;
  color: #a1a1aa;
  font-size: 12px;
  font-weight: 900;
}

.kouch-nav a:hover,
.kouch-nav a.is-active {
  background: #27272a;
  color: #fff;
}

.kouch-main {
  min-width: 0;
}

.kouch-topbar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 12px;
  background: var(--kouch-black);
  color: #fff;
  padding: 0 24px;
}

.kouch-topbar__title {
  display: grid;
  min-width: 0;
}

.kouch-topbar__title strong {
  font-size: 18px;
}

.kouch-topbar__title span {
  max-width: 42vw;
  overflow: hidden;
  color: #d4d4d8;
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kouch-global-search {
  flex: 1 1 280px;
  max-width: 420px;
}

.kouch-global-search input {
  width: 100%;
  min-height: 40px;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  padding: 8px 12px;
  background: var(--kouch-field);
  color: var(--kouch-ink);
  font: inherit;
}

.kouch-icon-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid #3f3f46;
  border-radius: 8px;
  background: #18181b;
  cursor: pointer;
}

.kouch-icon-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: #fff;
}

.kouch-content {
  display: grid;
  gap: 20px;
  padding: 24px;
}

.kouch-page-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.kouch-page-head h1 {
  margin: 0 0 4px;
  font-size: 26px;
}

.kouch-page-head p {
  margin: 0;
  color: var(--kouch-muted);
}

.kouch-form--grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.kouch-form--grid label {
  display: grid;
  gap: 6px;
}

.kouch-required {
  color: var(--kouch-danger);
  font-weight: 900;
}

.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

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

.kouch-settings-section {
  display: grid;
  gap: 14px;
}

.kouch-settings-section h2 {
  margin: 0;
  color: var(--kouch-text);
  font-size: 1.15em;
}

.kouch-settings-section__grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.kouch-form__actions {
  display: flex;
  justify-content: flex-start;
}

.kouch-toolbar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px auto;
  gap: 12px;
  align-items: end;
  margin-bottom: 18px;
}

.kouch-toolbar label {
  display: grid;
  gap: 6px;
  color: var(--kouch-muted);
  font-size: 13px;
  font-weight: 700;
}

.kouch-report-filter-form {
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  align-items: end;
}

.kouch-report-filter-form label,
.kouch-report-filter-form .kouch-date-field,
.kouch-report-filter-form .kouch-combobox {
  min-width: 0;
}

.kouch-report-filter-form .kouch-date-field__control {
  grid-template-columns: minmax(0, 1fr) auto;
}

.kouch-report-filter-form .kouch-date-field__control input {
  min-width: 0;
}

.kouch-report-filter-form > .kouch-button {
  justify-self: start;
  align-self: end;
  min-width: 112px;
}

.kouch-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.kouch-actions form {
  margin: 0;
}

.kouch-media-field {
  display: grid;
  grid-template-columns: 160px minmax(0, 1fr);
  gap: 14px;
  align-items: end;
}

.kouch-media-preview {
  display: grid;
  width: 160px;
  min-height: 116px;
  place-items: center;
  border: 1px dashed var(--kouch-line);
  border-radius: 8px;
  background: var(--kouch-field);
}

.kouch-media-preview.has-image {
  border-style: solid;
  background: var(--kouch-card);
}

.kouch-media-preview img {
  display: block;
  width: 100%;
  height: 116px;
  object-fit: cover;
  border-radius: 8px;
}

.kouch-media-actions,
.kouch-input-affix {
  display: flex;
  align-items: center;
  gap: 8px;
}

.kouch-input-affix input {
  min-width: 0;
}

.kouch-input-affix span {
  flex: 0 0 auto;
  min-width: 52px;
  color: var(--kouch-muted);
  font-weight: 800;
}

.kouch-help {
  color: var(--kouch-muted);
  font-size: 12px;
  font-weight: 400;
}

.kouch-duplicate-name-warning {
  color: var(--kouch-danger);
  font-weight: 700;
}

.kouch-toolbar--compact {
  grid-template-columns: minmax(220px, 1fr) auto;
}

.kouch-detail-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0;
}

.kouch-detail-list div,
.kouch-subpanel {
  border: 1px solid var(--kouch-line);
  border-radius: 8px;
  background: rgba(13, 19, 26, 0.55);
}

.kouch-detail-list div {
  padding: 12px;
}

.kouch-detail-list dt {
  color: var(--kouch-muted);
  font-size: 12px;
  font-weight: 800;
}

.kouch-detail-list dd {
  margin: 4px 0 0;
  overflow-wrap: anywhere;
  font-weight: 800;
}

.kouch-permission-grid {
  display: grid;
  gap: 14px;
}

.kouch-subpanel {
  padding: 14px;
}

.kouch-subpanel h2 {
  margin: 0 0 12px;
  font-size: 16px;
}

.kouch-print-doc {
  position: relative;
  background: var(--kouch-document-surface, var(--kouch-card));
  color: var(--kouch-document-text, var(--kouch-text));
}

.kouch-print-doc .kouch-page-head h1,
.kouch-transaction-doc h1,
.kouch-transaction-doc h2,
.kouch-print-doc strong,
.kouch-transaction-doc strong,
.kouch-print-doc .kouch-table td,
.kouch-transaction-doc .kouch-table td {
  color: var(--kouch-document-heading, var(--kouch-text));
}

.kouch-print-doc .kouch-page-head p,
.kouch-print-doc .kouch-health__grid span,
.kouch-transaction-doc .kouch-health__grid span {
  color: var(--kouch-document-muted, var(--kouch-muted));
}

.kouch-print-doc .kouch-health__grid div,
.kouch-transaction-doc .kouch-health__grid div {
  border-color: var(--kouch-document-border, var(--kouch-line));
  background: var(--kouch-document-surface, var(--kouch-card));
}

.kouch-print-doc .kouch-table th,
.kouch-transaction-doc .kouch-table th {
  background: var(--kouch-document-table-header, var(--kouch-table-head));
  color: var(--kouch-document-muted, var(--kouch-muted));
}

.kouch-print-doc .kouch-table td,
.kouch-print-doc .kouch-table th,
.kouch-transaction-doc .kouch-table td,
.kouch-transaction-doc .kouch-table th {
  border-bottom-color: var(--kouch-document-row-border, var(--kouch-line));
}

.kouch-print-doc p,
.kouch-transaction-doc p {
  color: var(--kouch-document-text, var(--kouch-text));
}

.kouch-document-watermark {
  position: absolute;
  inset: 34% auto auto 18%;
  transform: rotate(-24deg);
  font-size: 68px;
  font-weight: 900;
  color: var(--kouch-document-watermark, rgba(15, 23, 42, 0.08));
  pointer-events: none;
}

.kouch-signatures {
  display: grid;
  grid-template-columns: repeat(4, minmax(120px, 1fr));
  gap: 16px;
  margin-top: 48px;
}

.kouch-signatures div {
  min-height: 78px;
  border-top: 1px solid var(--kouch-document-signature-line, var(--kouch-document-border, var(--kouch-line)));
  padding-top: 12px;
  color: var(--kouch-document-text, var(--kouch-text));
  text-align: center;
  font-weight: 800;
}

.kouch-export-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.kouch-warning-list {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0 18px 0 0;
  color: var(--kouch-gold);
  font-weight: 800;
}

@media print {
  body {
    background: #fff;
  }

  .kouch-sidebar,
  .kouch-topbar,
  .kouch-toolbar,
  .kouch-print-toolbar,
  .kouch-actions,
  .kouch-print-doc .kouch-button {
    display: none !important;
  }

  .kouch-app {
    display: block;
  }

  .kouch-content {
    padding: 0;
  }

  .kouch-card {
    border: 0;
    box-shadow: none;
  }
}

.kouch-status {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 13px;
  font-weight: 800;
}

.kouch-status--active {
  background: rgba(69, 194, 118, 0.16);
  color: var(--kouch-success);
}

.kouch-status--inactive {
  background: rgba(154, 168, 186, 0.14);
  color: var(--kouch-muted);
}

.kouch-status--ok,
.kouch-status--confirmed {
  background: rgba(69, 194, 118, 0.16);
  color: var(--kouch-success);
}

.kouch-status--low,
.kouch-status--draft {
  background: rgba(228, 182, 90, 0.16);
  color: var(--kouch-gold);
}

.kouch-status--out,
.kouch-status--negative,
.kouch-status--cancelled {
  background: rgba(255, 107, 107, 0.16);
  color: var(--kouch-danger);
}

.kouch-status--reversed,
.is-reversal {
  background: rgba(154, 168, 186, 0.14);
}

.kouch-pagination {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.kouch-pagination a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  border: 1px solid var(--kouch-line);
  border-radius: 8px;
  color: var(--kouch-ink);
  text-decoration: none;
}

.kouch-pagination a.is-current {
  background: var(--kouch-blue);
  color: #fff;
}

.kouch-metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(150px, 1fr));
  gap: 14px;
}

.kouch-card {
  padding: 20px;
}

.kouch-metric {
  display: grid;
  gap: 8px;
  min-height: 112px;
}

.kouch-metric span,
.kouch-health__grid span {
  color: var(--kouch-muted);
  font-size: 13px;
  font-weight: 700;
}

.kouch-metric strong {
  font-size: clamp(24px, 4vw, 34px);
  line-height: 1.2;
}

.kouch-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.8fr);
  gap: 20px;
}

.kouch-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(42px, 1fr));
  gap: 10px;
  min-height: 230px;
  align-items: end;
}

.kouch-chart__day {
  display: grid;
  gap: 8px;
  text-align: center;
}

.kouch-chart__bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  height: 170px;
  border-bottom: 1px solid var(--kouch-line);
}

.kouch-chart__bars span {
  display: block;
  width: 15px;
  min-height: 6px;
  border-radius: 8px 8px 0 0;
}

.kouch-chart__bars .entry {
  background: var(--kouch-blue);
}

.kouch-chart__bars .exit {
  background: var(--kouch-gold);
}

.kouch-chart--dense {
  grid-template-columns: repeat(30, minmax(18px, 1fr));
  gap: 4px;
}

.kouch-chart--dense .kouch-chart__bars {
  height: 120px;
}

.kouch-chart--dense small {
  font-size: 10px;
  writing-mode: vertical-rl;
}

.kouch-data-list,
.kouch-table-list {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kouch-data-list li,
.kouch-table-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--kouch-line);
  padding-bottom: 10px;
}

.kouch-empty {
  margin: 0;
  color: var(--kouch-muted);
}

.kouch-table-wrap {
  overflow-x: auto;
}

.kouch-table {
  width: 100%;
  min-width: 680px;
  border-collapse: collapse;
}

.kouch-table th,
.kouch-table td {
  border-bottom: 1px solid var(--kouch-line);
  padding: 12px 10px;
  text-align: right;
}

.kouch-table th {
  color: var(--kouch-muted);
  font-size: 13px;
}

.kouch-transaction-lines {
  min-width: 920px;
  table-layout: fixed;
}

.kouch-document-lines {
  min-width: 760px;
  table-layout: fixed;
}

.kouch-transaction-lines .kouch-col-product-code {
  width: 12%;
  white-space: nowrap;
}

.kouch-transaction-lines .kouch-col-product {
  width: 27%;
}

.kouch-transaction-lines .kouch-col-quantity {
  width: 8%;
}

.kouch-transaction-lines .kouch-col-unit {
  width: 10%;
}

.kouch-transaction-lines .kouch-col-actions {
  width: 92px;
  white-space: nowrap;
}

.kouch-transaction-lines .kouch-col-line-description {
  width: auto;
}

.kouch-document-lines .kouch-col-product-code {
  width: 13%;
  white-space: nowrap;
}

.kouch-document-lines .kouch-col-product {
  width: 27%;
}

.kouch-document-lines .kouch-col-quantity {
  width: 8%;
}

.kouch-document-lines .kouch-col-unit {
  width: 10%;
}

.kouch-document-lines .kouch-col-line-description {
  width: 42%;
}

.kouch-transaction-lines .kouch-col-quantity input {
  max-width: 84px;
}

.kouch-transaction-lines .kouch-line-description {
  width: 100%;
  min-width: 220px;
}

.kouch-transaction-lines .kouch-col-line-description,
.kouch-document-lines .kouch-col-line-description {
  overflow-wrap: anywhere;
}

.kouch-permission-table {
  min-width: 720px;
  table-layout: fixed;
}

.kouch-permission-table th:first-child,
.kouch-permission-table td:first-child {
  width: 260px;
  min-width: 260px;
}

.kouch-permission-table th:not(:first-child),
.kouch-permission-table td:not(:first-child) {
  width: 120px;
  text-align: center;
}

.kouch-permission-table .kouch-check {
  display: inline-grid;
  min-width: 44px;
  min-height: 44px;
  place-items: center;
}

.kouch-permission-role-label {
  display: none;
}

.kouch-activity-table code {
  display: inline-block;
  max-width: 100%;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
}

.kouch-table--sticky thead th {
  position: sticky;
  top: 0;
  z-index: 1;
  background: var(--kouch-card);
}

.kouch-thumb {
  width: 44px;
  height: 44px;
  border-radius: 8px;
  object-fit: cover;
}

.kouch-product-summary {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 18px;
  align-items: center;
  margin-bottom: 20px;
}

.kouch-product-summary__image {
  width: 120px;
  height: 120px;
  border-radius: 8px;
  object-fit: cover;
}

.kouch-search-results {
  display: grid;
  gap: 10px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.kouch-search-results li {
  display: grid;
  gap: 4px;
  border-bottom: 1px solid var(--kouch-line);
  padding-bottom: 10px;
}

.kouch-search-results span {
  color: var(--kouch-muted);
  font-size: 13px;
}

.kouch-search-results mark {
  border-radius: 4px;
  background: rgba(228, 182, 90, 0.3);
  color: inherit;
  padding: 0 2px;
}

.kouch-health__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(150px, 1fr));
  gap: 12px;
  margin-bottom: 24px;
}

.kouch-health__grid div {
  display: grid;
  gap: 6px;
  border: 1px solid var(--kouch-line);
  border-radius: 8px;
  padding: 14px;
}

.is-ok {
  color: var(--kouch-success);
  font-weight: 800;
}

.is-bad {
  color: var(--kouch-danger);
  font-weight: 800;
}

@media (max-width: 1100px) {
  .kouch-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kouch-grid,
  .kouch-health__grid,
  .kouch-detail-list,
  .kouch-form--grid,
  .kouch-settings-section__grid {
    grid-template-columns: 1fr;
  }

  .kouch-toolbar {
    grid-template-columns: 1fr;
  }

  .kouch-media-field {
    grid-template-columns: 1fr;
  }

  .kouch-media-actions,
  .kouch-input-affix,
  .kouch-date-field__control {
    align-items: stretch;
    flex-direction: column;
    grid-template-columns: 1fr;
  }

  .kouch-input-affix span {
    min-width: 0;
  }
}

@media (max-width: 760px) {
  .kouch-app {
    grid-template-columns: 1fr;
  }

  .kouch-sidebar {
    position: fixed;
    inset: 0 0 0 auto;
    z-index: 20;
    width: min(84vw, var(--kouch-sidebar));
    transform: translateX(105%);
    transition: transform 180ms ease;
  }

  .kouch-app.is-sidebar-open .kouch-sidebar {
    transform: translateX(0);
  }

  .kouch-icon-button {
    display: inline-block;
    flex: 0 0 auto;
  }

  .kouch-topbar {
    flex-wrap: wrap;
    padding: 0 12px;
  }

  .kouch-global-search {
    order: 3;
    flex-basis: 100%;
    max-width: none;
  }

  .kouch-content {
    padding: 14px;
  }

  .kouch-metrics,
  .kouch-chart {
    grid-template-columns: 1fr;
  }

  .kouch-page-head {
    align-items: stretch;
    flex-direction: column;
  }

  .kouch-table--responsive {
    min-width: 0;
  }

  .kouch-table--responsive thead {
    display: none;
  }

  .kouch-table--responsive,
  .kouch-table--responsive tbody,
  .kouch-table--responsive tr,
  .kouch-table--responsive td {
    display: block;
    width: 100%;
  }

  .kouch-table--responsive tr {
    border: 1px solid var(--kouch-line);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 10px;
  }

  .kouch-table--responsive td {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    border-bottom: 1px solid var(--kouch-line);
    padding: 8px 0;
  }

  .kouch-table--responsive td:last-child {
    border-bottom: 0;
  }

  .kouch-table--responsive td::before {
    content: attr(data-label);
    color: var(--kouch-muted);
    font-weight: 800;
  }

  .kouch-transaction-lines,
  .kouch-document-lines {
    table-layout: auto;
  }

  .kouch-transaction-lines tr,
  .kouch-document-lines tr {
    background: color-mix(in srgb, var(--kouch-card) 96%, var(--kouch-accent) 4%);
  }

  .kouch-transaction-lines td,
  .kouch-document-lines td {
    align-items: flex-start;
    min-width: 0;
  }

  .kouch-transaction-lines td::before,
  .kouch-document-lines td::before {
    flex: 0 0 86px;
  }

  .kouch-transaction-lines td > :not(.screen-reader-text),
  .kouch-document-lines td > :not(.screen-reader-text) {
    min-width: 0;
  }

  .kouch-transaction-lines .kouch-col-product,
  .kouch-transaction-lines .kouch-col-line-description,
  .kouch-transaction-lines .kouch-col-actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .kouch-transaction-lines .kouch-col-product::before,
  .kouch-transaction-lines .kouch-col-line-description::before,
  .kouch-transaction-lines .kouch-col-actions::before {
    flex-basis: auto;
  }

  .kouch-transaction-lines .kouch-inline-control,
  .kouch-form--grid .kouch-inline-control {
    grid-template-columns: minmax(0, 1fr) 42px;
    width: 100%;
  }

  .kouch-transaction-lines .kouch-combobox,
  .kouch-form--grid .kouch-combobox,
  .kouch-report-filter-form .kouch-combobox {
    min-width: 0;
  }

  .kouch-transaction-lines .kouch-col-quantity input,
  .kouch-transaction-lines .kouch-line-description {
    width: 100%;
    min-width: 0;
    max-width: none;
  }

  .kouch-transaction-lines .kouch-col-actions .kouch-button,
  .kouch-actions .kouch-button,
  .kouch-actions button {
    width: 100%;
    justify-content: center;
  }

  .kouch-actions form,
  .kouch-form__actions {
    width: 100%;
  }

  .kouch-form__actions {
    flex-wrap: wrap;
    gap: 8px;
  }

  .kouch-form__actions .kouch-button {
    min-height: 42px;
  }

  .kouch-modal {
    align-items: start;
    padding: 12px;
    overflow-y: auto;
  }

  .kouch-modal__panel {
    width: min(100%, 430px);
    max-height: calc(100dvh - 24px);
    overflow-y: auto;
  }

  .kouch-modal__actions,
  .kouch-modal .kouch-form__actions {
    justify-content: stretch;
  }

  .kouch-modal__actions .kouch-button,
  .kouch-modal .kouch-form__actions .kouch-button {
    flex: 1 1 140px;
  }

  .kouch-metric span,
  .kouch-metric small {
    overflow-wrap: anywhere;
  }

  .kouch-activity-toolbar {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .kouch-activity-toolbar .kouch-button {
    width: 100%;
    justify-content: center;
  }

  .kouch-activity-table td {
    display: grid;
    grid-template-columns: minmax(86px, 0.32fr) minmax(0, 1fr);
    align-items: start;
  }

  .kouch-activity-table td code {
    min-width: 0;
  }

  .kouch-permission-table-wrap {
    overflow-x: visible;
  }

  .kouch-permission-table {
    min-width: 0;
  }

  .kouch-permission-table thead {
    display: none;
  }

  .kouch-permission-table,
  .kouch-permission-table tbody,
  .kouch-permission-table tr,
  .kouch-permission-table td {
    display: block;
    width: 100%;
  }

  .kouch-permission-table tr {
    border: 1px solid var(--kouch-line);
    border-radius: 8px;
    margin-bottom: 12px;
    padding: 10px;
    background: color-mix(in srgb, var(--kouch-card) 94%, var(--kouch-accent) 6%);
  }

  .kouch-permission-table .kouch-permission-label {
    position: static;
    width: auto;
    min-width: 0;
    border-bottom: 1px solid var(--kouch-line);
    padding: 0 0 10px;
    background: transparent;
    box-shadow: none;
    color: var(--kouch-text);
    font-weight: 900;
    overflow-wrap: anywhere;
  }

  .kouch-permission-table td:not(.kouch-permission-label) {
    width: auto;
    min-width: 0;
    border-bottom: 1px solid var(--kouch-line);
    padding: 0;
    text-align: right;
  }

  .kouch-permission-table td:last-child {
    border-bottom: 0;
  }

  .kouch-permission-table .kouch-check {
    display: flex;
    min-width: 0;
    min-height: 46px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 8px 2px;
  }

  .kouch-permission-table .kouch-check input {
    flex: 0 0 auto;
    width: 22px;
    height: 22px;
  }

  .kouch-permission-role-label {
    display: block;
    min-width: 0;
    color: var(--kouch-muted);
    font-weight: 800;
    overflow-wrap: anywhere;
  }

  .kouch-print-toolbar {
    flex-wrap: wrap;
  }

  .kouch-print-toolbar .kouch-button,
  .kouch-print-doc .kouch-actions .kouch-button {
    flex: 1 1 150px;
    justify-content: center;
    min-height: 44px;
    white-space: normal;
  }

  .kouch-print-doc .kouch-document-lines td {
    display: grid;
    grid-template-columns: minmax(86px, 0.32fr) minmax(0, 1fr);
    gap: 12px;
  }

  .kouch-print-doc .kouch-document-lines td::before {
    flex-basis: auto;
  }

  .kouch-print-doc .kouch-document-lines td,
  .kouch-print-doc .kouch-document-lines td > * {
    overflow-wrap: anywhere;
  }

  .kouch-chart {
    min-height: auto;
  }

  .kouch-chart__day {
    grid-template-columns: 56px 1fr;
    align-items: center;
    text-align: right;
  }

  .kouch-product-summary {
    grid-template-columns: 1fr;
  }

  .kouch-chart__bars {
    height: 58px;
  }

  .kouch-login__panel {
    padding: 22px;
  }
}

/* Final cascade position for the premium dark UI. */
.kouch-app-screen {
  background:
    radial-gradient(circle at 18% 0%, rgba(154, 203, 40, 0.08), transparent 28rem),
    var(--kouch-bg);
}

.kouch-app {
  grid-template-columns: var(--kouch-sidebar) minmax(0, 1fr);
}

.kouch-sidebar {
  display: flex;
  flex-direction: column;
  gap: 18px;
  border-left: 1px solid var(--kouch-border);
  background: var(--kouch-sidebar-bg);
  padding: 18px 14px;
}

.kouch-sidebar__brand {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 14px;
  border-bottom: 1px solid rgba(215, 166, 58, 0.18);
}

.kouch-sidebar__brand strong {
  display: block;
  color: var(--kouch-gold);
  font-size: 18px;
  line-height: 1.2;
}

.kouch-sidebar__brand small,
.kouch-sidebar__user small,
.kouch-data-list small,
.kouch-card__head p,
.kouch-kpi small {
  display: block;
  color: var(--kouch-text-muted);
  font-size: 12px;
  font-weight: 500;
}

.kouch-user-avatar {
  display: inline-grid;
  flex: 0 0 auto;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(215, 166, 58, 0.36);
  border-radius: 12px;
  background: rgba(215, 166, 58, 0.1);
  color: var(--kouch-gold);
  font-weight: 900;
}

.kouch-nav {
  gap: 4px;
  margin-top: 0;
  padding-left: 2px;
}

.kouch-nav__group {
  margin: 14px 8px 5px;
  color: #747b83;
  font-size: 11px;
  letter-spacing: 0;
}

.kouch-nav a {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 12px;
  color: #cbd0d5;
  padding: 7px 9px;
  font-size: 13px;
  font-weight: 750;
}

.kouch-nav a:hover {
  border-color: var(--kouch-border);
  background: var(--kouch-surface-hover);
}

.kouch-nav a.is-active {
  border-color: rgba(154, 203, 40, 0.42);
  background: rgba(154, 203, 40, 0.14);
  color: var(--kouch-text);
}

.kouch-nav__icon {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--kouch-lime);
  font-size: 13px;
  line-height: 1;
}

.kouch-sidebar__user {
  display: grid;
  gap: 10px;
  margin-top: auto;
  border-top: 1px solid var(--kouch-border);
  padding-top: 12px;
}

.kouch-user-chip {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.kouch-user-chip strong {
  display: block;
  max-width: 180px;
  overflow: hidden;
  color: var(--kouch-text);
  font-size: 13px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kouch-sidebar__logout {
  display: inline-flex;
  justify-content: center;
  min-height: 36px;
  border: 1px solid var(--kouch-border);
  border-radius: 10px;
  padding: 6px 10px;
  background: var(--kouch-surface);
  color: var(--kouch-text-muted);
  font-size: 13px;
  font-weight: 800;
  text-decoration: none;
}

.kouch-sidebar__logout:hover {
  color: var(--kouch-text);
  background: var(--kouch-surface-hover);
}

.kouch-topbar {
  min-height: 62px;
  border-bottom: 1px solid var(--kouch-border);
  background: rgba(9, 11, 13, 0.94);
  backdrop-filter: blur(10px);
  padding: 0 22px;
}

.kouch-topbar__title strong {
  color: var(--kouch-text);
  font-size: 17px;
}

.kouch-global-search {
  max-width: 460px;
}

.kouch-global-search input,
.kouch-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.kouch-form select,
.kouch-form textarea,
.kouch-toolbar input,
.kouch-toolbar select {
  border-color: var(--kouch-border);
  background: #101214;
  color: var(--kouch-text);
}

.kouch-global-search input:focus,
.kouch-form input:focus,
.kouch-form select:focus,
.kouch-form textarea:focus,
.kouch-toolbar input:focus,
.kouch-toolbar select:focus,
.kouch-button:focus,
.kouch-icon-button:focus,
.kouch-nav a:focus {
  outline: 3px solid rgba(154, 203, 40, 0.22);
}

.kouch-button {
  border-radius: 10px;
}

.kouch-button--primary {
  background: var(--kouch-blue);
}

.kouch-button--ghost {
  border-color: var(--kouch-border);
  background: var(--kouch-surface-elevated);
  color: var(--kouch-text);
}

.kouch-button--danger {
  background: #ef4444;
}

.kouch-content {
  gap: 18px;
  padding: 22px;
}

.kouch-card,
.kouch-login__panel {
  border-color: var(--kouch-border);
  border-radius: 16px;
  background: var(--kouch-surface);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.18);
}

.kouch-card {
  padding: 16px;
}

.kouch-card h1,
.kouch-card h2 {
  margin-bottom: 12px;
  color: var(--kouch-text);
}

.kouch-dashboard,
.kouch-dashboard-grid {
  display: grid;
  gap: 18px;
}

.kouch-kpi-grid {
  display: grid;
  grid-template-columns: minmax(220px, 1.55fr) repeat(3, minmax(160px, 1fr));
  gap: 12px;
}

.kouch-kpi {
  position: relative;
  display: grid;
  gap: 6px;
  min-height: 116px;
  align-content: space-between;
}

.kouch-kpi__link {
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: inherit;
}

.kouch-kpi:has(.kouch-kpi__link):hover {
  border-color: rgba(154, 203, 40, 0.38);
  background: var(--kouch-surface-elevated);
}

.kouch-kpi span {
  color: var(--kouch-text-muted);
  font-size: 13px;
  font-weight: 800;
}

.kouch-kpi strong {
  color: var(--kouch-text);
  font-size: clamp(25px, 3vw, 36px);
  line-height: 1.15;
}

.kouch-kpi--hero {
  grid-row: span 2;
  min-height: 244px;
  border-color: rgba(154, 203, 40, 0.46);
  background:
    linear-gradient(145deg, rgba(154, 203, 40, 0.22), rgba(79, 111, 12, 0.1) 48%, var(--kouch-surface-elevated)),
    var(--kouch-surface-elevated);
}

.kouch-kpi--hero strong {
  color: #f8ffe8;
  font-size: clamp(34px, 4.6vw, 56px);
}

.kouch-dashboard-grid--charts {
  grid-template-columns: minmax(0, 1.7fr) minmax(280px, 0.8fr);
}

.kouch-dashboard-grid--panels {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.kouch-card__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 12px;
}

.kouch-card__head h1,
.kouch-card__head h2,
.kouch-card__head p {
  margin: 0;
}

.kouch-chart {
  min-height: 260px;
  border-radius: 14px;
  background:
    linear-gradient(to top, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 100% 25%,
    #121416;
  padding: 16px 12px 10px;
}

.kouch-chart--thirty {
  grid-template-columns: repeat(30, minmax(13px, 1fr));
  gap: 5px;
  overflow-x: auto;
}

.kouch-chart__day {
  min-width: 16px;
}

.kouch-chart__bars {
  height: 188px;
  border-bottom-color: rgba(255, 255, 255, 0.08);
}

.kouch-chart__bars span {
  width: 8px;
  border-radius: 999px 999px 4px 4px;
}

.kouch-chart__bars .entry,
.kouch-chart-legend .entry {
  background: var(--kouch-lime);
}

.kouch-chart__bars .exit,
.kouch-chart-legend .exit {
  background: var(--kouch-gold);
}

.kouch-chart__day small {
  color: #7f8790;
  font-size: 10px;
  writing-mode: vertical-rl;
}

.kouch-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 10px;
  color: var(--kouch-text-muted);
  font-size: 12px;
  font-weight: 800;
}

.kouch-chart-legend span,
.kouch-data-list--compact span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.kouch-chart-legend i,
.kouch-data-list--compact i {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 999px;
}

.kouch-chart-fallback {
  margin-top: 10px;
  color: var(--kouch-text-muted);
  font-size: 12px;
}

.kouch-chart-fallback summary {
  cursor: pointer;
  font-weight: 800;
}

.kouch-donut {
  position: relative;
  display: grid;
  width: min(190px, 70vw);
  aspect-ratio: 1;
  place-items: center;
  margin: 4px auto 16px;
  border-radius: 50%;
}

.kouch-donut::after {
  position: absolute;
  inset: 22%;
  border-radius: 50%;
  background: var(--kouch-surface);
  content: "";
}

.kouch-donut strong {
  position: relative;
  z-index: 1;
  color: var(--kouch-text);
  font-size: 20px;
}

.kouch-alert-card {
  border-color: rgba(215, 166, 58, 0.34);
}

.kouch-data-list {
  gap: 0;
}

.kouch-data-list li,
.kouch-table-list li {
  border-bottom-color: rgba(255, 255, 255, 0.07);
  padding: 9px 0;
}

.kouch-data-list li:last-child,
.kouch-table-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.kouch-data-list span {
  min-width: 0;
  color: var(--kouch-text);
  overflow-wrap: anywhere;
}

.kouch-data-list strong {
  color: var(--kouch-text);
  font-size: 13px;
  white-space: nowrap;
}

.kouch-empty {
  border: 1px dashed rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--kouch-text-muted);
}

.kouch-table-wrap {
  border-radius: 12px;
}

.kouch-table th,
.kouch-table td {
  border-bottom-color: rgba(255, 255, 255, 0.07);
}

.kouch-table th {
  color: var(--kouch-text-muted);
}

.kouch-sidebar-overlay {
  position: fixed;
  inset: 0;
  z-index: 19;
  background: rgba(0, 0, 0, 0.56);
}

@media (max-width: 1280px) {
  .kouch-dashboard-grid--panels {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 1100px) {
  .kouch-kpi-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kouch-kpi--hero {
    grid-column: 1 / -1;
    grid-row: auto;
    min-height: 150px;
  }

  .kouch-dashboard-grid--charts {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .kouch-app {
    grid-template-columns: 1fr;
  }

  .kouch-sidebar {
    box-shadow: -22px 0 48px rgba(0, 0, 0, 0.38);
  }

  .kouch-topbar {
    min-height: 58px;
    padding: 8px 12px;
  }

  .kouch-topbar > .kouch-button {
    min-height: 36px;
    padding: 5px 10px;
  }

  .kouch-kpi-grid,
  .kouch-dashboard-grid--panels {
    grid-template-columns: 1fr;
  }

  .kouch-chart--thirty {
    grid-template-columns: repeat(30, 18px);
  }

  .kouch-chart__day {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .kouch-chart__bars {
    height: 150px;
  }

  .kouch-chart__day small {
    writing-mode: vertical-rl;
  }
}

/* Restored dashboard content layout. Shell, sidebar, forms, and other pages keep the current premium theme. */
.kouch-dashboard-restored {
  display: grid;
  gap: 18px;
  min-width: 0;
}

.kouch-dashboard-restored__metrics {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 12px;
}

.kouch-dashboard-restored__metrics .kouch-metric {
  display: grid;
  gap: 8px;
  min-height: 118px;
  align-content: space-between;
  border-color: var(--kouch-border);
  background: var(--kouch-surface);
  padding: 16px;
  text-decoration: none;
  transition: border-color .18s ease, box-shadow .18s ease, transform .18s ease;
}

.kouch-dashboard-restored__metrics a.kouch-metric:hover,
.kouch-dashboard-restored__metrics a.kouch-metric:focus-visible {
  border-color: var(--kouch-blue);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--kouch-blue) 24%, transparent);
  outline: none;
  transform: translateY(-1px);
}

.kouch-dashboard-restored__metrics .kouch-metric span {
  color: var(--kouch-text-muted);
  font-size: 13px;
  font-weight: 800;
}

.kouch-dashboard-restored__metrics .kouch-metric strong {
  display: block;
  color: var(--kouch-text);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.15;
}

.kouch-dashboard-restored__metrics .kouch-metric small {
  color: var(--kouch-text-muted);
  font-size: 12px;
  font-weight: 500;
}

.kouch-dashboard-restored__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.85fr);
  gap: 16px;
  min-width: 0;
}

.kouch-dashboard-restored__grid > .kouch-card:only-child {
  grid-column: 1 / -1;
}

.kouch-dashboard-restored .kouch-card {
  min-width: 0;
}

.kouch-dashboard-restored .kouch-card h1,
.kouch-dashboard-restored .kouch-card h2 {
  margin: 0 0 12px;
  color: var(--kouch-text);
}

.kouch-dashboard-restored .kouch-chart {
  display: grid;
  grid-template-columns: repeat(7, minmax(34px, 1fr));
  gap: 9px;
  align-items: end;
  min-height: 0;
  border-radius: 12px;
  background:
    linear-gradient(to top, rgba(255, 255, 255, 0.045) 1px, transparent 1px) 0 0 / 100% 25%,
    #121416;
  padding: 14px 10px 8px;
}

.kouch-dashboard-restored .kouch-chart--dense {
  grid-template-columns: repeat(30, minmax(14px, 1fr));
  gap: 4px;
  overflow-x: auto;
}

.kouch-dashboard-restored .kouch-chart__day {
  display: grid;
  gap: 7px;
  min-width: 0;
  text-align: center;
}

.kouch-dashboard-restored .kouch-chart__bars {
  display: flex;
  align-items: end;
  justify-content: center;
  gap: 5px;
  height: 150px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.kouch-dashboard-restored .kouch-chart--dense .kouch-chart__bars {
  height: 104px;
}

.kouch-dashboard-restored .kouch-chart__bars span {
  display: block;
  width: 10px;
  min-height: 6px;
  border-radius: 999px 999px 4px 4px;
}

.kouch-dashboard-restored .kouch-chart--dense .kouch-chart__bars span {
  width: 7px;
}

.kouch-dashboard-restored .kouch-chart__bars .entry {
  background: var(--kouch-blue);
}

.kouch-dashboard-restored .kouch-chart__bars .exit {
  background: #dc2626;
}

.kouch-dashboard-restored .kouch-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 16px;
  margin: 0 0 10px;
  color: var(--kouch-text);
  font-size: 13px;
  font-weight: 700;
}

.kouch-dashboard-restored .kouch-chart-legend span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.kouch-dashboard-restored .kouch-chart-legend i {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 999px;
}

.kouch-dashboard-restored .kouch-chart-legend .entry {
  background: var(--kouch-blue);
}

.kouch-dashboard-restored .kouch-chart-legend .exit {
  background: #dc2626;
}

.kouch-dashboard-restored .kouch-chart__day small {
  color: #7f8790;
  font-size: 10px;
  writing-mode: horizontal-tb;
}

.kouch-dashboard-restored .kouch-chart--dense small {
  writing-mode: vertical-rl;
}

.kouch-dashboard-restored .kouch-empty {
  margin: 0;
  border: 1px dashed rgba(255, 255, 255, 0.11);
  border-radius: 12px;
  padding: 10px 12px;
  background: rgba(255, 255, 255, 0.025);
  color: var(--kouch-text-muted);
}

.kouch-dashboard-restored .kouch-data-list {
  display: grid;
  gap: 0;
  margin: 0;
  padding: 0;
  list-style: none;
}

.kouch-dashboard-restored .kouch-data-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  padding: 9px 0;
}

.kouch-dashboard-restored .kouch-data-list li:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.kouch-dashboard-restored .kouch-data-list span {
  min-width: 0;
  overflow-wrap: anywhere;
  color: var(--kouch-text);
}

.kouch-dashboard-restored .kouch-data-list strong {
  color: var(--kouch-text);
  font-size: 13px;
  white-space: nowrap;
}

@media (min-width: 1360px) {
  .kouch-dashboard-restored__metrics {
    grid-template-columns: repeat(5, minmax(150px, 1fr));
  }
}

@media (max-width: 1100px) {
  .kouch-dashboard-restored__metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .kouch-dashboard-restored__grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .kouch-dashboard-restored__metrics {
    grid-template-columns: 1fr;
  }

  .kouch-dashboard-restored .kouch-chart {
    grid-template-columns: 1fr;
  }

  .kouch-dashboard-restored .kouch-chart--dense {
    grid-template-columns: repeat(30, 18px);
  }

  .kouch-dashboard-restored .kouch-chart__day {
    grid-template-columns: 54px 1fr;
    align-items: center;
    text-align: right;
  }

  .kouch-dashboard-restored .kouch-chart--dense .kouch-chart__day {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .kouch-dashboard-restored .kouch-chart__bars,
  .kouch-dashboard-restored .kouch-chart--dense .kouch-chart__bars {
    height: 62px;
  }

  .kouch-dashboard-restored .kouch-chart__day small {
    writing-mode: horizontal-tb;
  }
}

/* Refined application branding and isolated custom login UI. */
.kouch-sidebar__brand strong,
.kouch-login__brand {
  color: var(--kouch-brand-text);
}

.kouch-login-screen {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: 20px;
  background:
    radial-gradient(circle at 50% 0%, rgba(154, 203, 40, 0.1), transparent 28rem),
    linear-gradient(145deg, rgba(79, 140, 255, 0.08), transparent 34rem),
    var(--kouch-bg);
}

.kouch-login {
  width: min(100%, 452px);
}

.kouch-login__panel {
  position: relative;
  display: grid;
  gap: 16px;
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 20px;
  padding: 30px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.035), transparent 120px),
    var(--kouch-surface);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

.kouch-login__brand-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2px;
}

.kouch-login__brand-wrap--logo {
  display: block;
  margin-bottom: 8px;
  text-align: center;
}

.kouch-login__brand-wrap--text {
  justify-content: center;
  text-align: center;
}

.kouch-login__brand {
  font-size: 20px;
  font-weight: 900;
  line-height: 1.2;
  letter-spacing: 0;
}

.kouch-login h1 {
  margin: 0;
  color: var(--kouch-text);
  font-size: 24px;
  line-height: 1.45;
}

.kouch-login__lead,
.kouch-login__foot {
  margin: 0;
  color: var(--kouch-text-muted);
  font-size: 13px;
}

.kouch-login__form {
  display: grid;
  gap: 14px;
}

.kouch-login__field {
  display: grid;
  gap: 7px;
  color: var(--kouch-text);
  font-size: 13px;
  font-weight: 800;
}

.kouch-login__field input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--kouch-border);
  border-radius: 12px;
  padding: 10px 12px;
  background: #101214;
  color: var(--kouch-text);
  font: inherit;
}

.kouch-login__field input::placeholder {
  color: #737b84;
}

.kouch-login__field input:focus,
.kouch-login__password-toggle:focus,
.kouch-login__remember input:focus-visible,
.kouch-login__submit:focus {
  outline: 3px solid rgba(154, 203, 40, 0.24);
  outline-offset: 2px;
  border-color: rgba(154, 203, 40, 0.58);
}

.kouch-login__password {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
}

.kouch-login__password input {
  min-width: 0;
}

.kouch-login__password-toggle {
  min-height: 48px;
  border: 1px solid var(--kouch-border);
  border-radius: 12px;
  padding: 0 12px;
  background: var(--kouch-surface-elevated);
  color: var(--kouch-text-muted);
  font: inherit;
  font-size: 12px;
  font-weight: 900;
  cursor: pointer;
}

.kouch-login__password-toggle:hover {
  color: var(--kouch-text);
  background: var(--kouch-surface-hover);
}

.kouch-login__remember {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  color: var(--kouch-text-muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}

.kouch-login__remember input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--kouch-lime);
  cursor: pointer;
}

.kouch-login__submit {
  width: 100%;
  min-height: 48px;
  margin-top: 2px;
  border-color: rgba(79, 140, 255, 0.7);
  border-radius: 12px;
  background: var(--kouch-blue);
  box-shadow: 0 12px 24px rgba(79, 140, 255, 0.18);
}

.kouch-login__submit:hover {
  filter: brightness(1.08);
}

.kouch-login__notice {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  margin: 0;
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 800;
}

.kouch-login__notice span {
  flex: 0 0 auto;
  width: 9px;
  height: 9px;
  margin-top: 7px;
  border-radius: 999px;
}

.kouch-login__notice--error {
  border-color: rgba(255, 107, 107, 0.26);
  background: rgba(255, 107, 107, 0.11);
  color: #ffb4b4;
}

.kouch-login__notice--error span {
  background: var(--kouch-danger);
}

.kouch-login__notice--success {
  border-color: rgba(69, 194, 118, 0.26);
  background: rgba(69, 194, 118, 0.11);
  color: #9ee6b9;
}

.kouch-login__notice--success span {
  background: var(--kouch-success);
}

@media (prefers-reduced-motion: reduce) {
  .kouch-login__submit,
  .kouch-login__password-toggle {
    transition: none;
  }
}

@media (max-width: 520px) {
  .kouch-login-screen {
    padding: 20px;
  }

  .kouch-login__panel {
    border-radius: 18px;
    padding: 24px 18px;
  }

  .kouch-login h1 {
    font-size: 21px;
  }

  .kouch-login__password {
    grid-template-columns: 1fr;
  }
}

/* Semantic button color system. */
.kouch-button,
.kouch-button--secondary,
.kouch-button--ghost {
  border-color: var(--kouch-border);
  background: var(--kouch-secondary);
  color: var(--kouch-text);
  transition: background-color 140ms ease, border-color 140ms ease, color 140ms ease, filter 140ms ease;
}

.kouch-button:hover,
.kouch-button--secondary:hover,
.kouch-button--ghost:hover {
  background: var(--kouch-secondary-hover);
  color: var(--kouch-text);
}

.kouch-button--primary,
.kouch-login__submit {
  border-color: rgba(143, 191, 36, 0.66);
  background: var(--kouch-action);
  color: #10130d;
  box-shadow: none;
}

.kouch-button--primary:hover,
.kouch-login__submit:hover {
  background: var(--kouch-action-hover);
  color: #10130d;
  filter: none;
}

.kouch-button--success {
  border-color: rgba(53, 185, 111, 0.62);
  background: var(--kouch-success);
  color: #07130c;
}

.kouch-button--success:hover {
  background: #42c97d;
  color: #07130c;
}

.kouch-button--danger {
  border-color: rgba(216, 75, 75, 0.68);
  background: var(--kouch-danger);
  color: #fff;
}

.kouch-button--danger:hover,
.kouch-sidebar__logout.kouch-button--danger:hover {
  background: #e45a5a;
  color: #fff;
}

.kouch-sidebar__logout.kouch-button--danger {
  border-color: rgba(216, 75, 75, 0.68);
  background: var(--kouch-danger);
  color: #fff;
}

.kouch-button--warning {
  border-color: rgba(217, 154, 50, 0.68);
  background: var(--kouch-warning);
  color: #14100a;
}

.kouch-button--warning:hover {
  background: #e4a746;
  color: #14100a;
}

.kouch-button--export,
.kouch-export-actions .kouch-button,
.kouch-print-doc .kouch-button--export {
  border-color: rgba(255, 255, 255, 0.12);
  background: var(--kouch-export);
  color: var(--kouch-text-muted);
  box-shadow: none;
}

.kouch-button--export:hover,
.kouch-export-actions .kouch-button:hover,
.kouch-print-doc .kouch-button--export:hover {
  border-color: rgba(255, 255, 255, 0.2);
  background: #3d4248;
  color: var(--kouch-text);
}

.kouch-button--info {
  border-color: rgba(79, 134, 232, 0.64);
  background: var(--kouch-info);
  color: #fff;
}

.kouch-button--info:hover {
  background: #6596ed;
  color: #fff;
}

.kouch-button:focus,
.kouch-login__submit:focus {
  outline: 3px solid rgba(143, 191, 36, 0.28);
  outline-offset: 2px;
}

.kouch-button:disabled,
.kouch-button[aria-disabled="true"],
.kouch-login__submit:disabled,
.kouch-login__submit[aria-disabled="true"] {
  opacity: 0.52;
  cursor: not-allowed;
  filter: grayscale(0.24);
  box-shadow: none;
}

.kouch-button:disabled:hover,
.kouch-button[aria-disabled="true"]:hover,
.kouch-login__submit:disabled:hover,
.kouch-login__submit[aria-disabled="true"]:hover {
  filter: grayscale(0.24);
}

@media (prefers-reduced-motion: reduce) {
  .kouch-button {
    transition: none;
  }
}

html[data-kouch-theme="dark"],
.kouch-body[data-kouch-theme="dark"],
.kouch-app[data-kouch-theme="dark"] {
  --kouch-bg: #090b0d;
  --kouch-page-bg: #090b0d;
  --kouch-sidebar-bg: #111315;
  --kouch-surface: #17191b;
  --kouch-card: #17191b;
  --kouch-surface-elevated: #1d2023;
  --kouch-modal: #1d2023;
  --kouch-field: #0f1113;
  --kouch-surface-hover: #24272a;
  --kouch-text: #f5f7f8;
  --kouch-ink: #f5f7f8;
  --kouch-text-secondary: #cbd0d5;
  --kouch-text-muted: #9da3aa;
  --kouch-muted: #9da3aa;
  --kouch-brand-text: #e4e7eb;
  --kouch-border: #2a2e32;
  --kouch-line: #2a2e32;
  --kouch-border-strong: #3f464d;
  --kouch-focus-ring: rgba(154, 203, 40, 0.28);
  --kouch-shadow: 0 18px 42px rgba(0, 0, 0, 0.26);
  --kouch-shadow-strong: 0 24px 70px rgba(0, 0, 0, 0.42);
  --kouch-lime: #9acb28;
  --kouch-lime-dark: #4f6f0c;
  --kouch-gold: #d7a63a;
  --kouch-action: #8fbf24;
  --kouch-action-hover: #a1d52b;
  --kouch-success: #35b96f;
  --kouch-danger: #d84b4b;
  --kouch-warning: #d99a32;
  --kouch-info: #4f86e8;
  --kouch-blue: #4f86e8;
  --kouch-secondary: #25292d;
  --kouch-secondary-hover: #30353a;
  --kouch-export: #34383d;
  --kouch-disabled-bg: rgba(255, 255, 255, 0.035);
  --kouch-disabled-text: rgba(229, 231, 235, 0.52);
  --kouch-table-head: #17191b;
  --kouch-table-hover: rgba(255, 255, 255, 0.035);
  --kouch-overlay: rgba(0, 0, 0, 0.56);
  --kouch-scrollbar-track: #101214;
  --kouch-scrollbar-thumb: #3f464d;
  --kouch-document-surface: #17191b;
  --kouch-document-text: #f5f7f8;
  --kouch-document-heading: #ffffff;
  --kouch-document-muted: #aeb5bd;
  --kouch-document-border: #343a40;
  --kouch-document-table-header: #1f2327;
  --kouch-document-row-border: #30363c;
  --kouch-document-signature-line: #8d98a3;
  --kouch-document-watermark: rgba(245, 247, 248, 0.08);
  --kouch-black: var(--kouch-sidebar-bg);
}

html[data-kouch-theme="light"],
.kouch-body[data-kouch-theme="light"],
.kouch-app[data-kouch-theme="light"] {
  --kouch-bg: #f5f3ee;
  --kouch-page-bg: #f5f3ee;
  --kouch-sidebar-bg: #ffffff;
  --kouch-surface: #ffffff;
  --kouch-card: #ffffff;
  --kouch-surface-elevated: #fbfaf7;
  --kouch-modal: #ffffff;
  --kouch-field: #ffffff;
  --kouch-surface-hover: #f0ede6;
  --kouch-text: #1b1f23;
  --kouch-ink: #1b1f23;
  --kouch-text-secondary: #3f4750;
  --kouch-text-muted: #66707a;
  --kouch-muted: #66707a;
  --kouch-brand-text: #20251c;
  --kouch-border: #d9d3c7;
  --kouch-line: #d9d3c7;
  --kouch-border-strong: #bbb2a4;
  --kouch-focus-ring: rgba(117, 153, 24, 0.32);
  --kouch-shadow: 0 14px 34px rgba(54, 45, 30, 0.1);
  --kouch-shadow-strong: 0 24px 64px rgba(54, 45, 30, 0.14);
  --kouch-lime: #7fa719;
  --kouch-lime-dark: #506d10;
  --kouch-gold: #a87818;
  --kouch-action: #789f1d;
  --kouch-action-hover: #6d9219;
  --kouch-success: #168653;
  --kouch-danger: #c43636;
  --kouch-warning: #b46f12;
  --kouch-info: #2563c7;
  --kouch-blue: #2563c7;
  --kouch-secondary: #f6f4ef;
  --kouch-secondary-hover: #ebe6dc;
  --kouch-export: #efeae1;
  --kouch-disabled-bg: #ece8df;
  --kouch-disabled-text: #8f887d;
  --kouch-table-head: #f1eee7;
  --kouch-table-hover: #faf8f3;
  --kouch-overlay: rgba(26, 24, 20, 0.44);
  --kouch-scrollbar-track: #eee9df;
  --kouch-scrollbar-thumb: #b8ae9d;
  --kouch-document-surface: #ffffff;
  --kouch-document-text: #1b1f23;
  --kouch-document-heading: #111827;
  --kouch-document-muted: #66707a;
  --kouch-document-border: #d7dce2;
  --kouch-document-table-header: #f1f3f5;
  --kouch-document-row-border: #d7dce2;
  --kouch-document-signature-line: #111827;
  --kouch-document-watermark: rgba(15, 23, 42, 0.08);
  --kouch-black: var(--kouch-sidebar-bg);
  color-scheme: light;
}

.kouch-body {
  background:
    radial-gradient(circle at 18% 0%, color-mix(in srgb, var(--kouch-lime) 8%, transparent), transparent 28rem),
    var(--kouch-page-bg);
}

.kouch-login-screen {
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--kouch-lime) 10%, transparent), transparent 28rem),
    linear-gradient(145deg, color-mix(in srgb, var(--kouch-info) 8%, transparent), transparent 34rem),
    var(--kouch-page-bg);
}

.kouch-login__panel,
.kouch-card {
  border-color: var(--kouch-border);
  background: var(--kouch-card);
  box-shadow: var(--kouch-shadow);
}

.kouch-login__panel {
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--kouch-surface-elevated) 70%, transparent), transparent 120px),
    var(--kouch-card);
  box-shadow: var(--kouch-shadow-strong);
}

.kouch-sidebar,
.kouch-topbar {
  background: var(--kouch-sidebar-bg);
  color: var(--kouch-text);
}

.kouch-nav a {
  color: var(--kouch-text-secondary);
}

.kouch-nav__group,
.kouch-topbar__title span,
.kouch-sidebar__brand small {
  color: var(--kouch-text-muted);
}

.kouch-nav a:hover,
.kouch-nav a.is-active {
  background: var(--kouch-surface-hover);
  color: var(--kouch-text);
}

.kouch-global-search input,
.kouch-login__field input,
.kouch-form input:not([type="checkbox"]):not([type="radio"]):not([type="hidden"]),
.kouch-form select,
.kouch-form textarea,
.kouch-toolbar input,
.kouch-toolbar select {
  border-color: var(--kouch-border);
  background: var(--kouch-field);
  color: var(--kouch-text);
  caret-color: var(--kouch-text);
}

.kouch-global-search input::placeholder,
.kouch-login__field input::placeholder,
.kouch-form input::placeholder,
.kouch-form textarea::placeholder,
.kouch-toolbar input::placeholder {
  color: var(--kouch-text-muted);
}

.kouch-form input:read-only,
.kouch-form textarea:read-only,
.kouch-toolbar input:read-only {
  background: var(--kouch-surface-elevated);
}

.kouch-form input:disabled,
.kouch-form select:disabled,
.kouch-form textarea:disabled,
.kouch-toolbar input:disabled,
.kouch-toolbar select:disabled,
.kouch-button:disabled,
.kouch-button[aria-disabled="true"] {
  background: var(--kouch-disabled-bg);
  color: var(--kouch-disabled-text);
}

.kouch-form input:-webkit-autofill,
.kouch-form input:-webkit-autofill:hover,
.kouch-form input:-webkit-autofill:focus,
.kouch-form textarea:-webkit-autofill,
.kouch-form textarea:-webkit-autofill:hover,
.kouch-form textarea:-webkit-autofill:focus,
.kouch-form select:-webkit-autofill,
.kouch-form select:-webkit-autofill:hover,
.kouch-form select:-webkit-autofill:focus,
.kouch-toolbar input:-webkit-autofill,
.kouch-toolbar input:-webkit-autofill:hover,
.kouch-toolbar input:-webkit-autofill:focus,
.kouch-login__field input:-webkit-autofill,
.kouch-login__field input:-webkit-autofill:hover,
.kouch-login__field input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--kouch-text);
  caret-color: var(--kouch-text);
  box-shadow: 0 0 0 1000px var(--kouch-field) inset;
}

.kouch-form input:focus,
.kouch-form select:focus,
.kouch-form textarea:focus,
.kouch-global-search input:focus,
.kouch-login__field input:focus,
.kouch-button:focus,
.kouch-icon-button:focus,
.kouch-nav a:focus,
.kouch-theme-control__button:focus,
.kouch-theme-control__menu button:focus {
  outline: 3px solid var(--kouch-focus-ring);
  outline-offset: 2px;
}

.kouch-icon-button,
.kouch-login__password-toggle,
.kouch-jalali-picker__head button,
.kouch-jalali-picker__foot button,
.kouch-jalali-picker__grid button {
  border-color: var(--kouch-border);
  background: var(--kouch-surface-elevated);
  color: var(--kouch-text);
}

.kouch-icon-button span {
  background: var(--kouch-text);
}

.kouch-sidebar-overlay {
  background: var(--kouch-overlay);
}

.kouch-table th {
  background: var(--kouch-table-head);
  color: var(--kouch-text-muted);
}

.kouch-table tbody tr:hover {
  background: var(--kouch-table-hover);
}

.kouch-table--sticky thead th {
  background: var(--kouch-table-head);
}

.kouch-detail-list div,
.kouch-subpanel,
.kouch-media-preview {
  border-color: var(--kouch-border);
  background: var(--kouch-surface-elevated);
}

.kouch-empty,
.kouch-help,
.kouch-date-field small,
.kouch-toolbar label,
.kouch-search-results span,
.kouch-data-list small {
  color: var(--kouch-text-muted);
}

.kouch-alert--error,
.kouch-login__notice--error {
  border-color: color-mix(in srgb, var(--kouch-danger) 32%, transparent);
  background: color-mix(in srgb, var(--kouch-danger) 12%, transparent);
  color: var(--kouch-danger);
}

.kouch-alert--success,
.kouch-login__notice--success {
  border-color: color-mix(in srgb, var(--kouch-success) 32%, transparent);
  background: color-mix(in srgb, var(--kouch-success) 12%, transparent);
  color: var(--kouch-success);
}

.kouch-alert--warning {
  border-color: color-mix(in srgb, var(--kouch-warning) 32%, transparent);
  background: color-mix(in srgb, var(--kouch-warning) 12%, transparent);
  color: var(--kouch-warning);
}

.kouch-button--primary,
.kouch-login__submit {
  background: var(--kouch-action);
  color: #10130d;
}

.kouch-button--primary:hover,
.kouch-login__submit:hover {
  background: var(--kouch-action-hover);
  color: #10130d;
}

.kouch-button--export,
.kouch-export-actions .kouch-button {
  border-color: var(--kouch-border);
  background: var(--kouch-export);
  color: var(--kouch-text-secondary);
}

.kouch-button--export:hover,
.kouch-export-actions .kouch-button:hover {
  border-color: var(--kouch-border-strong);
  background: var(--kouch-secondary-hover);
  color: var(--kouch-text);
}

.kouch-jalali-picker {
  border-color: var(--kouch-border);
  background: var(--kouch-modal);
  box-shadow: var(--kouch-shadow-strong);
}

.kouch-theme-control {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.kouch-theme-control__button {
  display: inline-grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--kouch-border);
  border-radius: 8px;
  background: var(--kouch-secondary);
  color: var(--kouch-text);
  cursor: pointer;
  font: inherit;
}

.kouch-theme-control__button:hover {
  background: var(--kouch-secondary-hover);
}

.kouch-theme-control__icon {
  font-size: 20px;
  line-height: 1;
}

.kouch-theme-control__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: grid;
  min-width: 210px;
  gap: 4px;
  border: 1px solid var(--kouch-border);
  border-radius: 8px;
  padding: 6px;
  background: var(--kouch-modal);
  box-shadow: var(--kouch-shadow);
}

.kouch-theme-control__menu[hidden],
.kouch-theme-control__notice[hidden] {
  display: none;
}

.kouch-theme-control__menu button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 9px;
  width: 100%;
  min-height: 38px;
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 7px 10px;
  background: transparent;
  color: var(--kouch-text);
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  text-align: right;
}

.kouch-theme-control__heading {
  display: block;
  padding: 4px 8px 6px;
  color: var(--kouch-text-muted);
  font-size: 12px;
  font-weight: 900;
}

.kouch-theme-control__menu button:hover,
.kouch-theme-control__menu button[aria-pressed="true"] {
  border-color: var(--kouch-border);
  background: var(--kouch-surface-hover);
}

.kouch-theme-control__notice {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 21;
  width: min(280px, 80vw);
  margin: 0;
  border: 1px solid color-mix(in srgb, var(--kouch-danger) 34%, transparent);
  border-radius: 8px;
  padding: 8px 10px;
  background: var(--kouch-modal);
  color: var(--kouch-danger);
  font-size: 12px;
  font-weight: 800;
  box-shadow: var(--kouch-shadow);
}

.kouch-inline-control {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 38px;
  gap: 8px;
  align-items: center;
}

.kouch-inline-control .kouch-button {
  min-width: 38px;
  min-height: 38px;
  padding: 0;
  font-size: 18px;
  line-height: 1;
}

.kouch-print-toolbar {
  display: flex;
  justify-content: flex-start;
  gap: 8px;
  margin: 0 0 12px;
}

.kouch-combobox {
  position: relative;
  min-width: 220px;
}

.kouch-report-filter-form .kouch-combobox {
  width: 100%;
}

.kouch-combobox__list {
  position: absolute;
  z-index: 80;
  inset-inline: 0;
  top: calc(100% + 6px);
  max-height: 300px;
  overflow: auto;
  border: 1px solid var(--kouch-border);
  border-radius: 8px;
  background: var(--kouch-modal);
  box-shadow: var(--kouch-shadow);
}

.kouch-report-filter-form .kouch-combobox__list {
  inset-inline-start: 0;
  inset-inline-end: 0;
  top: calc(100% + 6px);
  width: 100%;
  max-height: min(300px, 42vh);
  z-index: 120;
  overscroll-behavior: contain;
}

.kouch-combobox__list--floating {
  position: fixed;
  inset-inline: auto;
  top: auto;
  right: auto;
  bottom: auto;
  left: auto;
  z-index: 1000;
  overscroll-behavior: contain;
}

.kouch-combobox__option {
  display: grid;
  width: 100%;
  gap: 3px;
  border: 0;
  border-bottom: 1px solid var(--kouch-border);
  padding: 8px 11px;
  background: transparent;
  color: var(--kouch-text);
  font: inherit;
  text-align: right;
  cursor: pointer;
}

.kouch-combobox__option:last-child {
  border-bottom: 0;
}

.kouch-combobox__option:hover,
.kouch-combobox__option.is-active {
  background: var(--kouch-surface-hover);
}

.kouch-combobox__option strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
  line-height: 1.45;
}

.kouch-combobox__option small,
.kouch-combobox__status {
  color: var(--kouch-text-muted);
  font-size: 12px;
  font-weight: 700;
}

.kouch-combobox__status {
  padding: 10px 12px;
}

.kouch-modal[hidden] {
  display: none;
}

.kouch-modal {
  position: fixed;
  z-index: 60;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.52);
}

.kouch-modal__panel {
  width: min(420px, 100%);
  border: 1px solid var(--kouch-border);
  border-radius: 8px;
  padding: 18px;
  background: var(--kouch-modal);
  color: var(--kouch-text);
  box-shadow: var(--kouch-shadow);
}

.kouch-modal__panel h2,
.kouch-modal__panel h3 {
  margin: 0 0 14px;
  font-size: 17px;
}

.kouch-modal__panel label {
  display: grid;
  gap: 7px;
  margin-bottom: 12px;
}

.kouch-modal__actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 16px;
}

.kouch-sidebar::-webkit-scrollbar,
.kouch-table-wrap::-webkit-scrollbar,
.kouch-jalali-picker::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

.kouch-sidebar::-webkit-scrollbar-track,
.kouch-table-wrap::-webkit-scrollbar-track,
.kouch-jalali-picker::-webkit-scrollbar-track {
  background: var(--kouch-scrollbar-track);
}

.kouch-sidebar::-webkit-scrollbar-thumb,
.kouch-table-wrap::-webkit-scrollbar-thumb,
.kouch-jalali-picker::-webkit-scrollbar-thumb {
  border: 2px solid var(--kouch-scrollbar-track);
  border-radius: 999px;
  background: var(--kouch-scrollbar-thumb);
}

html[data-kouch-theme="light"] .kouch-status--active,
html[data-kouch-theme="light"] .kouch-status--ok,
html[data-kouch-theme="light"] .kouch-status--confirmed,
.kouch-body[data-kouch-theme="light"] .kouch-status--active,
.kouch-body[data-kouch-theme="light"] .kouch-status--ok,
.kouch-body[data-kouch-theme="light"] .kouch-status--confirmed {
  background: color-mix(in srgb, var(--kouch-success) 12%, transparent);
  color: var(--kouch-success);
}

html[data-kouch-theme="light"] .kouch-status--low,
html[data-kouch-theme="light"] .kouch-status--draft,
.kouch-body[data-kouch-theme="light"] .kouch-status--low,
.kouch-body[data-kouch-theme="light"] .kouch-status--draft {
  background: color-mix(in srgb, var(--kouch-warning) 14%, transparent);
  color: var(--kouch-warning);
}

html[data-kouch-theme="light"] .kouch-status--out,
html[data-kouch-theme="light"] .kouch-status--negative,
html[data-kouch-theme="light"] .kouch-status--cancelled,
.kouch-body[data-kouch-theme="light"] .kouch-status--out,
.kouch-body[data-kouch-theme="light"] .kouch-status--negative,
.kouch-body[data-kouch-theme="light"] .kouch-status--cancelled {
  background: color-mix(in srgb, var(--kouch-danger) 12%, transparent);
  color: var(--kouch-danger);
}

html[data-kouch-theme="light"] .kouch-chart,
.kouch-body[data-kouch-theme="light"] .kouch-chart {
  background:
    linear-gradient(to top, rgba(27, 31, 35, 0.07) 1px, transparent 1px) 0 0 / 100% 25%,
    var(--kouch-surface-elevated);
}

@media (max-width: 760px) {
  .kouch-theme-control__menu {
    left: auto;
    right: 0;
  }
}

@media print {
  html[data-kouch-theme],
  .kouch-body[data-kouch-theme],
  .kouch-app[data-kouch-theme],
  .kouch-print-doc,
  .kouch-transaction-doc {
    --kouch-bg: #ffffff;
    --kouch-page-bg: #ffffff;
    --kouch-card: #ffffff;
    --kouch-surface: #ffffff;
    --kouch-field: #ffffff;
    --kouch-text: #111111;
    --kouch-ink: #111111;
    --kouch-muted: #555555;
    --kouch-line: #bbbbbb;
    --kouch-document-surface: #ffffff;
    --kouch-document-text: #111111;
    --kouch-document-heading: #111111;
    --kouch-document-muted: #555555;
    --kouch-document-border: #bbbbbb;
    --kouch-document-table-header: #f1f3f5;
    --kouch-document-row-border: #bbbbbb;
    --kouch-document-signature-line: #111111;
    --kouch-document-watermark: rgba(15, 23, 42, 0.08);
  }
}

/* Scoped Kouch UI typography and branding settings. */
.kouch-app,
.kouch-login-screen {
  --kouch-font-size-base: 13px;
  font-size: var(--kouch-font-size-base);
}

.kouch-app p,
.kouch-app li,
.kouch-app dd,
.kouch-app td,
.kouch-app th,
.kouch-app label,
.kouch-app input,
.kouch-app select,
.kouch-app textarea,
.kouch-app button,
.kouch-app .kouch-button,
.kouch-app .kouch-alert,
.kouch-app .kouch-toolbar,
.kouch-app .kouch-card,
.kouch-app .kouch-empty,
.kouch-login-screen p,
.kouch-login-screen label,
.kouch-login-screen input,
.kouch-login-screen button,
.kouch-login-screen .kouch-button {
  font-size: 1em;
}

.kouch-app small,
.kouch-app .kouch-help,
.kouch-app .kouch-nav__group,
.kouch-app .kouch-card__head p,
.kouch-app .kouch-toolbar label,
.kouch-login-screen .kouch-login__lead,
.kouch-login-screen .kouch-login__foot {
  font-size: 0.923em;
}

.kouch-app .kouch-sidebar__brand strong,
.kouch-login-screen .kouch-login__brand {
  font-size: 1.385em;
}

.kouch-app .kouch-topbar__title strong,
.kouch-app .kouch-card h2,
.kouch-app .kouch-modal__panel h2,
.kouch-app .kouch-modal__panel h3 {
  font-size: 1.308em;
}

.kouch-app .kouch-page-head h1,
.kouch-app .kouch-card h1,
.kouch-login-screen .kouch-login h1 {
  font-size: 1.846em;
}

.kouch-app .kouch-kpi span,
.kouch-app .kouch-data-list strong,
.kouch-app .kouch-status,
.kouch-app .kouch-table th,
.kouch-app .kouch-search-results span,
.kouch-app .kouch-metric span,
.kouch-app .kouch-health__grid span {
  font-size: 1em;
}

.kouch-sidebar__brand--logo {
  justify-content: center;
  min-height: 0;
  padding: 16px 20px;
}

.kouch-sidebar__brand--text {
  justify-content: flex-start;
}

.kouch-brand-logo {
  display: none;
  max-width: 150px;
  max-height: 42px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  margin: 0 auto;
}

.kouch-login__logo {
  display: none;
  max-width: min(220px, 72vw);
  max-height: 65px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  margin: 0 auto 28px;
}

html[data-kouch-theme="light"] .kouch-brand-logo--light,
html[data-kouch-theme="light"] .kouch-login__logo--light,
.kouch-body[data-kouch-theme="light"] .kouch-brand-logo--light,
.kouch-body[data-kouch-theme="light"] .kouch-login__logo--light,
html[data-kouch-theme="dark"] .kouch-brand-logo--dark,
html[data-kouch-theme="dark"] .kouch-login__logo--dark,
.kouch-body[data-kouch-theme="dark"] .kouch-brand-logo--dark,
.kouch-body[data-kouch-theme="dark"] .kouch-login__logo--dark {
  display: block;
}

.kouch-media-field--logo .kouch-media-preview img {
  max-width: 220px;
  max-height: 80px;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: 10px;
}

.kouch-settings-section .kouch-media-field {
  grid-template-columns: 1fr;
  gap: 10px;
  align-items: stretch;
}

.kouch-settings-section .kouch-media-preview {
  display: grid;
  width: 100%;
  min-height: 100px;
  max-height: 130px;
  place-items: center;
  background:
    linear-gradient(180deg, color-mix(in srgb, var(--kouch-field) 88%, transparent), color-mix(in srgb, var(--kouch-surface) 92%, transparent));
}

.kouch-settings-section .kouch-media-preview.is-empty {
  border-style: dashed;
}

.kouch-settings-section .kouch-media-preview.is-empty span {
  color: var(--kouch-text-muted);
  font-size: 0.923em;
}

.kouch-font-preview {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(180px, 0.8fr) auto;
  gap: 10px;
  align-items: end;
  border: 1px solid var(--kouch-line);
  border-radius: 8px;
  padding: 12px;
  background: color-mix(in srgb, var(--kouch-field) 76%, transparent);
  font-size: var(--kouch-font-size-base);
}

.kouch-font-preview p,
.kouch-font-preview label {
  margin: 0;
  font-size: 1em;
}

.kouch-font-preview label {
  display: grid;
  gap: 6px;
}

.kouch-font-preview__table {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  grid-column: 1 / -1;
  border: 1px solid var(--kouch-line);
  border-radius: 8px;
  overflow: hidden;
}

.kouch-font-preview__table span,
.kouch-font-preview__table strong,
.kouch-font-preview__table em {
  min-width: 0;
  padding: 8px 10px;
  font-size: 1em;
  font-style: normal;
}

.kouch-font-preview__table span,
.kouch-font-preview__table strong {
  border-left: 1px solid var(--kouch-line);
}

@media (max-width: 760px) {
  .kouch-font-preview {
    grid-template-columns: 1fr;
  }
}

@page {
  size: A4 landscape;
  margin: 8mm;
}

@media print {
  html,
  body,
  .kouch-body,
  .kouch-app-screen,
  .kouch-app,
  .kouch-content {
    width: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
    background: #ffffff !important;
    color: #111111 !important;
    font-family: "Vazirmatn", Tahoma, Arial, sans-serif !important;
    direction: rtl !important;
  }

  .kouch-sidebar,
  .kouch-sidebar-overlay,
  .kouch-topbar,
  .kouch-global-search,
  .kouch-toolbar,
  .kouch-print-toolbar,
  .kouch-actions,
  .kouch-modal,
  .kouch-button,
  .kouch-icon-button,
  .kouch-theme-control,
  .kouch-print-doc .kouch-button {
    display: none !important;
  }

  .kouch-app {
    display: block !important;
  }

  .kouch-content > *:not(.kouch-print-doc) {
    display: none !important;
  }

  .kouch-print-doc,
  .kouch-card.kouch-print-doc {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    padding: 0 !important;
    box-shadow: none !important;
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 9pt !important;
    line-height: 1.35 !important;
  }

  .kouch-print-doc .kouch-page-head {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    justify-content: space-between !important;
    gap: 6mm !important;
    margin: 0 0 5mm !important;
    padding: 0 0 3mm !important;
    border-bottom: 0.5pt solid #222222 !important;
    break-after: avoid !important;
    page-break-after: avoid !important;
  }

  .kouch-print-doc .kouch-page-head h1 {
    margin: 0 0 1mm !important;
    color: #111111 !important;
    font-size: 15pt !important;
    line-height: 1.25 !important;
  }

  .kouch-print-doc .kouch-page-head p,
  .kouch-print-doc p {
    margin: 0 !important;
    color: #111111 !important;
  }

  .kouch-print-doc .kouch-health__grid {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 2.5mm !important;
    margin: 0 0 4mm !important;
    break-after: avoid !important;
    page-break-after: avoid !important;
  }

  .kouch-print-doc .kouch-health__grid div {
    display: block !important;
    min-height: 0 !important;
    border: 0.5pt solid #c8c8c8 !important;
    border-radius: 0 !important;
    padding: 2mm 2.3mm !important;
    background: #ffffff !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .kouch-print-doc .kouch-health__grid span {
    display: block !important;
    margin: 0 0 0.8mm !important;
    color: #555555 !important;
    font-size: 7.5pt !important;
    line-height: 1.25 !important;
  }

  .kouch-print-doc .kouch-health__grid strong {
    display: block !important;
    color: #111111 !important;
    font-size: 9pt !important;
    line-height: 1.3 !important;
    overflow-wrap: anywhere !important;
  }

  .kouch-print-doc .kouch-document-lines,
  .kouch-print-doc .kouch-table {
    width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    border-collapse: collapse !important;
    table-layout: fixed !important;
    break-inside: auto !important;
    page-break-inside: auto !important;
  }

  .kouch-print-doc .kouch-document-lines thead {
    display: table-header-group !important;
  }

  .kouch-print-doc .kouch-document-lines tbody {
    display: table-row-group !important;
  }

  .kouch-print-doc .kouch-document-lines tr {
    display: table-row !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .kouch-print-doc .kouch-document-lines th,
  .kouch-print-doc .kouch-document-lines td {
    display: table-cell !important;
    border: 0.5pt solid #9aa0a6 !important;
    padding: 1.8mm 2mm !important;
    background: #ffffff !important;
    color: #111111 !important;
    font-size: 8.3pt !important;
    line-height: 1.3 !important;
    vertical-align: top !important;
    overflow-wrap: anywhere !important;
  }

  .kouch-print-doc .kouch-document-lines td::before {
    content: none !important;
  }

  .kouch-print-doc .kouch-document-lines th {
    background: #eef1f4 !important;
    color: #222222 !important;
    font-weight: 800 !important;
  }

  .kouch-print-doc .kouch-document-lines .kouch-col-product-code {
    width: 13% !important;
    white-space: nowrap !important;
  }

  .kouch-print-doc .kouch-document-lines .kouch-col-product {
    width: 27% !important;
  }

  .kouch-print-doc .kouch-document-lines .kouch-col-quantity {
    width: 8% !important;
    white-space: nowrap !important;
  }

  .kouch-print-doc .kouch-document-lines .kouch-col-unit {
    width: 10% !important;
    white-space: nowrap !important;
  }

  .kouch-print-doc .kouch-document-lines .kouch-col-line-description {
    width: 42% !important;
  }

  .kouch-print-doc > p {
    margin: 3mm 0 0 !important;
    color: #111111 !important;
    font-size: 9pt !important;
    line-height: 1.35 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .kouch-print-doc > p strong {
    color: #111111 !important;
  }

  .kouch-signatures {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 6mm !important;
    margin-top: 12mm !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }

  .kouch-signatures div {
    min-height: 22mm !important;
    border-top: 0.5pt solid #111111 !important;
    padding-top: 3mm !important;
    color: #111111 !important;
    text-align: center !important;
    font-size: 9pt !important;
    font-weight: 800 !important;
    break-inside: avoid !important;
    page-break-inside: avoid !important;
  }
}
