:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --panel-soft: #fafbfc;
  --line: #dde2e8;
  --line-strong: #c7ced7;
  --text: #161a1f;
  --muted: #68717d;
  --muted-2: #8b95a1;
  --blue: #1f5fa8;
  --blue-2: #eef5ff;
  --green: #1fa463;
  --yellow: #e2ad00;
  --red: #d83b56;
  --dark: #4d5965;
  --shadow: 0 16px 44px rgba(20, 30, 45, 0.12);
  --radius: 8px;
  color-scheme: light;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body,
#app {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled,
input:disabled,
select:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

a {
  color: var(--blue);
  text-decoration: none;
}

.boot-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: var(--muted);
}

.boot-mark,
.brand-mark {
  width: 46px;
  height: 46px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: #164f8d;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(320px, 440px) 1fr;
  background: #f3f6fa;
}

.login-panel {
  background: #fff;
  padding: 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-right: 1px solid var(--line);
}

.login-panel h1 {
  font-size: 30px;
  margin: 24px 0 8px;
}

.login-panel p {
  color: var(--muted);
  margin: 0 0 28px;
  line-height: 1.5;
}

.login-art {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 42px;
  background:
    linear-gradient(135deg, rgba(255, 255, 255, 0.78), rgba(255, 255, 255, 0.36)),
    repeating-linear-gradient(90deg, transparent 0 34px, rgba(31, 95, 168, 0.08) 34px 35px),
    repeating-linear-gradient(0deg, transparent 0 34px, rgba(31, 95, 168, 0.08) 34px 35px),
    #eaf0f7;
}

