/* style.css */
* {
  box-sizing: border-box;
}

:root {
  --bg: #0b1220;
  --bg2: #0f172a;
  --panel: #111827;
  --card: #ffffff;
  --txt: #0b1220;
  --muted: #6b7280;
  --line: rgba(255, 255, 255, .10);
  --line2: rgba(15, 23, 42, .10);
  --accent: #2563eb;

  --radius: 14px;
  --radius2: 18px;

  --sbw: 280px;
  --top: 60px;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  font-family: Arial, sans-serif;
  background: #f3f5f9;
  color: var(--txt);
}

/* Sidebar toggle (CSS-only) */
.sb-toggle {
  display: none;
}

.sb-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .55);
  z-index: 30;
}

/* App */
.app {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* Topbar */
.topbar {
  /* height: var(--top); */
  background: linear-gradient(180deg, #0b1220 0%, #0b1220 60%, #0a1020 100%);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 14px;
  position: sticky;
  top: 0;
  z-index: 40;
  border-bottom: 1px solid rgba(255, 255, 255, .06);
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 220px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 12px;
  text-decoration: none;
  transition: all .2s ease;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
}

.btn2 {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, .12);
  background: #fff;
  color: #0f172a;
  text-decoration: none;
  cursor: pointer;
  font-weight: 500;
  transition: all .2s ease;
}

.btn2:hover {
  box-shadow: 0 10px 22px rgba(2, 6, 23, .08);
  transform: translateY(-1px);
}

.btn2.primary {
  background: #2563eb;
  color: #fff;
  border-color: transparent;
}

.btn2.primary:hover {
  background: #1d4ed8;
}

.btn2.danger {
  color: #991b1b;
  border-color: rgba(153, 27, 27, .18);
  background: #fff;
}

.btn2.danger:hover {
  background: #fef2f2;
}

.btn2.warn {
  color: #7c2d12;
  border-color: rgba(124, 45, 18, .20);
  background: rgba(255, 237, 213, .55);
}

.btn2.warn:hover {
  background: rgba(255, 237, 213, .75);
}

.icon-btn {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  background: rgba(255, 255, 255, .08);
  border: 1px solid rgba(255, 255, 255, .10);
  color: #fff;
  transition: all .2s ease;
}

.icon-btn:hover {
  background: rgba(255, 255, 255, .12);
}

/* Layout */
.layout {
  display: flex;
  min-height: calc(100vh - var(--top));
}

/* Sidebar */
.sidebar {
  width: var(--sbw);
  background: radial-gradient(1200px 600px at 20% 0%, rgba(37, 99, 235, .18), transparent 45%),
    linear-gradient(180deg, #0b1220 0%, #0a1020 100%);
  color: #cbd5e1;
  border-right: 1px solid rgba(255, 255, 255, .06);
  position: sticky;
  top: var(--top);
  /* height: calc(100vh - var(--top)); */
  height: 100%;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 35;
  transition: width .22s ease, transform .22s ease;
}

.sidebar::-webkit-scrollbar {
  width: 5px;
}

.sidebar::-webkit-scrollbar-track {
  background: transparent;
}

.sidebar::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px;
}

.sidebar-inner {
  min-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 12px;
  gap: 10px;
}

.sidebar-top {
  padding-bottom: 6px;
}

.sidebar-bottom {
  margin-top: auto;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, .06);
}

.sidebar-footnote {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  opacity: .85;
  padding: 10px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
}

.nav {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.nav-item,
.nav-sub-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 14px;
  text-decoration: none;
  color: #d7e0ee;
  border: 1px solid transparent;
  transition: background .15s ease, border-color .15s ease, transform .05s ease;
}

.nav-item:hover,
.nav-sub-item:hover {
  background: rgba(255, 255, 255, .08);
  border-color: rgba(255, 255, 255, .08);
}

.nav-item:active,
.nav-sub-item:active {
  transform: translateY(1px);
}

.nav-ic {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  flex: 0 0 auto;
}

.nav-tx {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav-item.active,
.nav-sub-item.active {
  background: rgba(37, 99, 235, .18);
  border-color: rgba(37, 99, 235, .25);
  color: #ffffff;
}

.nav-item.active .nav-ic,
.nav-sub-item.active .nav-ic {
  background: rgba(37, 99, 235, .24);
  border-color: rgba(37, 99, 235, .30);
}

.nav-sub-item.is-missing-page {
  color: rgba(215, 224, 238, .58);
  cursor: default;
}

.nav-sub-item.is-missing-page .nav-tx {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
}

.nav-sub-item.is-missing-page .nav-ic {
  opacity: .55;
}

.nav-sub-item.is-missing-page:hover,
.nav-sub-item.is-missing-page:active {
  background: transparent;
  border-color: transparent;
  transform: none;
}

/* Accordion */
.nav-toggle {
  display: none;
}

.nav-group-wrap {
  border-radius: 16px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .06);
  background: rgba(255, 255, 255, .03);
}

