:root {
  --bg: #f6f4ef;
  --card: #ffffff;
  --text: #1f2933;
  --muted: #6b7280;
  --border: #e7e2d8;
  --dark: #18222f;
  --dark-soft: #263445;
  --gold: #b89146;
  --gold-soft: #f4ead3;
  --danger: #b91c1c;
  --success: #16803c;
  --shadow: 0 10px 28px rgba(24, 34, 47, 0.10);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html, body {
  overscroll-behavior: none;
  height: 100%;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(135deg, #f9f7f1, var(--bg), #eee9df);
  color: var(--text);
  min-height: 100vh;
  -webkit-tap-highlight-color: transparent;
}

/* Touch-device tuning (tablet/phone app usage) - not used on desktop mouse browsing */
@media (hover: none) and (pointer: coarse) {
  a, button, .btn, input, select, textarea {
    touch-action: manipulation;
  }

  * {
    -webkit-tap-highlight-color: transparent;
  }
}

header {
  background: rgba(24, 34, 47, 0.96);
  color: white;
  padding: 18px 34px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 26px rgba(0,0,0,0.18);
  position: sticky;
  top: 0;
  z-index: 1000;
}

.brand {
  font-size: 22px;
  font-weight: 800;
}

nav {
  display: flex;
  gap: 10px;
}

nav a {
  color: white;
  text-decoration: none;
  padding: 9px 14px;
  border-radius: 999px;
  font-weight: 700;
}

nav a:hover {
  background: rgba(255,255,255,0.12);
}

main {
  padding: 32px;
  max-width: 1500px;
  margin: 0 auto;
}

.catalog-title {
  font-size: 36px;
  margin-bottom: 18px;
}

/* HOME */
.hero {
  background: linear-gradient(135deg, white, #fbf7ec);
  padding: 60px 34px;
  border-radius: 28px;
  text-align: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.hero h1 {
  font-size: 46px;
  margin-bottom: 10px;
}

.hero p {
  font-size: 18px;
  color: var(--muted);
}

.button,
button {
  background: linear-gradient(135deg, var(--dark), var(--dark-soft));
  color: white;
  border: none;
  cursor: pointer;
  font-weight: 800;
}

/* FILTER BAR */
.filter-bar {
  background: rgba(255,255,255,0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  margin-bottom: 18px;
  position: relative;
  z-index: 100;
}

.new-filter-bar {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-top-row {
  display: grid;
  grid-template-columns: 48px 170px 135px 135px 135px 135px 82px 70px;
  gap: 10px;
  align-items: end;
}

.filter-group {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
}

.filter-group label,
.hidden-search-input label {
  font-size: 11px;
  font-weight: 900;
  color: var(--dark);
}

.big-search-icon {
  width: 48px;
  height: 48px;
  min-width: 48px;
  border-radius: 15px;
  font-size: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.hidden-search-input {
  display: none;
}

.hidden-search-input.show-search {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.hidden-search-input input {
  width: 100%;
  height: 46px;
  padding: 10px 12px;
  border-radius: 14px;
  border: 1px solid var(--border);
  font-size: 14px;
}

.search-btn,
.clear-btn {
  height: 42px;
  min-height: 42px;
  border-radius: 13px;
  padding: 0 12px;
  font-size: 13px;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.search-btn {
  background: #111827;
  color: white;
}

.clear-btn {
  background: #f3f4f6;
  color: #111827;
}

/* BRAND DARK BOX */
.vendor-dark {
  background: #e81b0d;
  padding: 9px;
  border-radius: 16px;
}

.vendor-dark label {
  color: white;
}

/* CHOICES DEFAULT LIGHT */
.choices {
  width: 100%;
  margin: 0;
}

.choices__inner {
  min-height: 42px !important;
  height: 42px !important;
  border-radius: 13px !important;
  border: 1px solid var(--border) !important;
  background: white !important;
  color: #111827 !important;
  font-size: 13px !important;
  padding: 4px 10px !important;
}

.choices__item,
.choices__item--selectable,
.choices__placeholder {
  color: #111827 !important;
}

.choices__list--dropdown,
.choices__list[aria-expanded] {
  background: white !important;
  color: #111827 !important;
  border: 1px solid var(--border) !important;
  border-radius: 13px !important;
  z-index: 9999 !important;
  overflow: hidden !important;
}

.choices__list--dropdown .choices__item--choice,
.choices__list[aria-expanded] .choices__item--choice {
  background: white !important;
  color: #111827 !important;
  padding: 10px 12px !important;
}

.choices__list--dropdown .choices__item--choice.is-highlighted,
.choices__list[aria-expanded] .choices__item--choice.is-highlighted {
  background: #eef2ff !important;
  color: #111827 !important;
}

/* ONLY BRAND DARK DROPDOWN */
.vendor-dark .choices__inner {
  background: #021649 !important;
  color: white !important;
  border: 1px solid #243457 !important;
}

.vendor-dark .choices__item,
.vendor-dark .choices__item--selectable,
.vendor-dark .choices__placeholder {
  color: white !important;
}

.vendor-dark .choices__list--dropdown,
.vendor-dark .choices__list[aria-expanded] {
  background: #0d1528 !important;
  color: white !important;
  border: 1px solid #243457 !important;
}

.vendor-dark .choices__list--dropdown .choices__item--choice,
.vendor-dark .choices__list[aria-expanded] .choices__item--choice {
  background: #0d1528 !important;
  color: white !important;
}

.vendor-dark .choices__list--dropdown .choices__item--choice.is-highlighted,
.vendor-dark .choices__list[aria-expanded] .choices__item--choice.is-highlighted {
  background: #2563eb !important;
  color: white !important;
}

.vendor-dark .choices__input,
.vendor-dark .choices__input--cloned {
  background: #16213d !important;
  color: white !important;
}

/* SUMMARY */
.catalog-summary {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.catalog-summary div {
  background: white;
  padding: 9px 14px;
  border-radius: 999px;
  box-shadow: 0 5px 16px rgba(24,34,47,0.07);
  border: 1px solid var(--border);
  color: var(--muted);
}

.catalog-summary b {
  color: var(--dark);
}

/* PRODUCT GRID */
.catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(275px, 100%), 1fr));
  gap: 26px;
}

.product-card {
  background: var(--card);
  border-radius: 26px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

.image-wrap {
  background: radial-gradient(circle at top, #ffffff 0%, #f2eee5 65%);
  padding: 18px;
  height: 255px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
}

.image-wrap img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.product-info {
  padding: 18px;
}

.product-title {
  font-size: 18px;
  line-height: 1.35;
  margin: 0 0 12px;
  color: var(--dark);
}

.price {
  display: inline-block;
  font-size: 24px;
  font-weight: 900;
  margin-bottom: 14px;
  color: var(--dark);
  background: var(--gold-soft);
  padding: 6px 12px;
  border-radius: 999px;
}

.product-meta {
  border-top: 1px solid var(--border);
  padding-top: 12px;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px dashed #eee8dc;
}

.meta-label {
  color: var(--muted);
  font-weight: 800;
}

.meta-row span:last-child {
  text-align: right;
  word-break: break-word;
}

.stock-good {
  color: var(--success);
  font-weight: 900;
}

.stock-low {
  color: var(--danger);
  font-weight: 900;
}

.hidden-row {
  display: none;
}

/* VARIANTS */
.variant-box {
  background: #fbf7ec;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 12px;
  margin: 12px 0 14px;
}

.variant-step label {
  display: block;
  font-weight: 800;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 6px;
}

.step-select {
  width: 100%;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: white;
  font-size: 14px;
}

.variant-message {
  font-size: 13px;
  color: var(--muted);
  font-weight: 700;
  margin-top: 8px;
}

/* CATEGORY */
.category-intro {
  margin: 24px 0 10px;
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 22px;
  margin-top: 24px;
}

.category-card {
  background: white;
  border: 1px solid var(--border);
  border-radius: 22px;
  padding: 26px;
  text-decoration: none;
  color: var(--dark);
  box-shadow: var(--shadow);
}

.category-name {
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 10px;
}

.category-count {
  color: var(--muted);
  font-weight: 700;
}

/* PAGINATION */
.pagination {
  margin: 36px auto 0;
  background: white;
  padding: 18px;
  border-radius: var(--radius);
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
  max-width: 600px;
}

.page-btn {
  background: linear-gradient(135deg, var(--dark), var(--dark-soft));
  color: white;
  padding: 11px 18px;
  border-radius: 999px;
  text-decoration: none;
  font-weight: 800;
}

.page-center {
  color: var(--muted);
  font-weight: 700;
}

/* LOGIN */
.login-box,
.panel {
  max-width: 460px;
  background: white;
  padding: 30px;
  border-radius: 24px;
  box-shadow: var(--shadow);
  border: 1px solid var(--border);
}

input {
  outline: none;
}

.error {
  background: #ffe1e1;
  color: #8a1111;
  padding: 11px 13px;
  margin-bottom: 15px;
  border-radius: 14px;
  font-weight: 700;
}

/* RESPONSIVE */
@media (max-width: 1050px) {
  .filter-top-row {
    grid-template-columns: repeat(4, 1fr);
  }

  .big-search-icon {
    width: 100%;
  }
}

@media (max-width: 700px) {
  header {
    padding: 16px 18px;
    flex-direction: column;
    gap: 12px;
  }

  main {
    padding: 18px;
  }

  .filter-top-row {
    grid-template-columns: 1fr;
  }

  .catalog-grid {
    grid-template-columns: 1fr;
  }

  .pagination {
    flex-wrap: wrap;
  }
}

.general-search-form {
  display: grid;
  grid-template-columns: 1fr 90px 80px;
  gap: 10px;
  align-items: center;
}

.general-search-form input {
  margin: 0;
}

.general-search-form .search-btn,
.general-search-form .clear-btn {
  height: 46px;
}

.filter-chip-wrap {
  display: inline-flex;
  align-items: center;
  background: white;
  border: 1px solid var(--border);
  border-radius: 999px;
  overflow: hidden;
  box-shadow: 0 5px 16px rgba(24,34,47,0.07);
}

.filter-chip-main {
  padding: 9px 12px 9px 14px;
  color: var(--muted);
  text-decoration: none;
  font-weight: 700;
}

.filter-chip-main b {
  color: var(--dark);
}

.filter-chip-main:hover {
  background: #f8fafc;
}

.filter-chip-x {
  width: 30px;
  height: 100%;
  min-height: 34px;
  background: #fee2e2;
  color: #991b1b;
  text-decoration: none;
  font-weight: 900;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-left: 1px solid #fecaca;
}

.filter-chip-x:hover {
  background: #fecaca;
}

.account-card {
  background: #fff;
  border-radius: 18px;
  padding: 22px;
  margin-bottom: 28px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr));
  gap: 14px;
}

.info-item {
  background: #f7f7f7;
  border-radius: 12px;
  padding: 12px;
}

.info-label {
  display: block;
  font-size: 12px;
  color: #777;
  margin-bottom: 4px;
}

.info-value {
  font-weight: 700;
}

.orders-grid {
  display: grid;
  gap: 16px;
}

.order-card {
  background: #fff;
  border-radius: 16px;
  padding: 18px;
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.order-row {
  display: flex;
  gap: 8px;
  border-bottom: 1px solid #eee;
  padding: 7px 0;
}

.order-row:last-child {
  border-bottom: none;
}

.order-row b {
  min-width: 150px;
  color: #333;
}

.receipt-item {
  background: #f7f7f7;
  border-radius: 12px;
  padding: 12px;
  margin-top: 12px;
}


.print-tag-btn {
  margin-top: 12px;
  width: 100%;
  height: 40px;
  border-radius: 12px;
  background: #111827;
  color: white;
  font-weight: 900;
}


.template-controls {
  background: white;
  padding: 16px;
  border-radius: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}

.template-controls label {
  font-weight: 800;
}

.template-controls input {
  width: 90px;
}

.designer-wrap {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

.label-canvas {
  position: relative;
  background: white;
  border: 2px dashed #111827;
  box-shadow: 0 8px 22px rgba(0,0,0,.15);
  overflow: hidden;
}

.template-field {
  position: absolute;
  border: 1px dashed #999;
  padding: 2px;
  cursor: move;
  background: rgba(255,255,255,.75);
  overflow: hidden;
}

.template-field.selected {
  border: 2px solid #2563eb;
  background: rgba(219,234,254,.85);
}

.barcode-field {
  font-family: monospace;
  letter-spacing: 2px;
  text-align: center;
}

.field-panel {
  width: 260px;
  background: white;
  padding: 18px;
  border-radius: 16px;
}


.field-panel label {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
  font-weight: 700;
}

.field-panel input,
.field-panel select {
  width: 140px;
}

.template-field {
  position: absolute;
  border: 1px dashed #777;
  background: rgba(255,255,255,.82);
  cursor: move;
  overflow: hidden;
  box-sizing: border-box;
}

.template-field.selected {
  border: 2px solid #2563eb;
  background: rgba(219,234,254,.9);
}

.field-name-tag {
  position: absolute;
  top: 0;
  left: 0;
  background: #111827;
  color: white;
  font-size: 8px;
  line-height: 1;
  padding: 2px 4px;
  z-index: 5;
  pointer-events: none;
}

.field-content {
  display: block;
  padding-top: 10px;
  pointer-events: none;
}

.resize-handle {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 12px;
  height: 12px;
  background: #2563eb;
  cursor: nwse-resize;
  z-index: 10;
}

.field-btn {
  border: 0;
  color: white;
  font-weight: 800;
  padding: 6px 10px;
  border-radius: 4px;
  cursor: pointer;
}

.field-list-panel {
  width: 260px;
  min-width: 260px;
  background: #f8fafc;
  border-left: 1px solid #cbd5e1;
  padding: 12px;
  overflow-y: auto;
}

.field-list-row {
  background: white;
  border-radius: 6px;
  padding: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.field-list-row:hover {
  background: #eff6ff;
}

.field-list-title {
  font-weight: 800;
  font-size: 14px;
}

.field-list-info {
  font-size: 11px;
  color: #475569;
  margin-top: 4px;
}

.field-list-panel {
  width: 280px;
  min-width: 280px;
  background: #f8fafc;
  border-left: 1px solid #cbd5e1;
  padding: 12px;
  max-height: 720px;
  overflow-y: auto;
  border-radius: 12px;
}

.field-list-panel h3 {
  margin: 8px 0 10px;
  font-size: 15px;
}

.field-list-row,
.component-list-row {
  width: 100%;
  background: white;
  border: 1px solid #e5e7eb;
  border-left-width: 6px;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 8px;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 1px 3px rgba(0,0,0,.08);
}

.component-list-row {
  display: grid;
  grid-template-columns: 16px 1fr 18px;
  gap: 8px;
  align-items: center;
}

.field-list-row:hover,
.component-list-row:hover {
  background: #eff6ff;
}

.selected-field-row {
  background: #dbeafe;
  border-color: #2563eb;
}

.field-list-title {
  font-weight: 900;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.field-list-info {
  font-size: 11px;
  color: #475569;
  margin-top: 4px;
}

.component-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
}

.designer-wrap {
  display: flex;
  align-items: flex-start;
  gap: 18px;
}

.designer-wrap {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  width: 100%;
}

.label-canvas {
  flex: 0 0 auto;
}

.field-panel {
  flex: 0 0 220px;
}

.field-list-panel {
  flex: 0 0 280px;
  max-height: 600px;
  overflow-y: auto;
}

.filter-box {
  margin: 15px 0;
  padding: 12px;
  background: #f5f5f5;
  border-radius: 8px;
}

.filter-box select,
.filter-box button {
  padding: 8px 12px;
  margin-left: 8px;
}

.repair-list {
  display: grid;
  gap: 14px;
}

.repair-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 10px;
  padding: 15px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.repair-card h2 {
  margin-top: 0;
}


.repair-page {
  padding: 18px;
}

.repair-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}

.repair-header h1 {
  margin: 0;
  font-size: 28px;
}

.repair-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
  color: #333;
  font-weight: 600;
  font-size: 14px;
}

.filter-btn.active {
  background: #1f5fd6;
  color: white;
  border-color: #1f5fd6;
}

.filter-btn.active.red {
  background: #dc3545;
  border-color: #dc3545;
}

.filter-btn.active.green {
  background: #198754;
  border-color: #198754;
}

.repair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.repair-card {
  background: #fff;
  border: 1px solid #ddd;
  border-left: 7px solid #999;
  border-radius: 10px;
  padding: 14px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  font-size: 14px;
}

.process-card {
  border-left-color: #dc3545;
}

.ready-card {
  border-left-color: #198754;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 10px;
}

.card-top h2 {
  margin: 0 0 4px 0;
  font-size: 21px;
  color: #0d47a1;
}

.small-line {
  font-size: 13px;
  color: #666;
}

.status-badge {
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
}

.red-badge {
  color: #b00020;
  background: #ffe5e8;
  border: 1px solid #ff9aa5;
}

.green-badge {
  color: #0b6b34;
  background: #dff8e8;
  border: 1px solid #8be0a8;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #444;
  margin-bottom: 8px;
  font-size: 13px;
}

.note-box {
  background: #fff8db;
  border: 1px solid #f0df98;
  padding: 7px 9px;
  border-radius: 7px;
  margin-bottom: 9px;
  font-size: 13px;
}

.line-table {
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  overflow: hidden;
}

.line-row {
  display: grid;
  grid-template-columns: 46px 1fr 70px;
  gap: 8px;
  padding: 8px;
  border-bottom: 1px solid #eee;
  align-items: center;
}

.line-row:last-child {
  border-bottom: none;
}

.line-no {
  font-weight: 700;
  color: #555;
}

.line-desc b {
  display: block;
  margin-bottom: 2px;
}

.line-desc small {
  color: #777;
}

.line-qty {
  text-align: right;
  font-weight: 700;
  color: #555;
}

.empty-box {
  padding: 20px;
  background: #fff3cd;
  border: 1px solid #ffe69c;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .repair-grid {
    grid-template-columns: 1fr;
  }

  .repair-header {
    align-items: flex-start;
    flex-direction: column;
  }
}


.repair-page {
  padding: 18px;
}

.repair-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  gap: 12px;
}

.repair-header h1 {
  margin: 0;
  font-size: 28px;
}

.repair-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.filter-btn {
  text-decoration: none;
  padding: 8px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
  color: #333;
  font-weight: 600;
  font-size: 14px;
}

.filter-btn.active {
  background: #1f5fd6;
  color: white;
  border-color: #1f5fd6;
}

.filter-btn.active.red {
  background: #dc3545;
  border-color: #dc3545;
}

.filter-btn.active.green {
  background: #198754;
  border-color: #198754;
}

.repair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.repair-card {
  background: #fff;
  border: 1px solid #ddd;
  border-left: 7px solid #999;
  border-radius: 10px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  font-size: 13px;
}

.at-repairman-card {
  border-left-color: #dc3545;
}

.finished-card {
  border-left-color: #198754;
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: flex-start;
  margin-bottom: 8px;
}

.card-top h2 {
  margin: 0 0 3px 0;
  font-size: 19px;
  color: #0d47a1;
}

.small-line {
  font-size: 12px;
  color: #666;
}

.status-badge {
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  white-space: nowrap;
}

.red-badge {
  color: #b00020;
  background: #ffe5e8;
  border: 1px solid #ff9aa5;
}

.green-badge {
  color: #0b6b34;
  background: #dff8e8;
  border: 1px solid #8be0a8;
}

.meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: #444;
  margin-bottom: 7px;
  font-size: 12px;
}

.note-box {
  background: #fff8db;
  border: 1px solid #f0df98;
  padding: 6px 8px;
  border-radius: 7px;
  margin-bottom: 8px;
  font-size: 12px;
}

.line-table {
  border: 1px solid #e4e4e4;
  border-radius: 8px;
  overflow: hidden;
}

.line-row {
  display: grid;
  grid-template-columns: 42px 1fr 62px;
  gap: 8px;
  padding: 7px;
  border-bottom: 1px solid #eee;
  align-items: center;
}

.line-row:last-child {
  border-bottom: none;
}

.line-no {
  font-weight: 700;
  color: #555;
}

.line-desc b {
  display: block;
  margin-bottom: 2px;
}

.line-desc small {
  color: #777;
}

.line-qty {
  text-align: right;
  font-weight: 700;
  color: #555;
}

.empty-box {
  padding: 20px;
  background: #fff3cd;
  border: 1px solid #ffe69c;
  border-radius: 8px;
}

@media (max-width: 900px) {
  .repair-grid {
    grid-template-columns: 1fr;
  }

  .repair-header {
    align-items: flex-start;
    flex-direction: column;
  }
}

.not-assigned-card {
  border-left-color: #6c757d;
}

.ready-store-card {
  border-left-color: #0d6efd;
}

.repair-card select,
.repair-card input,
.repair-card textarea {
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 8px;
  padding: 7px;
}

.repair-card textarea {
  min-height: 60px;
}

.repair-card button {
  padding: 8px 12px;
  border: none;
  border-radius: 7px;
  background: #0d6efd;
  color: white;
  font-weight: 700;
  cursor: pointer;
}

.photo-upload-form {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid #ddd;
}

.repair-photo-box {
  margin: 8px 0;
}

.repair-photo {
  width: 100%;
  max-height: 180px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #ddd;
}

.repair-page {
  padding: 18px;
}

.repair-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.repair-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.repair-filters select,
.repair-filters button,
.filter-btn {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid #ccc;
  background: white;
  text-decoration: none;
  color: #222;
  font-weight: 600;
}

.repair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  align-items: start;
}

.repair-card {
  background: white;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.card-top h2 {
  margin: 0;
  color: #0d47a1;
}

.small-line {
  font-size: 13px;
  color: #666;
}



.status-0 { border-left-color: #777; }
.status-1 { border-left-color: #ffc107; }
.status-2 { border-left-color: #dc3545; }
.status-3 { border-left-color: #198754; }
.status-4 { border-left-color: #0d6efd; }

.tags {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin: 5px 0;
}

.tags span {
  background: #eef3ff;
  border: 1px solid #ccd8ff;
  border-radius: 999px;
  padding: 3px 8px;
  font-size: 12px;
  font-weight: 700;
}

.line-photo {
  width: 100%;
  max-height: 160px;
  object-fit: cover;
  border-radius: 8px;
  margin-bottom: 8px;
}

.small-form,
.note-form,
.photo-upload-form,
.admin-edit-form {
  margin-top: 8px;
}

.note-form textarea,
.admin-edit-form textarea,
.admin-edit-form input,
.admin-edit-form select,
.note-form input,
.small-form select {
  width: 100%;
  box-sizing: border-box;
  padding: 7px;
  margin: 4px 0 7px;
}

button {
  cursor: pointer;
}

.repair-line button,
.admin-edit-form button,
.photo-upload-form button,
.note-form button,
.small-form button {
  padding: 7px 10px;
  border: none;
  border-radius: 7px;
  background: #0d6efd;
  color: white;
  font-weight: 700;
}

.note-box {
  background: #fff8db;
  border: 1px solid #f0df98;
  padding: 7px;
  border-radius: 7px;
  margin-top: 7px;
}

@media (max-width: 900px) {
  .repair-grid {
    grid-template-columns: 1fr;
  }
}

.line-photo {
  width: 100%;
  max-width: 700px;
  height: auto;
  object-fit: contain;
}

.photo-viewer {
  display: none;
  position: fixed;
  z-index: 99999;
  inset: 0;
  background: rgba(0,0,0,.85);
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.photo-viewer img {
  max-width: 95vw;
  max-height: 90vh;
  border-radius: 10px;
  background: white;
}

.photo-viewer.open {
  display: flex;
}

.edit-panel {
  display: none;
}

.edit-panel.open {
  display: block;
  position: fixed;
  z-index: 9999;
  width: min(620px, 92vw);
  max-height: 78vh;
  overflow-y: auto;

  background: white;
  border: 2px solid #0d6efd;
  border-radius: 14px;
  padding: 14px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}

.edit-toggle-btn {
  position: relative;
  z-index: 2;
}

.price-wrap {
  display: flex;
  align-items: center;
  gap: 4px;
}

.price-wrap span {
  font-weight: 800;
}

.price-wrap input {
  flex: 1;
}


.line-main {
  min-width: 0;
}

.line-photo {
  width: 260px;
  height: 220px;
  object-fit: contain;
  border: 1px solid #bbb;
  border-radius: 10px;
  background: white;
  cursor: pointer;
}

.repair-customer-name {
  font-size: 24px;
  font-weight: 900;
  color: #111;
  margin-top: 4px;
}

@media (max-width: 900px) {
  

  .line-photo {
    width: 100%;
    height: auto;
    max-height: 320px;
  }
}



.line-photo,
.photo-thumb {
  width: 160px;
  height: 150px;
  object-fit: contain;
}

.line-main {
  min-width: 0;
  overflow-wrap: anywhere;
}

.tags {
  max-width: 100%;
}

.tags span {
  white-space: normal;
  overflow-wrap: anywhere;
}

.edit-toggle-btn {
  width: 100%;
  margin-top: 8px;
}

@media (max-width: 1100px) {
  .repair-grid {
    grid-template-columns: 1fr;
  }

  

  .line-photo,
  .photo-thumb {
    width: 100%;
    height: 230px;
  }
}

.repair-photos-wrap{
  width:240px;
}

.photo-group{
  margin-bottom:10px;
}

.photo-group-title{
  font-size:12px;
  font-weight:bold;
  margin-bottom:4px;
}

.photo-thumbs{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
}

.photo-thumb{
  width:70px;
  height:70px;
  object-fit:cover;
  border-radius:6px;
  cursor:pointer;
  border:1px solid #ddd;
}

.repair-line {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  align-items: start;
  overflow: visible;
}

.repair-photos-wrap {
  width: 190px;
  flex-shrink: 0;
}

.line-main {
  min-width: 0;
  padding-left: 8px;
}

.photo-thumbs {
  display: grid;
  grid-template-columns: repeat(2, 78px);
  gap: 8px;
}

.photo-thumb {
  width: 78px;
  height: 78px;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid #ccc;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  max-width: 100%;
}

.tags span {
  white-space: normal;
}

.repair-photo-panel{
  width:180px;
}

.main-repair-photo{
  width:180px;
  height:180px;
  object-fit:cover;
  border-radius:8px;
  cursor:pointer;
}

.repair-thumb-row{
  display:flex;
  gap:4px;
  margin-top:6px;
}

.repair-thumb{
  width:40px;
  height:40px;
  object-fit:cover;
  border-radius:4px;
  cursor:pointer;
}

.more-photos{
  width:40px;
  height:40px;
  display:flex;
  align-items:center;
  justify-content:center;
  background:#eee;
  border-radius:4px;
  font-size:12px;
  font-weight:bold;
}

.repair-photo-panel {
  width: 170px;
  flex-shrink: 0;
}

.main-repair-photo,
.no-photo-box {
  width: 170px;
  height: 150px;
  object-fit: contain;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: white;
  cursor: pointer;
}

.no-photo-box {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #777;
  font-weight: 700;
}

.photo-buttons {
  display: grid;
  gap: 5px;
  margin-top: 6px;
}

.photo-type-btn {
  padding: 5px 6px;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: #f3f3f3;
  font-size: 12px;
  font-weight: 700;
}

.photo-viewer {
  display: none;
  position: fixed;
  z-index: 99999;
  inset: 0;
  background: rgba(0,0,0,.86);
  align-items: center;
  justify-content: center;
}

.photo-viewer.open {
  display: flex;
}

.photo-viewer-inner {
  width: min(95vw, 900px);
  max-height: 95vh;
  background: white;
  border-radius: 10px;
  padding: 10px;
}

.photo-viewer-top,
.photo-viewer-controls {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#photoViewerImg {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  background: #eee;
}

.repair-card {
  border-left: 10px solid #777;
}

.repair-line.status-0,
.repair-card:has(.status-0) {
  border-left-color: #777;
}

.repair-line.status-1,
.repair-card:has(.status-1) {
  border-left-color: #ffc107;
}

.repair-line.status-2,
.repair-card:has(.status-2) {
  border-left-color: #dc3545;
}

.repair-line.status-3,
.repair-card:has(.status-3) {
  border-left-color: #198754;
}

.repair-line.status-4,
.repair-card:has(.status-4) {
  border-left-color: #0d6efd;
}



.repair-line {
  position: relative;
}

.edit-panel {
  display: none;
  position: absolute;
  z-index: 50;
  top: 45px;
  left: 10px;
  right: 10px;

  background: white;
  border: 2px solid #0d6efd;
  border-radius: 12px;
  padding: 12px;
  box-shadow: 0 8px 25px rgba(0,0,0,.25);
}

.edit-panel.open {
  display: block;
}

.edit-toggle-btn {
  position: relative;
  z-index: 60;
}

.edit-panel {
  display: none;
}

.edit-panel.open {
  display: block;
  position: fixed;
  z-index: 9999;
  top: 110px;
  left: 50%;
  transform: translateX(-50%);
  width: min(720px, 92vw);
  max-height: 78vh;
  overflow-y: auto;

  background: white;
  border: 2px solid #0d6efd;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 40px rgba(0,0,0,.35);
}

.edit-toggle-btn {
  position: relative;
  z-index: 2;
}

.edit-panel.open {
  position: fixed;
  max-width: calc(100vw - 24px);
  box-sizing: border-box;
}

.edit-panel {
  display: none;
}

.edit-panel.open {
  display: block;
  position: fixed;
  z-index: 9999;

  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);

  width: min(650px, 92vw);
  max-height: 82vh;
  overflow-y: auto;

  background: white;
  border: 2px solid #0d6efd;
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 12px 45px rgba(0,0,0,.4);
}

.edit-panel::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background: rgba(0,0,0,.25);
}

.repair-conversation {
  margin-top: 8px;
}

.repair-note {
  padding: 7px;
  border-radius: 8px;
  margin-bottom: 6px;
  font-size: 13px;
}

.repair-note.admin {
  background: #eaf3ff;
  border-left: 4px solid #0d6efd;
}

.repair-note.repairman {
  background: #fff7df;
  border-left: 4px solid #ffc107;
}

.note-head {
  font-size: 12px;
  color: #555;
  margin-bottom: 3px;
}

.note-head span {
  float: right;
}

.edit-panel {
  display: none;
}

.edit-panel.open {
  display: block;
  grid-column: 1 / -1;
  margin-top: 12px;
  padding: 14px;
  background: #fff;
  border: 2px solid #0d6efd;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,.18);
}

.repair-grid {
  align-items: start;
}

.repair-card {
  align-self: start;
  height: fit-content;
}

.repair-card.editing {
  border: 3px solid #0d6efd;
  box-shadow: 0 0 0 4px rgba(13,110,253,.15);
  transform: scale(1.01);
  z-index: 5;
}

.repair-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(min(360px, 100%), 1fr));
  gap: 16px;
  align-items: start;
}

.card-summary-row {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-top: 6px;
}

.multi-line-badge {
  background: #222;
  color: white;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.card-price {
  background: #eaf3ff;
  color: #0d4f91;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.repair-page,
.repair-grid,
.repair-card,
.repair-line {
  position: static !important;
  float: none !important;
}

.repair-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(min(520px, 100%), 1fr)) !important;
  gap: 18px !important;
  align-items: start !important;
}

.repair-card {
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  height: auto !important;
  margin: 0 !important;
  box-sizing: border-box !important;
}

.repair-line {
  display: grid !important;
  grid-template-columns: 170px 1fr !important;
  gap: 16px !important;
  align-items: start !important;
}

.repair-card {
  padding: 18px;
  border-radius: 14px;
}

.repair-line {
  display: grid !important;
  grid-template-columns: 190px 1fr 120px !important;
  gap: 18px !important;
  align-items: start !important;
  padding: 14px 0;
  border-top: 1px solid #eee;
}

.repair-line:first-of-type {
  border-top: none;
}

.repair-photo-panel {
  width: 180px;
}

.main-repair-photo,
.no-photo-box {
  width: 180px !important;
  height: 135px !important;
  object-fit: cover;
  border-radius: 10px;
}

.line-main {
  padding-top: 8px;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin: 8px 0;
}

.tags span {
  background: #eaf3ff;
  padding: 5px 9px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
}

.edit-toggle-btn,
.show-lines-btn,
.tag-actions button,
.photo-type-btn {
  width: 100%;
  margin-top: 7px;
}

.extra-lines {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 2px dashed #ddd;
}

.extra-lines.open {
  display: block;
}

.compact-line {
  background: #fafafa;
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
}

.repair-chat {
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: 100%;
}

.chat-row {
  display: flex;
  width: 100%;
}

.chat-row.admin {
  justify-content: flex-end;
}

.chat-row.repairman {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 75%;
  padding: 9px 11px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.3;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
}

.chat-row.admin .chat-bubble {
  background: #dff0ff;
  border-bottom-right-radius: 4px;
}

.chat-row.repairman .chat-bubble {
  background: #fff3cd;
  border-bottom-left-radius: 4px;
}

.chat-head {
  display: flex;
  gap: 6px;
  font-size: 11px;
  color: #555;
  margin-bottom: 4px;
}

.chat-text {
  color: #111;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-date {
  font-size: 10px;
  color: #777;
  text-align: right;
  margin-top: 4px;
}

.repair-chat{
  margin-top:12px;
  display:flex;
  flex-direction:column;
  gap:8px;
}

.chat-row{
  display:flex;
}

.chat-row.admin{
  justify-content:flex-end;
}

.chat-row.repairman{
  justify-content:flex-start;
}

.chat-bubble{
  max-width:75%;
  padding:10px;
  border-radius:12px;
}

.chat-row.admin .chat-bubble{
  background:#dff3ff;
}

.chat-row.repairman .chat-bubble{
  background:#fff4c9;
}

.chat-head{
  font-size:11px;
  margin-bottom:4px;
}

.chat-date{
  font-size:10px;
  opacity:.6;
  margin-top:4px;
}

.compact-chat {
  margin-top: 8px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.chat-row {
  display: flex;
  width: 100%;
}

.chat-row.admin {
  justify-content: flex-end;
}

.chat-row.repairman {
  justify-content: flex-start;
}

.chat-bubble {
  max-width: 90%;
  padding: 5px 8px;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1.2;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}

.chat-row.admin .chat-bubble {
  background: #dceeff;
  color: #073b6d;
}

.chat-row.repairman .chat-bubble {
  background: #fff0c2;
  color: #5a4300;
}

.chat-role {
  font-weight: 800;
}

.chat-text {
  max-width: 260px;
  overflow: hidden;
  text-overflow: ellipsis;
}

.chat-time {
  font-size: 10px;
  opacity: .55;
}

.wa-chat {
  margin-top: 10px;
  padding: 10px;
  background: #f5f1e9;
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 7px;
  max-height: 180px;
  overflow-y: auto;
}

.wa-row {
  display: flex;
  width: 100%;
}

.wa-admin {
  justify-content: flex-end;
}

.wa-repairman {
  justify-content: flex-start;
}

.wa-bubble {
  max-width: 78%;
  min-width: 120px;
  padding: 6px 9px 4px;
  border-radius: 10px;
  font-size: 12px;
  line-height: 1.25;
  box-shadow: 0 1px 2px rgba(0,0,0,.12);
}

.wa-admin .wa-bubble {
  background: #d9fdd3;
  border-top-right-radius: 2px;
}

.wa-repairman .wa-bubble {
  background: #ffffff;
  border-top-left-radius: 2px;
}

.wa-name {
  font-size: 10px;
  font-weight: 800;
  color: #0b65c2;
  margin-bottom: 2px;
}

.wa-repairman .wa-name {
  color: #b57900;
}

.wa-message {
  color: #111;
  white-space: normal;
  word-break: break-word;
}

.wa-time {
  font-size: 9px;
  color: #777;
  text-align: right;
  margin-top: 2px;
}

.repair-search{
  min-width:300px;
  padding:10px 12px;
  border:1px solid #ccc;
  border-radius:10px;
  font-size:14px;
}

.wa-chat{
  background:#efeae2;
  padding:10px;
  border-radius:12px;
  max-height:300px;
  overflow-y:auto;
}

.wa-input{
  display:flex;
  align-items:center;
  gap:8px;

  background:#fff;
  border-radius:25px;

  padding:6px 8px;
  margin-top:10px;

  border:1px solid #ddd;
}

.wa-input-text{
  flex:1;
  border:none;
  outline:none;
  font-size:14px;
  background:transparent;
}

.wa-send-btn{
  width:38px;
  height:38px;

  border:none;
  border-radius:50%;

  background:#25d366;
  color:#fff;

  cursor:pointer;

  font-size:18px;
  font-weight:bold;
}

.wa-input-text {
  overflow: hidden;
}

.simple-page {
  padding: 24px;
}

.simple-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
}

.simple-header h1 {
  margin: 0;
  font-size: 30px;
}

.simple-filters {
  display: flex;
  gap: 10px;
  margin-bottom: 22px;
  flex-wrap: wrap;
}

.simple-filters input,
.simple-filters select {
  padding: 12px 14px;
  border: 1px solid #d7dbe3;
  border-radius: 12px;
  font-size: 15px;
}

.simple-filters input {
  min-width: 320px;
}

.simple-filters button,
.simple-btn {
  background: #0d6efd;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px 16px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.simple-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(380px, 100%), 1fr));
  gap: 18px;
}

.simple-card {
  background: #fff;
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 4px 18px rgba(0,0,0,.08);
  border-left: 8px solid #999;
}

.simple-card.status-0 {
  border-left-color: #777;
}

.simple-card.status-1 {
  border-left-color: #0d6efd;
}

.simple-card.status-2 {
  border-left-color: #ff9800;
}

.simple-card.status-3 {
  border-left-color: #7b1fa2;
}

.simple-card.status-4 {
  border-left-color: #2e7d32;
}

.simple-card.simple-closed {
  opacity: .65;
  background: #f3f3f3;
}

.simple-card-top {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid #eee;
  padding-bottom: 12px;
  margin-bottom: 12px;
}

.simple-receipt {
  color: #174c88;
  font-weight: 800;
  font-size: 20px;
}

.simple-receipt span {
  font-size: 13px;
  color: #666;
  margin-left: 8px;
}

.simple-name {
  font-size: 26px;
  font-weight: 900;
  margin-top: 4px;
}

.simple-date {
  font-size: 13px;
  color: #777;
  margin-top: 3px;
}

.simple-balance {
  background: #eef5ff;
  color: #174c88;
  border-radius: 14px;
  padding: 8px 12px;
  text-align: center;
  min-width: 90px;
}

.simple-balance b {
  font-size: 20px;
}

.simple-closed-badge {
  display: inline-block;
  background: #444;
  color: white;
  padding: 5px 12px;
  border-radius: 999px;
  font-weight: 800;
  margin-bottom: 10px;
}

.simple-item {
  font-size: 17px;
  margin-bottom: 10px;
}

.simple-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-bottom: 10px;
}

.simple-tags span {
  background: #eaf2f8;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.simple-status {
  color: #555;
  font-size: 14px;
  margin-top: 8px;
}

.simple-phone {
  color: #333;
  margin-top: 6px;
  font-weight: 700;
}

.simple-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 16px;
}

.simple-actions form {
  margin: 0;
}

.simple-actions button {
  width: 100%;
  background: #0d6efd;
  color: white;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-weight: 800;
  cursor: pointer;
}

.simple-actions button:hover {
  background: #095ec7;
}

.ready-card {
  background: #effff3;
  border-left-color: #1f9d45 !important;
}

.simple-lines {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.simple-line {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 70px 105px 110px;
  gap: 8px;
  align-items: center;
  border: 1px solid #ddd;
  border-radius: 12px;
  padding: 10px;
  box-sizing: border-box;
  overflow: hidden;
}

.simple-line.status-4 {
  background: #e7f8ec;
  border-color: #40b866;
}

.simple-line-small {
  font-size: 13px;
  color: #666;
}

.simple-line-status {
  font-weight: 600;
  position: relative;
  top: -15px;
}

.simple-line button {
  background: #168a3a;
  color: white;
  border: 0;
  border-radius: 10px;
  padding: 9px;
  font-weight: 800;
}


.simple-line-info {
  min-width: 0;
  overflow: hidden;
}

.simple-line-info b,
.simple-line-small {
  overflow-wrap: anywhere;
}

.simple-print-btn {
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  white-space: normal;
  line-height: 1.1;
  padding: 8px 6px;
}

.simple-total {
  text-align: right;
  font-weight: 900;
  font-size: 18px;
  margin-top: 12px;
}

.ready-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.35);
  align-items: center;
  justify-content: center;
  z-index: 9999;
}

.ready-modal.open {
  display: flex;
}

.ready-modal-box {
  background: white;
  border-radius: 16px;
  padding: 22px;
  width: 360px;
  box-shadow: 0 8px 30px rgba(0,0,0,.25);
}

.ready-modal-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

.ready-modal-actions button {
  padding: 10px 14px;
  border-radius: 10px;
  border: 0;
  font-weight: 800;
}

.ready-modal-actions button:last-child {
  background: #168a3a;
  color: white;
}

#fontFamilyInput {
  font-size: 16px;
  padding: 4px;
}

.font-picker {
  position: relative;
}

#fontPickerBtn {
  width: 150px;
  padding: 6px;
  border: 1px solid #999;
  background: white;
  text-align: left;
}

.font-picker-menu {
  display: none;
  position: absolute;
  top: 34px;
  left: 0;
  width: 260px;
  max-height: 300px;
  overflow-y: auto;
  background: white;
  border: 1px solid #999;
  z-index: 9999;
}

.font-picker-menu.open {
  display: block;
}

.font-option {
  padding: 7px 10px;
  cursor: pointer;
  border-bottom: 1px solid #eee;
}

.font-option:hover {
  background: #eef5ff;
}

.font-option-name {
  font-size: 11px;
  color: #777;
}

.font-option-preview {
  font-size: 18px;
}

.ready-card {
  background: #e9fbe9 !important;
  border-left: 8px solid #168a3a !important;
}

.partial-ready-card {
  background: #fffbea !important;
  border-left: 8px solid #d97706 !important;
}

.simple-line.status-4 {
  background: #e7f8ec;
  border-color: #168a3a;
}


.price-edit-row {
  margin-top: 6px;
  display: flex;
  gap: 4px;
}

.price-edit-row input {
  width: 70px;
  padding: 4px;
  font-size: 12px;
}

.price-edit-row button {
  padding: 4px 7px;
  font-size: 11px;
  border: 0;
  border-radius: 6px;
  background: #174c88;
  color: white;
  font-weight: 700;
}

/* ===== Customer self-service portal (/my-account) ===== */

.customer-portal {
  background: linear-gradient(135deg, #f9f7f1, var(--bg), #eee9df);
}

.customer-header {
  background: rgba(24, 34, 47, 0.96);
  color: white;
  padding: 18px 34px;
  box-shadow: 0 8px 26px rgba(0,0,0,0.18);
}

.customer-header .brand {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.3px;
}

.customer-main {
  padding: 0;
}

.portal-wrap {
  min-height: calc(100vh - 80px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.portal-card {
  background: white;
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(24, 34, 47, 0.18);
  border: 1px solid var(--border);
  width: 100%;
  max-width: 420px;
  overflow: hidden;
}

.portal-header {
  background: linear-gradient(135deg, var(--dark), var(--dark-soft));
  padding: 32px 32px 28px;
  text-align: center;
}

.portal-logo {
  width: 54px;
  height: 54px;
  background: var(--gold);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  font-weight: 900;
  color: white;
  margin: 0 auto 14px;
}

.portal-header h1 {
  color: white;
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 800;
}

.portal-header p {
  color: #94a3b8;
  margin: 0;
  font-size: 14px;
}

.portal-body {
  padding: 28px 32px 32px;
}

.portal-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: var(--danger);
  padding: 11px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.portal-field {
  margin-bottom: 16px;
}

.portal-field label {
  display: block;
  font-size: 13px;
  font-weight: 700;
  color: #374151;
  margin-bottom: 6px;
}

.portal-field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #d1d5db;
  border-radius: 12px;
  font-size: 15px;
  color: #111;
  background: #f9fafb;
  transition: border-color 0.15s, box-shadow 0.15s;
  box-sizing: border-box;
}

.portal-field input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(184, 145, 70, 0.15);
  background: white;
  outline: none;
}

.portal-otp-input {
  text-align: center;
  letter-spacing: 8px;
  font-size: 24px;
  font-weight: 800;
}

.portal-submit {
  width: 100%;
  padding: 14px;
  background: linear-gradient(135deg, var(--dark), var(--dark-soft));
  color: white;
  border: none;
  border-radius: 12px;
  font-size: 16px;
  font-weight: 800;
  cursor: pointer;
  margin-top: 8px;
  transition: opacity 0.15s;
}

.portal-submit:hover {
  opacity: 0.88;
}

.portal-resend-form {
  margin-top: 14px;
  text-align: center;
}

.portal-link-btn {
  background: none;
  border: none;
  color: var(--gold);
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  padding: 4px;
}

.portal-link-btn:hover {
  text-decoration: underline;
}

.portal-back-link {
  display: block;
  text-align: center;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
  text-decoration: none;
}

.portal-back-link:hover {
  text-decoration: underline;
}

.portal-history-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 32px 20px 60px;
}

.portal-history-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 24px;
}

.portal-history-top h1 {
  margin: 0 0 4px;
  font-size: 24px;
  color: var(--dark);
}

.portal-history-sub {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.portal-logout-btn {
  background: white;
  border: 1.5px solid var(--border);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  padding: 10px 16px;
  border-radius: 12px;
  text-decoration: none;
  white-space: nowrap;
  box-shadow: var(--shadow);
}

.portal-logout-btn:hover {
  border-color: var(--gold);
}

.portal-empty-state {
  background: white;
  border-radius: var(--radius);
  padding: 40px 24px;
  text-align: center;
  color: var(--muted);
  box-shadow: var(--shadow);
}

.portal-receipts {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.portal-receipt-card {
  background: white;
  border-radius: 18px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.portal-receipt-summary {
  list-style: none;
  cursor: pointer;
  padding: 18px 22px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
}

.portal-receipt-summary::-webkit-details-marker {
  display: none;
}

.portal-receipt-date-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.portal-receipt-date {
  font-size: 16px;
  font-weight: 800;
  color: var(--dark);
}

.portal-receipt-meta {
  font-size: 13px;
  color: var(--muted);
  margin-top: 2px;
}

.portal-type-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--gold-soft);
  color: #8a6a2f;
}

.portal-type-badge--s {
  background: #e3f5e9;
  color: var(--success);
}

.portal-type-badge--co {
  background: #e5edff;
  color: #2545b8;
}

.portal-type-badge--pi {
  background: var(--gold-soft);
  color: #8a6a2f;
}

.portal-type-badge--la,
.portal-type-badge--lp,
.portal-type-badge--cp {
  background: #f3e8ff;
  color: #6d28d9;
}

.portal-type-badge--vo {
  background: #fde8e8;
  color: var(--danger);
}

.portal-type-badge--return {
  background: #ffe9d6;
  color: #b5580a;
}

.portal-receipt-card--voided {
  opacity: 0.7;
}

.portal-receipt-card--voided .portal-receipt-total {
  text-decoration: line-through;
  color: var(--danger);
}

.portal-negative {
  color: var(--danger);
}

.portal-receipt-summary-right {
  text-align: right;
  flex-shrink: 0;
}

.portal-receipt-total {
  font-size: 18px;
  font-weight: 800;
  color: var(--dark);
}

.portal-receipt-toggle {
  font-size: 12px;
  font-weight: 700;
  color: var(--gold);
  margin-top: 2px;
}

.portal-receipt-card[open] .portal-receipt-toggle {
  display: none;
}

.portal-receipt-card[open] .portal-receipt-summary {
  border-bottom: 1px solid var(--border);
}

.portal-receipt-detail {
  padding: 4px 22px 22px;
}

.portal-receipt-items {
  display: flex;
  flex-direction: column;
}

.portal-line-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0ede5;
}

.portal-line-item:last-child {
  border-bottom: none;
}

.portal-line-item-main {
  flex: 1;
  min-width: 0;
}

.portal-line-item-name {
  font-weight: 700;
  font-size: 14px;
  color: var(--text);
}

.portal-line-item-variant {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.portal-line-item-qty {
  font-size: 13px;
  color: var(--muted);
  flex-shrink: 0;
}

.portal-line-item-amount {
  font-weight: 700;
  font-size: 14px;
  min-width: 70px;
  text-align: right;
  flex-shrink: 0;
}

.portal-receipt-totals {
  margin-top: 8px;
  padding-top: 12px;
  border-top: 1.5px solid var(--border);
}

.portal-totals-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--muted);
  padding: 3px 0;
}

.portal-totals-total {
  font-size: 15px;
  font-weight: 800;
  color: var(--dark);
  padding-top: 6px;
}

.portal-payment-section {
  margin-top: 16px;
  background: var(--gold-soft);
  border-radius: 12px;
  padding: 12px 16px;
}

.portal-payment-title {
  font-size: 12px;
  font-weight: 800;
  color: #8a6a2f;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 8px;
}

.portal-payment-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 700;
  padding: 4px 0;
  color: #5c4718;
}

.portal-payment-badge {
  font-weight: 700;
}

.portal-payment-none {
  font-weight: 500;
  font-style: italic;
  color: #8a6a2f;
}

@media (max-width: 480px) {
  .portal-line-item {
    flex-wrap: wrap;
  }

  .portal-line-item-qty {
    order: 3;
  }
}