.login-stat-grid {
  width: min(680px, 100%);
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.login-stat {
  background: rgba(255,255,255,0.78);
  border: 1px solid rgba(197, 207, 219, 0.9);
  padding: 22px;
  border-radius: var(--radius);
  box-shadow: 0 10px 30px rgba(35, 50, 70, 0.07);
}

.login-stat strong {
  display: block;
  font-size: 28px;
  margin-bottom: 6px;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 164px minmax(0, 1fr);
}

.app-shell.sidebar-collapsed {
  grid-template-columns: 64px minmax(0, 1fr);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
  background: #f4f5f7;
  border-right: 1px solid var(--line);
  padding: 14px 10px;
  display: flex;
  flex-direction: column;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 8px 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 10px;
}

.brand-mark {
  width: 32px;
  height: 32px;
  border-radius: 9px;
  font-size: 12px;
}

.brand-text {
  min-width: 0;
}

.brand-text strong,
.brand-text span {
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.brand-text span {
  color: var(--muted);
  font-size: 12px;
}

.nav-list {
  display: grid;
  gap: 3px;
  align-content: start;
}

.nav-item {
  width: 100%;
  border: 0;
  background: transparent;
  color: #20242a;
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 0 10px;
  border-radius: var(--radius);
  text-align: left;
}

.nav-item:hover {
  background: #fff;
}

.nav-item.active {
  background: #e6edf7;
  color: var(--blue);
}

.nav-subgroup {
  border-top: 1px solid var(--line);
  margin-top: 8px;
  padding-top: 8px;
  display: grid;
  gap: 3px;
}

.nav-item.sub-nav {
  min-height: 34px;
  padding-left: 22px;
  font-size: 12px;
}

.sidebar-bottom {
  margin-top: auto;
  border-top: 1px solid var(--line);
  padding-top: 8px;
  display: grid;
  gap: 4px;
}

.danger-nav {
  color: var(--red);
}

.app-shell.sidebar-collapsed .sidebar {
  padding-left: 9px;
  padding-right: 9px;
}

.app-shell.sidebar-collapsed .brand {
  justify-content: center;
  padding-left: 0;
  padding-right: 0;
}

.app-shell.sidebar-collapsed .brand-text,
.app-shell.sidebar-collapsed .nav-item span:not(.nav-icon),
.app-shell.sidebar-collapsed .nav-subgroup {
  display: none;
}

.app-shell.sidebar-collapsed .nav-item {
  justify-content: center;
  padding: 0;
}

.nav-icon {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  color: inherit;
}

.nav-icon svg {
  width: 19px;
  height: 19px;
  display: block;
}

.main {
  min-width: 0;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  min-height: 58px;
  background: rgba(246, 247, 249, 0.92);
  backdrop-filter: blur(12px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 18px;
  border-bottom: 1px solid var(--line);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
  flex: 0 0 auto;
}

.topbar-actions {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  justify-content: center;
  padding: 0 14px;
}

.icon-btn.mobile-menu {
  display: none;
}

.page-title {
  display: flex;
  flex-direction: column;
  min-width: 0;
  max-width: 150px;
}

.page-title strong {
  font-size: 15px;
}

.page-title span {
  color: var(--muted);
  font-size: 12px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
}

.stream-pill {
  border: 1px solid #b7dfc7;
  color: #18734a;
  background: #ecfdf3;
  border-radius: 999px;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 800;
}

.avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #c61d59;
  color: #fff;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.logout-icon {
  display: none;
}

.page {
  padding: 16px 16px 96px;
}

.toolbar,
.filters,
.tabbar,
.split-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.split-toolbar {
  justify-content: space-between;
}

.tabbar {
  gap: 18px;
}

.compact-tabs {
  gap: 14px;
  white-space: nowrap;
}

.tab {
  border: 0;
  background: transparent;
  color: #4d5560;
  padding: 8px 0;
  border-bottom: 2px solid transparent;
}

.tab.active {
  color: var(--blue);
  border-color: var(--blue);
}

.btn,
.icon-btn,
.primary-btn,
.danger-btn,
.ghost-btn {
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  min-height: 38px;
  border-radius: var(--radius);
  padding: 0 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-weight: 600;
}

.icon-btn {
  width: 38px;
  padding: 0;
}

.primary-btn {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.danger-btn {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

.ghost-btn {
  border-color: transparent;
  background: transparent;
}

.btn:hover,
.icon-btn:hover,
.ghost-btn:hover {
  border-color: #aeb8c4;
  background: #fdfdfd;
}

.floating-ticket {
  position: fixed;
  right: 28px;
  bottom: 24px;
  min-width: 116px;
  height: 52px;
  border-radius: 26px;
  box-shadow: 0 12px 28px rgba(31, 95, 168, 0.35);
  z-index: 25;
}

.search-wrap {
  flex: 1 1 420px;
  min-width: min(100%, 280px);
  position: relative;
}

.topbar-search {
  flex: 0 1 300px;
  max-width: 300px;
  min-width: 220px;
}

.tickets-topbar-controls,
.dashboard-actions {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  min-width: 0;
}

.dashboard-actions {
  justify-content: center;
}

.dash-date {
  width: 112px;
  min-width: 112px;
  padding-left: 8px;
  padding-right: 8px;
}

.ticket-sort-select {
  width: 94px !important;
  min-width: 94px;
}

.search-input,
.field input,
.field select,
.field textarea,
.textarea,
.compact-input {
  width: 100%;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  border-radius: var(--radius);
  min-height: 38px;
  padding: 9px 11px;
  outline: none;
}

.search-input {
  border-radius: 7px;
  padding-left: 42px;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--muted);
}

.search-input:focus,
.field input:focus,
.field select:focus,
.field textarea:focus,
.textarea:focus,
.compact-input:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(31, 95, 168, 0.12);
}

.suggestions {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 50;
  max-height: 310px;
  overflow-y: auto;
}

.suggestion {
  width: 100%;
  border: 0;
  background: #fff;
  padding: 8px 12px;
  text-align: left;
  display: block;
}

.suggestion:hover,
.suggestion.active {
  background: #f3f7fc;
}

.suggestion span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 2px;
}

.table-shell {
  background: #fff;
  border-top: 1px solid var(--line);
  margin-top: 8px;
  overflow-x: auto;
}

.tickets-table {
  table-layout: fixed;
  width: max-content;
  min-width: 100%;
}

.tickets-topbar-controls select#ticket-sort-mode {
    max-width: 150px;
}