.nav-group {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 10px 12px;
  cursor: pointer;
  user-select: none;
  color: #e5eefc;
}

.nav-group-title {
  font-weight: 800;
  font-size: 13px;
  letter-spacing: .2px;
  opacity: .95;
}

.nav-group-arrow {
  width: 28px;
  height: 28px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, .06);
  border: 1px solid rgba(255, 255, 255, .08);
  transition: transform .18s ease;
}

.nav-sub {
  display: grid;
  gap: 6px;
  padding: 0 10px 10px 10px;
  max-height: 900px;
  transition: max-height .22s ease, padding .22s ease, opacity .18s ease;
  opacity: 1;
}

.nav-toggle:not(:checked)+.nav-group+.nav-sub {
  max-height: 0;
  padding: 0 10px 0 10px;
  opacity: 0;
}

.nav-toggle:checked+.nav-group .nav-group-arrow {
  transform: rotate(180deg);
}

/* Content */
.content {
  flex: 1;
  min-width: 0;
  padding: 16px;
}

.content-inner {
  max-width: 1120px;
  margin: 0 auto;
}

h1 {
  margin: 8px 0 14px;
  font-size: 22px;
}

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

.small {
  font-size: 11px;
}

.page-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  color: #0f172a;
  font-size: 12px;
  white-space: nowrap;
}

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

.card {
  background: var(--card);
  border-radius: var(--radius2);
  padding: 14px;
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 12px 28px rgba(2, 6, 23, .06);
}

.card-title {
  font-weight: 900;
  margin-bottom: 8px;
}

code {
  background: #f1f5f9;
  padding: 2px 6px;
  border-radius: 10px;
}

/* Login */
.login-wrap {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 16px;
  background: radial-gradient(1200px 600px at 10% 10%, rgba(37, 99, 235, .12), transparent 55%),
    radial-gradient(900px 500px at 80% 20%, rgba(99, 102, 241, .10), transparent 55%),
    #f3f5f9;
}

.login-card {
  width: 380px;
  background: #fff;
  border-radius: 20px;
  padding: 16px;
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 18px 40px rgba(2, 6, 23, .10);
}

/* Forms */
.input,
.select,
.textarea {
  padding: 11px 14px;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, .14);
  outline: none;
  background: #fff;
  font-family: inherit;
  font-size: 14px;
  transition: all .2s ease;
  width: 100%;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(37, 99, 235, .45);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, .12);
}

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

.field span {
  font-size: 12px;
  color: #475569;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.025em;
}

.hint {
  font-size: 12px;
  color: #64748b;
  margin-top: 2px;
}

/* Alerts and Flash messages */
.alert {
  background: #fee2e2;
  border: 1px solid #fecaca;
  color: #991b1b;
  padding: 12px 16px;
  border-radius: 14px;
  margin-bottom: 16px;
}

.flash {
  background: #dcfce7;
  border: 1px solid #bbf7d0;
  color: #14532d;
  padding: 12px 16px;
  border-radius: 14px;
  margin: 10px 0 20px;
}

/* Tables */
.table-wrap {
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 4px 12px rgba(2, 6, 23, .03);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}

.table th,
.table td {
  padding: 12px 16px;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
  text-align: left;
  vertical-align: middle;
}

.table th {
  font-size: 11px;
  color: #64748b;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  font-weight: 700;
  background: rgba(248, 250, 252, 0.6);
}

.th-sort {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}
.th-sort:hover {
  color: #1e40af;
}
.th-sort--active {
  color: #1d4ed8;
}
.th-sort-icon--idle {
  opacity: 0.35;
  font-size: 9px;
}
.th-sort-icon--active {
  font-size: 10px;
}

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

.table tr:hover td {
  background: rgba(248, 250, 252, 0.4);
}

/* Status Pills and Badges */
.pill,
.badge,
.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  border: 1px solid rgba(15, 23, 42, .10);
  background: #fff;
  white-space: nowrap;
}

.status-pill.off,
.pill.red {
  color: #991b1b;
  border-color: rgba(153, 27, 27, .18);
  background: #fef2f2;
}

.status-pill.on,
.pill.green {
  color: #14532d;
  border-color: rgba(20, 83, 45, .18);
  background: #f0fdf4;
}

.pilltype {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 12px;
  border: 1px solid rgba(15, 23, 42, .10);
  background: #fff;
  white-space: nowrap;
  color: #0f172a;
}

.pilltype.finished {
  background: rgba(37, 99, 235, .08);
  border-color: rgba(37, 99, 235, .20);
}