.page-filter-strip {
  margin-bottom: 4px;
}

.ticket-row {
  cursor: pointer;
}

.ticket-row:hover td {
  background: #f8fbff;
}

.ticket-row.selected td {
  background: #eef6ff;
}

table {
  width: 100%;
  border-collapse: collapse;
}

th,
td {
  border-bottom: 1px solid var(--line);
  padding: 8px 14px;
  text-align: left;
  vertical-align: middle;
  white-space: nowrap;
}

th {
  color: #111;
  font-weight: 700;
  background: #fafafa;
  position: relative;
}

.resize-handle {
  position: absolute;
  top: 0;
  right: -4px;
  width: 8px;
  height: 100%;
  cursor: col-resize;
  z-index: 2;
}

.resize-handle::after {
  content: "";
  position: absolute;
  right: 3px;
  top: 20%;
  bottom: 20%;
  border-right: 1px solid #cbd5e1;
}

td.wrap,
th.wrap {
  white-space: normal;
  min-width: 190px;
}

.tickets-table td,
.tickets-table th {
  overflow: hidden;
  text-overflow: ellipsis;
}

.tickets-table td.wrap,
.tickets-table th.wrap {
  min-width: 0;
  white-space: normal;
}

.tickets-table .status-stack {
  gap: 3px;
  flex-wrap: wrap;
  max-width: 100%;
}

.tickets-table .status-pill {
  min-height: 22px;
  border-radius: 7px;
  padding: 0 6px;
  gap: 4px;
  font-size: 11px;
  line-height: 1;
  max-width: 100%;
}

.tickets-table .pay-dot {
  width: 14px;
  height: 14px;
  font-size: 9px;
}

.muted {
  color: var(--muted);
}

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

.linkish {
  color: #0866d8;
}

.status-pill,
.severity-pill {
  border: 0;
  color: #fff;
  min-height: 30px;
  border-radius: var(--radius);
  padding: 0 10px;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}

.pay-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-grid;
  place-items: center;
  background: rgba(255,255,255,0.2);
  color: #fff;
  font-size: 11px;
  font-weight: 900;
}

.status-stack {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  flex-wrap: nowrap;
}

.status-NEW { background: #3a7bd5; }
.status-PENDING { background: #e0ae00; color: #fff; }
.status-IN_PROGRESS { background: #5b6ee1; }
.status-REPAIRED { background: #78c61f; }
.status-DELIVERED { background: #2ebd6b; }
.status-NO_PROBLEM { background: #4b5563; }
.status-NON_REPAIRABLE { background: #e24747; }
.status-SOLD { background: #d92e55; }
.status-CANCELLED { background: #64748b; }
.status-CLOSED_SUCCESSFULLY { background: #2ebd6b; }
.status-CLOSED_UNSUCCESSFULLY { background: #64748b; }

.severity-pill {
  min-height: 24px;
  font-size: 12px;
  background: #65717f;
}

.row-actions {
  display: flex;
  gap: 6px;
}

.compact-danger,
.tiny-danger {
  min-height: 34px;
  padding: 0 10px;
}

.tiny-danger {
  min-height: 30px;
  font-size: 12px;
}

.payment-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  background: #eef2f7;
  color: #475569;
}

.pay-PAID { background: #e8f8ef; color: #18734a; }
.pay-PARTIAL { background: #fff7df; color: #986a00; }
.pay-UNPAID,
.pay-PENDING { background: #feecef; color: #bd2745; }
.pay-OVERDUE { background: #fee2e2; color: #991b1b; }

.client-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  display: inline-block;
  margin-right: 7px;
  vertical-align: middle;
  background: #94a3b8;
  box-shadow: 0 0 0 2px rgba(148, 163, 184, 0.15);
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.metric-card,
.panel,
.list-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.metric-card {
  padding: 16px;
  position: relative;
}

.metric-card span {
  color: var(--muted);
  display: block;
}

.metric-card strong {
  display: block;
  font-size: 25px;
  margin-top: 7px;
}

.trend-card small {
  position: absolute;
  right: 12px;
  top: 12px;
  font-size: 11px;
  font-weight: 800;
}

.trend-good { color: #17834f; }
.trend-bad { color: #d83b56; }

.panel {
  padding: 16px;
  margin-top: 14px;
}

.panel h2,
.modal h2 {
  font-size: 18px;
  margin: 0 0 12px;
}

.panel h3 {
  margin: 0 0 10px;
  font-size: 15px;
}

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

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

.field {
  display: grid;
  gap: 6px;
  margin-bottom: 12px;
  position: relative;
}

.field label {
  color: #38404a;
  font-weight: 700;
  font-size: 13px;
}

.required::after {
  content: " *";
  color: var(--red);
}

.hint {
  color: var(--muted);
  font-size: 12px;
}

.compact-note {
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 10px;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 18px;
}

.modal {
  width: min(1080px, 100%);
  max-height: min(92vh, 980px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 10px;
  box-shadow: var(--shadow);
}

.modal.small {
  width: min(560px, 100%);
}

.modal.ticket-form-modal {
  width: min(1180px, 100%);
  border-radius: 12px;
}

.modal.ticket-detail-modal {
  width: min(1160px, 100%);
  border-radius: 12px;
}

.modal-header,
.modal-footer {
  min-height: 58px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-bottom: 1px solid var(--line);
}

.modal-header-actions {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.header-action-btn {
  width: 38px;
  height: 38px;
  border-color: var(--line-strong);
  background: #fff;
}

.header-action-btn.primary-icon {
  background: var(--blue);
  border-color: var(--blue);
  color: #fff;
}

.header-action-btn.danger-icon {
  background: #cf4357;
  border-color: #cf4357;
  color: #fff;
}

.modal-footer {
  border-bottom: 0;
  border-top: 1px solid var(--line);
  justify-content: flex-end;
}

.modal-body {
  padding: 16px;
  overflow: auto;
}

.ticket-form-modal .modal-body {
  background: #fbfdff;
  padding: 16px 18px;
}

.detail-compact {
  display: grid;
  gap: 12px;
}

.detail-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 12px;
}

.detail-head strong,
.detail-head span {
  display: block;
}

.detail-head span {
  color: var(--muted);
  margin-top: 3px;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.detail-grid div,
.detail-note,
.detail-money {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px;
}

.detail-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-bottom: 4px;
}

.detail-grid strong {
  font-size: 13px;
}

.detail-note {
  line-height: 1.45;
}

.detail-money {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  font-weight: 800;
}

.detail-money span {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 10px;
}

.detail-section {
  margin-top: 14px;
}

.detail-section h3 {
  margin: 0 0 8px;
  font-size: 14px;
}

.compact-empty {
  padding: 12px;
}

.ticket-type-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 0;
  flex: 1;
}

.ticket-form-head {
  display: flex;
  align-items: stretch;
  gap: 12px;
  margin-bottom: 14px;
}

.ticket-type-card {
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  padding: 14px 16px;
  text-align: left;
  display: grid;
  grid-template-columns: 28px 1fr;
  column-gap: 12px;
  align-items: center;
}

.ticket-type-card.active {
  border-color: var(--blue);
  background: var(--blue-2);
  box-shadow: 0 0 0 3px rgba(31, 95, 168, 0.08);
}

.ticket-type-card strong {
  display: block;
  margin-bottom: 4px;
}

.ticket-type-card .hint {
  grid-column: 2;
}

.type-icon,
.ticket-section-title span {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  color: var(--blue);
  background: #eef6ff;
  font-weight: 900;
}

.ticket-section-title svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.ticket-form-card {
  margin-top: 0;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.03);
}

.ticket-section-title {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  font-size: 15px;
}

.info-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  align-items: start;
}

.info-field-grid .compact-note {
  min-height: 42px;
  display: flex;
  align-items: center;
}

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

.product-card {
  padding-bottom: 12px;
}

.add-product-btn {
  color: var(--blue);
  font-weight: 800;
}

kbd {
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 1px 5px;
  background: #f8fafc;
  color: #334155;
  font-size: 11px;
}

.chip-row {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border-radius: 16px;
  background: #eef2f7;
  color: #253040;
  padding: 5px 9px;
  font-size: 12px;
}

.chip button {
  border: 0;
  background: transparent;
  color: #5d6773;
  padding: 0;
}

.image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px;
}

.image-grid-compact {
  grid-template-columns: repeat(auto-fill, minmax(62px, 62px));
  margin: -2px 0 12px;
}

.image-icon-upload {
  width: 100px;
  min-width: 100px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  background: #fff;
  display: grid;
  place-items: center;
  gap: 2px;
  padding: 8px 6px;
  cursor: pointer;
  text-align: center;
}

.image-icon-upload input {
  display: none;
}

.image-icon-upload span {
  font-size: 24px;
  line-height: 1;
  color: var(--blue);
}

.image-icon-upload small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.image-thumb {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  aspect-ratio: 1;
  background: #f1f3f6;
}

.image-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.image-thumb button {
  position: absolute;
  right: 5px;
  top: 5px;
  border: 0;
  border-radius: 50%;
  width: 24px;
  height: 24px;
}

.item-row {
  display: grid;
  grid-template-columns: minmax(150px, 1.4fr) 84px 110px 110px minmax(120px, 1fr) 38px;
  gap: 8px;
  align-items: start;
  margin-bottom: 8px;
}

.checkbox-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 8px;
}

.print-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  margin-top: 14px;
}

.print-title {
  margin: 0;
  white-space: nowrap;
}

.print-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.print-options .check-line {
  min-height: 30px;
  padding: 5px 8px;
}

.check-line {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  min-height: 40px;
  padding: 8px 10px;
  background: #fff;
}

.empty-state,
.error-state {
  padding: 28px;
  text-align: center;
  color: var(--muted);
}

.error-state {
  color: var(--red);
}

.skeleton {
  height: 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #e9edf2, #f7f8fa, #e9edf2);
  background-size: 200% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  to { background-position: -200% 0; }
}

.toast-root {
  position: fixed;
  right: 16px;
  bottom: 16px;
  display: grid;
  gap: 8px;
  z-index: 200;
}

.toast {
  background: #111827;
  color: #fff;
  border-radius: var(--radius);
  padding: 11px 13px;
  min-width: 220px;
  max-width: 360px;
  box-shadow: var(--shadow);
}

.toast.error {
  background: #b91c1c;
}

.status-menu {
  position: fixed;
  z-index: 180;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 7px;
  width: 168px;
  max-height: 310px;
  overflow-y: auto;
}

.status-menu button {
  width: 100%;
  border: 0;
  background: transparent;
  padding: 5px;
  text-align: left;
  border-radius: 6px;
}

.status-menu .status-pill {
  min-height: 24px;
  padding: 0 9px;
  font-size: 12px;
}

.status-menu-title {
  padding: 7px 6px 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 900;
  text-transform: uppercase;
}

.status-menu-hint {
  margin: 7px 6px 4px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.35;
}

.status-editor-row {
  display: grid;
  grid-template-columns: minmax(92px, 0.75fr) minmax(130px, 1fr) 74px 74px auto auto 38px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 8px;
  background: #fff;
}

.mini-color {
  display: grid;
  gap: 3px;
  color: var(--muted);
  font-size: 11px;
  font-weight: 800;
}

.mini-color input {
  width: 54px;
  height: 34px;
  border: 1px solid var(--line);
  border-radius: 7px;
  padding: 2px;
  background: #fff;
}

.data-lock-row {
  display: grid;
  grid-template-columns: minmax(130px, 1fr) 132px 132px auto 38px;
  gap: 8px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 8px;
}

.menu-editor-row {
  display: grid;
  grid-template-columns: 30px minmax(130px, 0.8fr) minmax(180px, 1.2fr);
  gap: 8px;
  align-items: start;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 8px;
  margin-bottom: 8px;
}

.column-order-no {
  width: 24px;
  height: 24px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #eef2f7;
  color: #475569;
  font-size: 12px;
  font-weight: 800;
}

.shortcut-list {
  display: grid;
  gap: 8px;
}

.shortcut-list div {
  display: flex;
  align-items: center;
  gap: 10px;
}

.status-key-input {
  text-transform: uppercase;
}

.mini-check {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 800;
  color: var(--muted);
}

.status-menu button:hover {
  background: #f4f7fb;
}

.bar-chart {
  display: grid;
  gap: 8px;
}

.bar-line {
  display: grid;
  grid-template-columns: 88px 1fr 82px;
  gap: 8px;
  align-items: center;
}

.bar-track {
  height: 9px;
  background: #e9edf2;
  border-radius: 999px;
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  background: var(--blue);
}

.banner {
  margin: 12px 16px 0;
  background: #fff8e1;
  border: 1px solid #f1d26c;
  color: #654800;
  border-radius: var(--radius);
  padding: 10px 12px;
  display: none;
}

.banner.show {
  display: block;
}

.drawer-open .sidebar {
  transform: translateX(0);
}

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

  .app-shell.sidebar-collapsed {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: fixed;
    z-index: 80;
    width: 240px;
    transform: translateX(-105%);
    transition: transform 0.18s ease;
    box-shadow: var(--shadow);
  }

  .icon-btn.mobile-menu {
    display: inline-flex;
  }

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

  .app-shell.sidebar-collapsed .brand-text,
  .app-shell.sidebar-collapsed .nav-item span:not(.nav-icon) {
    display: inline;
  }

  .app-shell.sidebar-collapsed .nav-subgroup {
    display: grid;
  }

  .topbar {
    flex-wrap: wrap;
  }

  .topbar-actions {
    order: 3;
    width: 100%;
    padding: 8px 0 0;
    justify-content: flex-start;
    overflow-x: auto;
  }

  .tickets-topbar-controls,
  .dashboard-actions {
    justify-content: flex-start;
    width: max-content;
  }

}

@media (max-width: 720px) {
  body {
    font-size: 13px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-art {
    display: none;
  }

  .login-panel {
    padding: 28px;
    min-height: 100vh;
  }

  .page {
    padding: 12px 10px 88px;
  }

  .topbar {
    padding: 9px 10px;
  }

  .topbar-right .btn-label,
  .topbar-right .user-name {
    display: none;
  }

  .logout-icon {
    display: inline;
  }

  .card-grid,
  .grid-2,
  .grid-3,
  .ticket-type-grid,
  .form-inline-2,
  .info-field-grid {
    grid-template-columns: 1fr;
  }

  .ticket-form-head {
    flex-direction: column;
  }

  .image-icon-upload {
    width: 100%;
    min-width: 0;
    grid-template-columns: auto auto;
    justify-content: center;
  }

  .modal-backdrop {
    padding: 0;
    align-items: stretch;
  }

  .modal {
    border-radius: 0;
    max-height: 100vh;
    height: 100vh;
  }

  .item-row {
    grid-template-columns: 1fr 1fr;
  }

  .item-row .wide,
  .item-row .item-note {
    grid-column: 1 / -1;
  }

  .floating-ticket {
    right: 14px;
    bottom: 14px;
  }

  th,
  td {
    padding: 7px 10px;
  }

  .topbar-search {
    min-width: 190px;
    max-width: 260px;
  }

  .detail-grid {
    grid-template-columns: 1fr 1fr;
  }

  .detail-head {
    flex-direction: column;
  }

  .status-editor-row {
    grid-template-columns: 1fr 1fr;
  }

  .menu-editor-row {
    grid-template-columns: 1fr;
  }

  .data-lock-row {
    grid-template-columns: 1fr;
  }

  .status-editor-row .icon-btn {
    width: 100%;
  }
}