.pilltype.semifinished {
  background: rgba(16, 185, 129, .10);
  border-color: rgba(16, 185, 129, .22);
}

.badge.w {
  background: #eff6ff;
  border-color: #bfdbfe;
  color: #1e40af;
}

.badge.p {
  background: #ecfdf5;
  border-color: #a7f3d0;
  color: #065f46;
}

/* Modal and Premium Cards */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .55);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  z-index: 50;
  backdrop-filter: blur(4px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.modal {
  width: min(720px, 100%);
  margin: auto;
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, .10);
  box-shadow: 0 25px 50px -12px rgba(2, 6, 23, .25);
  overflow: hidden;
  flex-shrink: 0;
}

.modal-head,
.card-head {
  padding: 18px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  background: rgba(248, 250, 252, 0.5);
}

.modal-title,
.card-title {
  font-weight: 800;
  font-size: 1.1rem;
  display: flex;
  align-items: center;
  gap: 10px;
  color: #1e293b;
  margin: 0;
}

.modal-body,
.card-body {
  padding: 20px;
  display: grid;
  gap: 16px;
}


.modal-foot,
.card-foot {
  padding: 16px 20px;
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  border-top: 1px solid rgba(15, 23, 42, .08);
  background: rgba(248, 250, 252, 0.5);
  flex-wrap: wrap;
}

.card-premium {
  background: #fff;
  border-radius: 20px;
  border: 1px solid rgba(15, 23, 42, .10);
  box-shadow: 0 10px 30px rgba(2, 6, 23, .05);
  margin-bottom: 24px;
  overflow: hidden;
}

/* File rows and image thumbnails */
.thumb {
  max-height: 48px;
  max-width: 72px;
  object-fit: contain;
  border-radius: 4px;
  display: block;
}

.file-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.file-row .thumb {
  max-height: 80px;
  max-width: 120px;
  border-radius: 6px;
  flex-shrink: 0;
}

/* Toolbars */
.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
  margin: 12px 0 20px;
  flex-wrap: wrap;
}

.toolbar .left {
  display: flex;
  gap: 12px;
  align-items: center;
  flex-wrap: wrap;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.pagination .btn2.disabled {
  opacity: .35;
  pointer-events: none;
}

.pagination-ellipsis {
  color: #94a3b8;
  padding: 0 4px;
  align-self: center;
}

/* Grids */
.grid2 {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

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

/* Responsive */
@media (max-width: 980px) {
  .grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .sidebar {
    position: fixed;
    top: var(--top);
    left: 0;
    height: calc(100vh - var(--top));
    transform: translateX(-102%);
    box-shadow: 0 18px 50px rgba(2, 6, 23, .35);
  }

  .sb-toggle:checked~.app .sidebar {
    transform: translateX(0);
  }

  .sb-toggle:checked~.sb-overlay {
    display: block;
  }

  .btn-text {
    display: none;
  }
}

@media (min-width: 861px) {
  .burger {
    display: none;
  }

  .sb-toggle:not(:checked)~.app .sidebar {
    width: 86px;
  }

  .sb-toggle:not(:checked)~.app .sidebar .nav-tx,
  .sb-toggle:not(:checked)~.app .sidebar .nav-group-title,
  .sb-toggle:not(:checked)~.app .sidebar .sidebar-footnote span {
    display: none;
  }

  .sb-toggle:not(:checked)~.app .sidebar .nav-sub {
    display: none;
  }

  .sb-toggle:not(:checked)~.app .sidebar .nav-group-arrow {
    display: none;
  }
}

.table img {
  width: 100px
}

/* ── Utility classes ─────────────────────────────────── */
.card-heading {
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 10px;
}

.field-label {
  font-size: 12px;
}

.hint-text {
  margin-top: 10px;
  font-size: 12px;
}

.mb-sm {
  margin-bottom: 10px;
}

.fw-heavy {
  font-weight: 900;
}

.filter-bar {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: flex-end;
  margin-bottom: 12px;
}

.filter-field-wide {
  min-width: 320px;
}

.row-undone {
  opacity: .65;
}

.capacity-hint {
  margin-top: 6px;
}

.btn2:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Layout helpers ──────────────────────────────────── */
.card-title-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
}

.card-head-tools {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

.card-nomargin {
  margin: 0;
}

.mt-sm {
  margin-top: 8px;
}

.field-span2 {
  grid-column: span 2;
}

.invoice-photo {
  max-width: 100%;
  border-radius: 14px;
  border: 1px solid rgba(15, 23, 42, .10);
}

/* ── Generic table column widths ─────────────────────── */
.col-40 {
  width: 40px;
}

.col-70 {
  width: 70px;
}

.col-90 {
  width: 90px;
}

.col-110 {
  width: 110px;
}

.col-120 {
  width: 120px;
}

.col-130 {
  width: 130px;
}

.col-140 {
  width: 140px;
}

.col-150 {
  width: 150px;
}

.col-160 {
  width: 160px;
}

.col-170 {
  width: 170px;
}

.col-180 {
  width: 180px;
}

.col-190 {
  width: 190px;
}

.col-200 {
  width: 200px;
}

.col-210 {
  width: 210px;
}

/* ── shifts.php ──────────────────────────────────────── */
.shift-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  align-items: center;
}

.stat-number {
  font-size: 28px;
  font-weight: 900;
}

.stat-danger {
  color: #991b1b;
}

.row-danger {
  background: rgba(254, 226, 226, .55);
}

.text-sm {
  font-size: 12px;
}

.form-inline {
  display: inline;
}

.qr-center {
  text-align: center;
}

/* ── orders.php / partner_orders.php ─────────────────────────────── */

/* Order status badge variants — key matches DB status value */
.status-pill--new {
  color: #3b82f6;
  background: #eff6ff;
  border-color: #bfdbfe;
}

.status-pill--in_progress {
  color: #d97706;
  background: #fffbeb;
  border-color: #fde68a;
}

.status-pill--sent {
  color: #059669;
  background: #ecfdf5;
  border-color: #a7f3d0;
}

.status-pill--done {
  color: #16a34a;
  background: #f0fdf4;
  border-color: #bbf7d0;
}

.status-pill--rejected {
  color: #dc2626;
  background: #fef2f2;
  border-color: #fecaca;
}

.status-pill--lg {
  font-size: 14px;
  padding: 8px 16px;
}

/* Personalized order markers */
.badge-personalized {
  font-size: 10px;
  color: #92400e;
  background: #fffbeb;
  padding: 1px 6px;
  border-radius: 4px;
  border: 1px solid #fde68a;
}

.order-cp-id {
  font-size: 13px;
  color: #92400e;
  background: #fffbeb;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid #fde68a;
  margin-left: 8px;
  font-weight: 600;
  vertical-align: middle;
}

.tr--personalized {
  background: rgba(251, 191, 36, .04);
}

/* Personalized product card variant */
.card-premium--personalized {
  border-color: rgba(251, 191, 36, .35);
}

.card-premium--personalized .card-head {
  background: rgba(255, 251, 235, .6);
}

.card-premium--personalized .card-title {
  color: #92400e;
}

/* Custom product status banners */
.cp-status {
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid;
  font-size: 13px;
  margin-top: 8px;
}

.cp-status--pending {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.cp-status--approved {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #16a34a;
  font-weight: 600;
}

.cp-status--progress {
  background: #fffbeb;
  border-color: #fde68a;
  color: #d97706;
  font-weight: 600;
}

.cp-status--done {
  background: #f0fdf4;
  border-color: #bbf7d0;
  color: #16a34a;
  font-weight: 600;
}

/* Manager's approve-layout box (blue, contains button) */
.cp-approve-box {
  padding: 14px;
  background: #eff6ff;
  border-radius: 12px;
  border: 1px solid #bfdbfe;
  margin-top: 8px;
}

/* Finance rows in order detail sidebar */
.fin-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  border-bottom: 1px solid rgba(15, 23, 42, .06);
}

.fin-row:last-child {
  border-bottom: none;
}

/* Autocomplete / suggest dropdown */
.suggest { position: relative; }
.suggest-list {
  display: none; position: absolute; z-index: 10; top: 100%; width: 100%;
  background: #fff; border: 1px solid rgba(15,23,42,.12); border-radius: 12px;
  max-height: 260px; overflow-y: auto; box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.suggest-item { padding: 10px 12px; cursor: pointer; border-bottom: 1px solid rgba(15,23,42,.06); font-size: 13px; }
.suggest-item:hover { background: rgba(37,99,235,.08); }
.suggest-item:last-child { border-bottom: none; }
.suggest-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.suggest-thumb-empty { width: 36px; height: 36px; border-radius: 6px; background: #f1f5f9; flex-shrink: 0; }
.suggest-item-row { display: flex; align-items: center; gap: 10px; }
.suggest-item-name { font-weight: 600; }

/* Custom-point card (orders personalization) */
.cp-card {
  padding: 12px; border-radius: 12px; margin-bottom: 8px;
  border: 1px solid #fde68a; background: #fffdf5;
}
.cp-label {
  display: flex; align-items: center; gap: 10px;
  cursor: pointer; font-weight: 600; color: #92400e;
}
.cp-label:has(input:disabled) {
  opacity: 0.6;
  cursor: not-allowed;
}
.cp-meta { font-size: 11px; color: #b45309; margin: 4px 0 8px 28px; }
.cp-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-left: 28px; }
.cp-fields .field { margin: 0; }
.cp-fields .field span { font-size: 11px; }

/* Techprocess: component & custom-point rows */
.comp-row {
  display: grid; grid-template-columns: 1fr 100px 1fr 36px;
  gap: 10px; align-items: center; margin-bottom: 8px;
}

.cp-row {
  display: flex; gap: 10px; align-items: center; margin-bottom: 8px;
}
.cp-row .input { flex: 1; }
.btn-icon { padding: 8px; }

/* Custom produce modal: point details */
.cpm-title { font-weight: 600; margin-bottom: 8px; }
.cpm-point { margin-bottom: 8px; }
.cpm-engraving-text { padding-left: 16px; }
.cpm-engraving-img { max-height: 80px; border-radius: 6px; margin-left: 16px; margin-top: 4px; }
.cpm-comment { margin-top: 8px; }

/* Impersonation banner */
.impersonate-bar {
  background: #f59e0b;
  color: #78350f;
  padding: 6px 16px;
  font-size: 13px;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: center;
}
.impersonate-form { display: inline; margin: 0; }
/* CRUD page helpers — shared by categories, items, warehouses, items_cost */
.card + .card { margin-top: 12px; }
.card-toolbar { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; }
.card-title { margin: 0; }
.text-dim { opacity: 0.8; }
.btn-row { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.search-form { display: flex; gap: 6px; align-items: center; }
.search-input { min-width: 220px; }
.table-scroll { overflow: auto; }
.col-id { width: 90px; }
.col-actions { width: 140px; }
.nowrap { white-space: nowrap; }
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 12px; flex-wrap: wrap; }
.pagination-info { padding: 6px 10px; opacity: 0.8; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-actions { margin-top: 14px; display: flex; gap: 8px; flex-wrap: wrap; }
.col-narrow { width: 110px; }
.col-med { width: 170px; }
.text-hint { opacity: 0.7; font-size: 12px; }
.checkbox-label { display: flex; gap: 8px; align-items: center; margin-top: 6px; }
.checkbox-label:has(input:disabled) {
  opacity: 0.6;
  text-decoration: line-through;
  cursor: not-allowed;
}
.photo-preview { margin-top: 8px; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.item-thumb-sm { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; }
.item-thumb-lg { width: 90px; height: 90px; object-fit: cover; border-radius: 10px; }

/* Impersonation banner */
.impersonate-btn {
  background: #78350f;
  color: #fff;
  border: none;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 12px;
}

/* ── Utility: font sizes ─────────────────────────────────────────── */
.fs-11 { font-size: 11px; }
.fs-12 { font-size: 12px; }
.fs-13 { font-size: 13px; }
.fw-500 { font-weight: 500; }
.fw-600 { font-weight: 600; }
.fw-normal { font-weight: 400; }

/* ── Utility: colours ────────────────────────────────────────────── */
.text-muted  { color: var(--muted, #64748b); }
.text-danger { color: #dc2626; }
.text-success{ color: #16a34a; }
.text-blue   { color: #1e40af; }

/* ── Utility: display ────────────────────────────────────────────── */
.d-none { display: none; }

/* ── btn2 variants ───────────────────────────────────────────────── */
.btn2-icon { padding: 7px 10px; }
.btn-lg    { padding: 14px 28px; font-size: 15px; }

/* ── Toolbar ─────────────────────────────────────────────────────── */
.toolbar-filters { flex-wrap: wrap; }
.toolbar-divider { width: 1px; height: 20px; background: rgba(15,23,42,.1); margin: 0 4px; align-self: center; }

/* ── Input variants ──────────────────────────────────────────────── */
.input-auto  { width: auto; padding: 8px 12px; font-size: 13px; }
.items-search-input { width: 250px; max-width: 100%; }
.input-mono  { font-family: monospace; font-size: 15px; letter-spacing: 1px; }
.input-ghost { background: transparent; border: none; font-weight: 700; color: var(--txt); font-size: 14px; padding: 0; width: 70px; outline: none; }

/* ── Back link ───────────────────────────────────────────────────── */
.back-link { color: var(--muted, #64748b); text-decoration: none; font-size: 13px; }
.back-link:hover { text-decoration: underline; }

/* ── Orders: list ────────────────────────────────────────────────── */
.goods-cell  { display: flex; align-items: center; gap: 8px; }
.goods-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; flex-shrink: 0; }
.urgent-badge { color: #dc2626; }
.empty-state-card { text-align: center; padding: 40px; color: var(--muted, #64748b); }
.empty-state-card .empty-icon { font-size: 32px; margin-bottom: 12px; display: block; opacity: .4; }

/* ── Orders: edit layout ─────────────────────────────────────────── */
.order-edit-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
  align-items: start;
}
.order-edit-main { display: grid; gap: 16px; }
.order-edit-side { display: grid; gap: 16px; }
.goods-cell--editor { align-items: stretch; }
.order-goods-list { display: grid; gap: 12px; }
.order-goods-row {
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 14px;
  padding: 12px;
  background: #f8fafc;
}
.order-goods-row-top {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  align-items: flex-start;
}
.order-goods-suggest { min-width: 0; flex: 1; }
.order-goods-thumb-wrap {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.goods-row-thumb,
.goods-row-thumb-placeholder { width: 36px; height: 36px; }
.order-goods-controls {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.order-goods-qty-field { width: 92px; margin: 0; }
.order-goods-qty-field span,
.order-goods-price,
.order-goods-pers-label { font-size: 12px; }
.order-goods-row-meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 10px;
  color: var(--muted, #64748b);
}
.order-goods-actions { margin-top: 12px; }
.order-prices-grid { margin-top: 16px; }
.order-cancel-form { margin-top: 16px; }
.pers-details {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, .08);
}
.order-item-points + .order-item-points { margin-top: 14px; }
.order-item-points-head { margin-bottom: 8px; }
.cp-fields--stacked {
  grid-template-columns: 1fr;
  margin-left: 0;
  margin-top: 8px;
}
.order-point-image-wrap { margin-top: 8px; }

@media (max-width: 900px) {
  .order-edit-grid { grid-template-columns: 1fr; }
  .order-goods-row-top { flex-direction: column; }
  .order-goods-controls { justify-content: flex-start; }
  .order-goods-qty-field { width: 100%; max-width: 120px; }
}

/* ── Orders: field-readonly (price display) ──────────────────────── */
.field-readonly { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.field-readonly span { font-size: 12px; color: #475569; font-weight: 700; text-transform: uppercase; letter-spacing: 0.025em; }

/* ── Orders: urgent label ────────────────────────────────────────── */
.urgent-label { font-weight: 600; color: #dc2626; }

/* ── Orders: personalization points (edit view) ──────────────────── */
.cp-points-list  { margin-top: 12px; display: grid; gap: 8px; }
.cp-point-card   { padding: 12px; border-radius: 12px; border: 1px solid #fde68a; background: #fffdf5; }
.cp-point-label  { font-weight: 600; color: #92400e; margin-bottom: 4px; }
.cp-point-img    { max-width: 180px; border-radius: 8px; margin-top: 4px; display: block; }

/* ── Orders: personalization loading/empty states ────────────────── */
.pers-loading,
.pers-none { padding: 12px; color: var(--muted, #64748b); font-size: 13px; background: #f8fafc; border-radius: 10px; }

/* ── Orders: change log ──────────────────────────────────────────── */
.change-log-body { max-height: 200px; overflow-y: auto; font-size: 12px; color: var(--muted, #64748b); }
.change-log-row  { padding: 4px 0; border-bottom: 1px solid rgba(15,23,42,.04); }
.change-log-row:last-child { border-bottom: none; }

/* ── Orders: partner info box ────────────────────────────────────── */
.partner-info-box {
  margin-top: 10px;
  padding: 10px;
  background: #f8fafc;
  border-radius: 10px;
  font-size: 12px;
  color: var(--muted, #64748b);
}

/* ── Card2 (secondary card style used in salary module) ─────────── */
.card2 {
  background: #fff;
  border: 1px solid rgba(15, 23, 42, .08);
  border-radius: 18px;
  overflow: hidden;
}

.card2-head {
  padding: 12px 14px;
  border-bottom: 1px solid rgba(15, 23, 42, .08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.card2-title {
  font-weight: 900;
  display: flex;
  align-items: center;
  gap: 10px;
}
.card2-body { padding: 12px 14px; }

/* ── Responsive hide ─────────────────────────────────────────────── */
@media (max-width: 860px) {
  .hide-sm { display: none; }
}

/* ── Partner orders: locked order notice ─────────────────────────── */
.po-locked-notice {
  padding: 12px 16px;
  background: #eff6ff;
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  margin-bottom: 16px;
  color: #1e40af;
  font-size: 13px;
}

/* ─── Dashboard ───────────────────────────────────────── */

.dashboard-controls {
  display: flex;
  gap: 16px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.dashboard-controls .date-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
}

.dashboard-controls .date-nav input {
  background: #0f3460;
  border: 1px solid var(--line);
  border-radius: 4px;
  color: #f1f5f9;
  font-size: 13px;
  font-weight: 600;
  padding: 4px 10px;
  min-width: 120px;
  text-align: center;
  cursor: pointer;
}

.dashboard-controls .date-nav input:focus {
  outline: none;
  border-color: #2563eb;
}

.dashboard-controls .date-nav button {
  background: none;
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 3px 8px;
  cursor: pointer;
  color: var(--txt);
  font-size: 13px;
  line-height: 1.4;
}

.dashboard-controls .date-nav button:hover {
  background: var(--bg2);
}

.dashboard-controls .date-nav span.date-val {
  min-width: 110px;
  text-align: center;
  font-weight: 600;
}

.dashboard-section-label {
  font-size: 11px;
  text-transform: uppercase;
  color: var(--muted);
  margin: 16px 0 8px;
  letter-spacing: 0.5px;
}

.dashboard-grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.dashboard-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 12px;
}

.dash-card {
  background: #0f3460;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

.dash-card-title {
  font-size: 12px;
  color: var(--muted);
  margin-bottom: 8px;
}

.dash-filter-tag {
  font-size: 10px;
  font-weight: 400;
  opacity: 0.6;
  margin-left: 2px;
}

.dash-card-big {
  font-size: 28px;
  font-weight: 700;
  margin: 4px 0;
  color: #f1f5f9;
}

.dash-card-list {
  font-size: 13px;
  line-height: 1.7;
  color: #cbd5e1;
}

.dash-row {
  display: flex;
  justify-content: space-between;
  padding: 1px 0;
}

.dash-row-total {
  border-top: 1px solid var(--line);
  margin-top: 4px;
  padding-top: 6px;
  font-weight: 600;
}

/* Status colors */
.dash-status-new        { color: #4ade80; }
.dash-status-in_progress { color: #fbbf24; }
.dash-status-sent       { color: #60a5fa; }
.dash-status-done       { color: #a78bfa; }
.dash-status-rejected   { color: #f87171; }
.dash-alert             { color: #f87171; }

/* Pipeline counters */
.dash-pipeline {
  display: flex;
  gap: 20px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.dash-pipeline-item {
  text-align: center;
}

.dash-pipeline-count {
  font-size: 24px;
  font-weight: 700;
}

.dash-pipeline-label {
  font-size: 11px;
  color: var(--muted);
}

/* Bar charts */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 72px;
  margin-top: 10px;
}

.bar-chart-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
  justify-content: flex-end;
}

.bar-chart-bar {
  width: 100%;
  max-width: 28px;
  border-radius: 3px 3px 0 0;
  min-height: 2px;
  height: calc(var(--bar-height, 0) * 1px);
  transition: height 0.3s ease;
}

.bar-chart-dual {
  display: flex;
  gap: 2px;
  width: 100%;
  max-width: 28px;
  height: 56px;
  align-items: flex-end;
}

.bar-chart-dual .bar-half {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-height: 2px;
  transition: height 0.3s ease;
}

.bar-green   { background: #4ade80; }
.bar-orange  { background: #fb923c; }
.bar-blue    { background: #60a5fa; }
.bar-purple  { background: #a78bfa; }
.bar-pink    { background: #f472b6; }
.bar-indigo  { background: #818cf8; }

.bar-chart-label {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 3px;
}

.bar-chart-value {
  font-size: 9px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
}

.bar-chart-legend {
  display: flex;
  gap: 12px;
  font-size: 11px;
  color: var(--muted);
  margin-top: 6px;
  flex-wrap: wrap;
}

.bar-chart-legend span {
  display: flex;
  align-items: center;
  gap: 4px;
}

.bar-chart-legend span::before {
  content: '';
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 2px;
  flex-shrink: 0;
}

.legend-green::before  { background: #4ade80; }
.legend-blue::before   { background: #60a5fa; }
.legend-orange::before { background: #fb923c; }
.legend-pink::before   { background: #f472b6; }
.legend-indigo::before { background: #818cf8; }
.legend-purple::before { background: #a78bfa; }

/* Item search inside dash card */
.dash-card .suggest {
  margin-bottom: 8px;
  position: relative;
}

.dash-card .suggest input {
  width: 100%;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--bg2);
  color: #f1f5f9;
}

.dash-card .suggest-list {
  background: var(--panel);
  border-color: var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

.dash-card .suggest-item {
  color: #cbd5e1;
  border-bottom-color: var(--line);
}

.dash-card .suggest-item:hover {
  background: rgba(37,99,235,.18);
}

/* Flatpickr dark theme */
.flatpickr-calendar {
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(0,0,0,.4);
}

.flatpickr-months .flatpickr-month,
.flatpickr-weekdays,
span.flatpickr-weekday {
  background: var(--panel);
  color: #94a3b8;
}

.flatpickr-current-month input.cur-year,
.flatpickr-current-month .flatpickr-monthDropdown-months {
  color: #f1f5f9;
}

.flatpickr-day {
  color: #cbd5e1;
}

.flatpickr-day:hover,
.flatpickr-day.prevMonthDay:hover,
.flatpickr-day.nextMonthDay:hover {
  background: rgba(37,99,235,.25);
  border-color: transparent;
}

.flatpickr-day.selected,
.flatpickr-day.selected:hover {
  background: #2563eb;
  border-color: #2563eb;
  color: #fff;
}

.flatpickr-day.today {
  border-color: #2563eb;
}

.flatpickr-day.prevMonthDay,
.flatpickr-day.nextMonthDay {
  color: #475569;
}

.flatpickr-months .flatpickr-prev-month,
.flatpickr-months .flatpickr-next-month {
  color: #94a3b8;
  fill: #94a3b8;
}

.flatpickr-months .flatpickr-prev-month:hover,
.flatpickr-months .flatpickr-next-month:hover {
  color: #f1f5f9;
  fill: #f1f5f9;
}

.flatpickr-weekwrapper .flatpickr-weeks {
  border-left-color: var(--line);
  box-shadow: none;
}

.flatpickr-weekwrapper span.flatpickr-day {
  color: #475569;
}

/* Responsive */
@media (max-width: 1100px) {
  .dashboard-grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 600px) {
  .dashboard-grid-4,
  .dashboard-grid-2 { grid-template-columns: 1fr; }
}

/* --- partners_goods --- */
.partners-goods-cat-hint { font-size: 12px; margin-bottom: 8px; }

.cat-node { display: flex; flex-direction: column; }
.cat-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  text-decoration: none;
  color: inherit;
  font-size: 14px;
}
.cat-link:hover { background: rgba(99,102,241,.08); }
.cat-link.active { background: rgba(99,102,241,.15); font-weight: 600; }
.cat-children {
  padding-left: 18px;
  border-left: 2px solid rgba(99,102,241,.15);
  margin-left: 12px;
}
.col-sku    { width: 140px; }
.col-thumb  { width: 90px; }
.col-cat    { width: 170px; }
.col-price  { width: 120px; }
.col-qty    { width: 80px; }
.col-unit   { width: 40px; }
.col-actions-wide { width: 260px; text-align: right; }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; flex-wrap: wrap; }
.sku-cell   { font-weight: 900; }
.form-label { font-size: 12px; color: var(--color-muted, #888); margin-bottom: 4px; }
.form-grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.file-section { margin-top: 10px; }
.file-path  { font-size: 12px; word-break: break-all; }
.file-keep-label { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.pg-upload-hint { font-size: 12px; margin-top: 8px; }

/* ── partner_xml config ── */
.token-preview { font-family: monospace; font-size: 12px; }
.pxml-url-row { display: flex; gap: 6px; align-items: center; }
.pxml-url-input { flex: 1; font-family: monospace; font-size: 12px; }
.pxml-config-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.pxml-check-label { display: flex; align-items: center; gap: 8px; cursor: pointer; padding: 2px 0; }
.pxml-check-label input[type="checkbox"] { flex-shrink: 0; }
.pxml-goods-list { max-height: 500px; overflow-y: auto; }
.pxml-goods-row { border-bottom: 1px solid var(--border); padding: 6px 0; }
.pxml-goods-row:last-child { border-bottom: none; }
.pxml-goods-label { font-size: 14px; }
.pxml-photos { display: flex; flex-wrap: wrap; gap: 8px; padding: 6px 0 2px 24px; }
.pxml-photos-hidden { display: none; }
.pxml-photo-label { flex-direction: column; align-items: flex-start; font-size: 11px; }
.pxml-save-bar { margin-top: 16px; display: flex; justify-content: flex-end; }

/* items list */
.item-type-finished {
  background-color: #F5F9F5;
}

.item-type-semifinished {
  background-color: #F4F7FB;
}

.item-type-components {
  background-color: #F8F4EC;
}

.item-type-consumables {
  background-color: #FAF4F7;
}

.items-table table td {
  padding: 5px 11px;
}

/* partner_create: inline action form next to link */
.form-inline {
  display: inline-block;
  vertical-align: middle;
  margin-left: 8px;
}

/* partner_payments */
.balance-display {
  font-size: 1.25rem;
  margin-bottom: 12px;
}
.row-neutral td {
  color: var(--muted);
  background: rgba(107, 114, 128, 0.08);
}
.inline-form {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.inline-form input[type="text"],
.inline-form input[type="number"] {
  max-width: 120px;
}
.payout-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.balance-partner-title {
  margin: 0 0 12px;
  font-size: 1.25rem;
}

.payout-request-form .form-row,
.payout-request-actions {
  margin-top: 12px;
}

.payout-request-form textarea {
  width: 100%;
  max-width: 420px;
}