/* ============================================
   GRAVIRAVIMO CRM — Design System 2026
   ============================================ */

:root {
  /* Brand Colors */
  --primary: #006b99;
  --primary-light: #0284c7;
  --primary-dark: #004d6e;
  --primary-bg: rgba(0, 107, 153, 0.06);
  --primary-border: rgba(0, 107, 153, 0.18);

  /* Neutrals */
  --bg: #f4f6f9;
  --bg-card: #ffffff;
  --bg-sidebar: #0f1923;
  --bg-sidebar-hover: rgba(255, 255, 255, 0.07);
  --bg-sidebar-active: rgba(0, 107, 153, 0.25);

  --text: #0f1923;
  --text-secondary: #5a6a7a;
  --text-muted: #8c9aaa;
  --text-sidebar: rgba(255, 255, 255, 0.7);
  --text-sidebar-active: #ffffff;

  --border: #e2e8f0;
  --border-light: #f1f5f9;

  /* Status Colors */
  --status-new: #3b82f6;
  --status-new-bg: rgba(59, 130, 246, 0.08);
  --status-progress: #f59e0b;
  --status-progress-bg: rgba(245, 158, 11, 0.08);
  --status-done: #16a34a;
  --status-done-bg: rgba(22, 163, 74, 0.08);
  --status-cancelled: #dc2626;
  --status-cancelled-bg: rgba(220, 38, 38, 0.08);
  --status-waiting: #6b7280;
  --status-waiting-bg: rgba(107, 114, 128, 0.08);
  --status-finished: #15803d;
  --status-finished-bg: rgba(21, 128, 61, 0.08);

  /* Spacing */
  --space-xs: 4px;
  --space-sm: 8px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 32px;
  --space-2xl: 48px;

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 10px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 20px rgba(0, 107, 153, 0.07);
  --shadow-lg: 0 8px 40px rgba(0, 107, 153, 0.10);
  --shadow-card: 0 1px 4px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.03);

  /* Transitions */
  --transition: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================
   Reset & Base
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

a:hover {
  color: var(--primary-light);
}

/* ============================================
   Layout
   ============================================ */
.app {
  display: flex;
  min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.sidebar {
  width: 260px;
  background: var(--bg-sidebar);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  z-index: 100;
  overflow-y: auto;
}

.sidebar-logo {
  padding: var(--space-lg) var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-md);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-logo-icon {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  flex-shrink: 0;
}

.sidebar-logo-text {
  color: #fff;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
}

.sidebar-logo-text span {
  display: block;
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--text-sidebar);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-top: 2px;
}

.sidebar-nav {
  padding: var(--space-md) var(--space-sm);
  flex: 1;
}

.sidebar-section-label {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.3);
  padding: var(--space-lg) var(--space-md) var(--space-sm);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: 10px var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text-sidebar);
  font-size: 0.9rem;
  font-weight: 500;
  transition: all var(--transition);
  cursor: pointer;
  position: relative;
}

.sidebar-link:hover {
  background: var(--bg-sidebar-hover);
  color: var(--text-sidebar-active);
}

.sidebar-link.active {
  background: var(--bg-sidebar-active);
  color: var(--text-sidebar-active);
  font-weight: 600;
}

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: -8px;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 20px;
  background: var(--primary-light);
  border-radius: var(--radius-full);
}

.sidebar-link svg {
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  opacity: 0.7;
}

.sidebar-link.active svg {
  opacity: 1;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--primary);
  color: #fff;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
  line-height: 1.4;
}

.sidebar-footer {
  padding: var(--space-md);
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  padding: var(--space-sm) var(--space-sm);
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--transition);
}

.sidebar-user:hover {
  background: var(--bg-sidebar-hover);
}

.sidebar-avatar {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-full);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 600;
  font-size: 0.85rem;
  flex-shrink: 0;
}

.sidebar-user-info {
  flex: 1;
  min-width: 0;
}

.sidebar-user-name {
  color: #fff;
  font-size: 0.85rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-user-role {
  color: var(--text-sidebar);
  font-size: 0.72rem;
}

/* ============================================
   Main Content
   ============================================ */
.main {
  flex: 1;
  margin-left: 260px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ============================================
   Top Bar
   ============================================ */
.topbar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 0 var(--space-xl);
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 50;
}

.topbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.topbar-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.topbar-breadcrumb {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
}

.topbar-breadcrumb svg {
  width: 14px;
  height: 14px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.topbar-search {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  padding: 8px 16px;
  font-size: 0.85rem;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  min-width: 220px;
}

.topbar-search:hover {
  border-color: var(--primary-border);
}

.topbar-search svg {
  width: 16px;
  height: 16px;
  opacity: 0.5;
}

.topbar-search kbd {
  margin-left: auto;
  font-size: 0.7rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 1px 6px;
  font-family: inherit;
  color: var(--text-muted);
}

.topbar-icon-btn {
  width: 38px;
  height: 38px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition);
  color: var(--text-secondary);
  position: relative;
}

.topbar-icon-btn:hover {
  border-color: var(--primary-border);
  color: var(--primary);
  background: var(--primary-bg);
}

.topbar-icon-btn svg {
  width: 18px;
  height: 18px;
}

.topbar-icon-btn .notification-dot {
  position: absolute;
  top: 7px;
  right: 7px;
  width: 7px;
  height: 7px;
  background: var(--status-cancelled);
  border-radius: 50%;
  border: 2px solid var(--bg-card);
}

/* ============================================
   Page Content
   ============================================ */
.page-content {
  padding: var(--space-xl);
  flex: 1;
}

/* ============================================
   Stats Row
   ============================================ */
.stats-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-md);
  margin-bottom: var(--space-xl);
}

.stat-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
}

.stat-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md);
}

.stat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.stat-icon {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
}

.stat-icon svg {
  width: 20px;
  height: 20px;
}

.stat-icon.blue {
  background: var(--primary-bg);
  color: var(--primary);
}

.stat-icon.green {
  background: var(--status-done-bg);
  color: var(--status-done);
}

.stat-icon.amber {
  background: var(--status-progress-bg);
  color: var(--status-progress);
}

.stat-icon.violet {
  background: var(--status-waiting-bg);
  color: var(--status-waiting);
}

.stat-trend {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: var(--radius-full);
}

.stat-trend.up {
  color: var(--status-done);
  background: var(--status-done-bg);
}

.stat-trend.down {
  color: var(--status-cancelled);
  background: var(--status-cancelled-bg);
}

.stat-value {
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.2;
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.stat-sub {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
}

.stat-series-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: 1px;
}

.stat-series-dot--current { background: #0f8df5; }
.stat-series-dot--previous { background: #0aa36f; }
.stat-series-separator { color: var(--border-strong); }

.chart-tooltip {
  min-width: 150px;
  padding: 11px 13px;
  background: #fff;
  color: #0f172a;
  border-radius: 8px;
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.16);
  border: 1px solid #e5e7eb;
}

.chart-tooltip-title {
  font-size: 0.8rem;
  color: #64748b;
  margin-bottom: 8px;
}

.chart-tooltip-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 9px;
  font-size: 0.78rem;
  color: #0f172a;
}

.chart-tooltip-row + .chart-tooltip-row {
  margin-top: 7px;
}

.chart-tooltip-row strong {
  font-weight: 800;
}

.chart-tooltip-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
}

.chart-tooltip-dot--current { background: #0f8df5; }
.chart-tooltip-dot--previous { background: #0aa36f; }

.stat-all-done-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 5px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--status-done);
  background: var(--status-done-bg);
  padding: 3px 8px;
  border-radius: var(--radius-full);
}

.stat-card.all-done {
  border-color: rgba(22, 163, 74, 0.3);
  background: linear-gradient(150deg, var(--bg-card) 70%, rgba(22, 163, 74, 0.05));
}

.stat-progress {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 6px;
}

.stat-progress-track {
  flex: 1;
  height: 4px;
  background: var(--border);
  border-radius: var(--radius-full);
  overflow: hidden;
}

.stat-progress-fill {
  height: 100%;
  background: var(--status-done);
  border-radius: var(--radius-full);
  transition: width 0.6s ease;
}

.stat-progress-text {
  font-size: 0.7rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* ============================================
   Toolbar
   ============================================ */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
  gap: var(--space-md);
}

.toolbar-left {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 3px;
  gap: 2px;
}

.filter-tab {
  padding: 7px 16px;
  border-radius: var(--radius-sm);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
  border: none;
  background: none;
  white-space: nowrap;
}

.filter-tab:hover {
  color: var(--text);
  background: var(--bg);
}

.filter-tab.active {
  background: var(--primary);
  color: #fff;
  font-weight: 600;
}

.filter-tab .count {
  margin-left: 6px;
  font-size: 0.72rem;
  opacity: 0.7;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: 9px 18px;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 600;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  font-family: inherit;
  white-space: nowrap;
}

.btn svg {
  width: 16px;
  height: 16px;
}

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

.btn-primary:hover {
  background: var(--primary-light);
  border-color: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 107, 153, 0.25);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--primary-border);
  color: var(--primary);
}

.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border-color: transparent;
  padding: 9px 12px;
}

.btn-ghost:hover {
  background: var(--bg);
  color: var(--text);
}

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

.btn-danger:hover {
  background: #b91c1c;
}

.btn-sm {
  padding: 6px 12px;
  font-size: 0.8rem;
}

.btn-icon {
  width: 36px;
  height: 36px;
  padding: 0;
  justify-content: center;
  border-radius: var(--radius-md);
}

/* ============================================
   Table Card
   ============================================ */
.table-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}

.table-wrapper {
  overflow-x: auto;
}

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

.table th {
  background: var(--border-light);
  padding: 12px 16px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--text-secondary);
  text-align: left;
  white-space: nowrap;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
}

.table th:first-child {
  padding-left: var(--space-lg);
}

.table th:last-child {
  padding-right: var(--space-lg);
}

.table td {
  padding: 14px 16px;
  font-size: 0.88rem;
  border-bottom: 1px solid var(--border-light);
  vertical-align: middle;
}

.table td:first-child {
  padding-left: var(--space-lg);
}

.table td:last-child {
  padding-right: var(--space-lg);
}

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

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

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

/* Table specific styles */
.order-number {
  font-weight: 700;
  color: var(--primary);
  font-size: 0.85rem;
}

.order-open-link:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.file-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.82rem;
}

tr.row-overdue td { background: #fff5f5; }
tr.row-overdue:hover td { background: #fee2e2; }
tr.row-due-today td { background: #fefce8; }
tr.row-due-today:hover td { background: #fef9c3; }

th.sortable { cursor: pointer; user-select: none; white-space: nowrap; }
th.sortable:hover { color: var(--primary); }
th.sort-active { color: var(--primary); }
.sort-icon { font-style: normal; font-size: 0.8em; }

/* Activity log entries in comments sidebar */
.activity-entry {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  font-size: 0.75rem;
  color: var(--text-muted);
}
.activity-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
  margin-top: 4px;
}
.activity-text { flex: 1; white-space: pre-wrap; word-break: break-word; }
.activity-text a.activity-invoice-link { color: var(--status-finished); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.activity-text a.activity-invoice-link:hover { color: var(--primary); }
.activity-time { white-space: nowrap; font-size: 0.7rem; }

/* Comment author line */
.chat-message-author { font-weight: 600; font-size: 0.78rem; }
.chat-message-time   { font-size: 0.72rem; color: var(--text-muted); }

.order-name {
  font-weight: 600;
  color: var(--text);
}

.order-description {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.catalog-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.company-cell {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.company-logo {
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.7rem;
  color: var(--primary);
  flex-shrink: 0;
}

.deadline-text {
  font-size: 0.85rem;
}

.deadline-text.urgent {
  color: var(--status-cancelled);
  font-weight: 600;
}

.deadline-text.soon {
  color: var(--status-progress);
  font-weight: 600;
}

.deadline-days {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 1px;
}

/* Status badge */
.status-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.78rem;
  font-weight: 600;
  white-space: nowrap;
}

.status-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.status-badge.new {
  background: var(--status-new-bg);
  color: var(--status-new);
}
.status-badge.new::before {
  background: var(--status-new);
}

.status-badge.progress {
  background: var(--status-progress-bg);
  color: var(--status-progress);
}
.status-badge.progress::before {
  background: var(--status-progress);
}

.status-badge.done {
  background: var(--status-done-bg);
  color: var(--status-done);
}
.status-badge.done::before {
  background: var(--status-done);
}

.status-badge.cancelled {
  background: var(--status-cancelled-bg);
  color: var(--status-cancelled);
}
.status-badge.cancelled::before {
  background: var(--status-cancelled);
}

.status-badge.waiting {
  background: var(--status-waiting-bg);
  color: var(--status-waiting);
}
.status-badge.waiting::before {
  background: var(--status-waiting);
}
.status-badge.finished {
  background: var(--status-finished-bg);
  color: var(--status-finished);
}
.status-badge.finished::before {
  background: var(--status-finished);
}

/* Device badge */
.device-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  font-weight: 500;
  background: var(--bg);
  border: 1px solid var(--border);
  color: var(--text-secondary);
}

.device-badge svg {
  width: 14px;
  height: 14px;
}

/* Price */
.price {
  font-weight: 700;
  font-size: 0.92rem;
  font-variant-numeric: tabular-nums;
}

/* Row actions */
.row-actions {
  display: flex;
  align-items: center;
  gap: 4px;
  opacity: 0;
  transition: opacity var(--transition);
}

.table tbody tr:hover .row-actions {
  opacity: 1;
}

.row-action-btn {
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.row-action-btn:hover {
  background: var(--primary-bg);
  color: var(--primary);
}

.row-action-btn svg {
  width: 16px;
  height: 16px;
}

/* Table footer / Pagination */
.table-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-top: 1px solid var(--border);
}

.table-info {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

/* Pagination */
.pagination-controls {
  display: flex;
  align-items: center;
  gap: 3px;
}
.pg-btn {
  min-width: 30px;
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}
.pg-btn:hover:not(:disabled) {
  background: var(--bg-hover);
  border-color: var(--border-strong);
}
.pg-btn:disabled { opacity: 0.35; cursor: default; }
.pg-btn-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.pg-ellipsis {
  font-size: 0.82rem;
  color: var(--text-muted);
  padding: 0 2px;
  user-select: none;
}

/* Per-page selector */
.per-page-select {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}
.per-page-select select {
  height: 28px;
  padding: 0 6px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 0.8rem;
  cursor: pointer;
}

.pagination {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pagination-btn {
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all var(--transition);
  font-family: inherit;
}

.pagination-btn:hover {
  border-color: var(--primary-border);
  color: var(--primary);
}

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

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn svg {
  width: 16px;
  height: 16px;
}

/* ============================================
   Modal / Slide-over
   ============================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 35, 0.5);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 680px;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.97);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.side-modal-overlay {
  justify-content: flex-end;
  padding: 0;
}

.side-modal {
  height: 100vh;
  max-height: 100vh;
  max-width: min(560px, 100vw);
  border-radius: 0;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform 0.32s ease;
}

.side-modal-overlay.active .side-modal {
  transform: translateX(0);
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
}

.modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  letter-spacing: -0.02em;
}

.modal-close {
  width: 36px;
  height: 36px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border);
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: all var(--transition);
}

.modal-close:hover {
  border-color: var(--status-cancelled);
  color: var(--status-cancelled);
  background: var(--status-cancelled-bg);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-body {
  padding: 16px 20px;
  background: var(--bg);
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: var(--space-sm);
  padding: 14px 20px;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
}

.modal-eyebrow {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 6px;
}

.modal-subtitle {
  margin-top: 6px;
  font-size: 0.84rem;
  color: var(--text-secondary);
  max-width: 42ch;
}

/* ============================================
   Forms
   ============================================ */
.form-group {
  margin-bottom: var(--space-lg);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-md);
}

.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input,
.form-select,
.form-textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--text);
  background: var(--bg-card);
  transition: all var(--transition);
  outline: none;
}

.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(0, 107, 153, 0.1);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.form-textarea {
  resize: vertical;
  min-height: 80px;
}

.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%235a6a7a' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.order-side-modal {
  display: flex;
  flex-direction: column;
  width: min(760px, calc(100vw - 56px));
  max-width: min(760px, calc(100vw - 56px));
  flex: 0 0 auto;
  overflow: hidden;
}

.order-modal-shell {
  width: 100%;
  height: 100vh;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
}

.order-modal-shell.chat-open {
  gap: 0;
}

.order-modal-header {
  align-items: flex-start;
}

.order-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg);
  display: flex;
  overflow: hidden;
}

.order-form-section {
  background: rgba(255, 255, 255, 0.82);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 16px;
}

.order-form-section + .order-form-section {
  margin-top: 0;
}

.order-main-column > .order-form-section + .order-form-section {
  margin-top: 0;
}

.order-section-title {
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 12px;
}

.order-section-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: 10px;
}

.order-section-note {
  margin-top: 4px;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.order-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
}

.order-form-grid .form-group,
.client-contact-grid .form-group {
  margin-bottom: 0;
}

.order-form-grid-primary {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 28px;
}

.order-form-grid-full {
  grid-column: 1 / -1;
}

.comment-open-btn {
  position: relative;
  width: 100%;
  height: 44px;
  border: 1px solid rgba(0, 107, 153, 0.18);
  border-radius: var(--radius-md);
  background: rgba(0, 107, 153, 0.06);
  color: var(--primary-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.comment-open-btn:hover {
  background: rgba(0, 107, 153, 0.1);
  border-color: rgba(0, 107, 153, 0.24);
}

.comment-open-btn--inactive {
  border-color: var(--border) !important;
  background: transparent !important;
  color: var(--text-muted) !important;
  box-shadow: none !important;
}
.comment-open-btn--inactive:hover {
  background: var(--bg-hover) !important;
  border-color: var(--border) !important;
}

.comment-open-btn svg {
  width: 16px;
  height: 16px;
}

.comment-open-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: #dc2626;
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 700;
}

.order-modal-footer {
  flex: 0 0 auto;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
}

.order-action-btn {
  border-color: var(--primary-border);
  color: var(--primary);
  background: var(--primary-bg);
}

.order-action-btn:hover {
  background: rgba(0, 107, 153, 0.12);
  color: var(--primary-dark);
}

.order-main-column {
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  gap: 16px;
  width: 100%;
  height: 100%;
}

.order-main-column > .order-form-section {
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.order-form-section-client {
  flex: 0 0 auto;
}

.order-form-section-order {
  flex: 0 0 auto;
}

.order-form-section-logistics {
  flex: 0 0 auto;
}

.order-form-section-client .client-picker {
  margin-bottom: 14px;
}

.order-form-section-client .client-card {
  flex: 0 0 auto;
  margin-top: 0;
}

.order-form-section-order .order-form-grid-primary {
  flex: 0 0 auto;
}

.order-form-section-order .pricing-panel {
  margin-top: 12px;
}

.order-form-section-logistics .order-form-grid {
  flex: 1 1 auto;
  align-content: center;
}

.client-picker {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: var(--space-sm);
}

.client-search-shell {
  position: relative;
}

.client-search-shell svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-muted);
}

.client-search-input {
  padding-left: 42px;
  padding-right: 70px;
}

.client-clear-btn {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: var(--text-muted);
  font-size: 0.76rem;
  font-weight: 600;
  cursor: pointer;
}

.client-add-btn {
  align-self: stretch;
}

.client-search-results {
  display: grid;
  gap: 8px;
  margin-top: var(--space-md);
}

.client-search-results[hidden] {
  display: none;
}

.client-result-item,
.client-result-empty {
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg);
  padding: 12px 14px;
}

.client-result-item {
  text-align: left;
  cursor: pointer;
  transition: all var(--transition);
}

.client-result-item:hover {
  border-color: var(--primary-border);
  background: rgba(0, 107, 153, 0.06);
}

.client-result-company {
  display: block;
  font-weight: 700;
  color: var(--text);
}

.client-result-contact {
  display: block;
  font-size: 0.8rem;
  color: var(--text-secondary);
  margin-top: 2px;
}

.client-result-empty {
  color: #b45353;
  font-size: 0.82rem;
  background: rgba(220, 38, 38, 0.06);
  border-color: rgba(220, 38, 38, 0.14);
}

.client-card {
  margin-top: var(--space-md);
  border: 1px solid rgba(34, 197, 94, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(34, 197, 94, 0.08);
  padding: 14px;
}

.client-card[hidden] {
  display: none;
}

.client-card-placeholder {
  border-color: rgba(148, 163, 184, 0.24);
  background: rgba(148, 163, 184, 0.08);
}

.client-card-title-muted {
  color: #475569;
}

.client-card-subtitle-muted {
  color: #64748b;
}

.client-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
}

.client-card-summary {
  min-width: 0;
}

.client-card-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  flex-wrap: wrap;
}

.client-card-title {
  font-size: 1rem;
  font-weight: 700;
  color: #166534;
}

.client-card-subtitle {
  margin-top: 4px;
  color: #4b6b57;
  font-size: 0.82rem;
}

.client-change-btn {
  color: #1f7a45;
}

.client-card-check {
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: rgba(34, 197, 94, 0.14);
  border: 1px solid rgba(34, 197, 94, 0.22);
  color: #16a34a;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.client-card-check svg {
  width: 22px;
  height: 22px;
}

.client-card-check-placeholder {
  background: rgba(148, 163, 184, 0.12);
  border-color: rgba(148, 163, 184, 0.22);
  color: #64748b;
}

.client-details-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-md);
}

.client-details-grid[hidden] {
  display: none;
}

.client-contact-editor {
  margin-top: var(--space-md);
  padding: 12px;
  border-radius: var(--radius-lg);
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(34, 197, 94, 0.18);
}

.client-contact-editor[hidden] {
  display: none;
}

.client-contact-editor-head {
  margin-bottom: 12px;
}

.client-contact-editor-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: #166534;
}

.client-contact-editor-note {
  margin-top: 4px;
  font-size: 0.78rem;
  color: #4b6b57;
}

.client-contact-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: var(--space-md);
  row-gap: 8px;
}

.client-contact-grid-full {
  grid-column: 1 / -1;
}

.client-detail-column {
  display: grid;
  gap: 10px;
}

.client-detail-item {
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid rgba(0, 107, 153, 0.08);
}

.client-detail-input {
  margin-top: 4px;
  background: #fff;
}

.client-detail-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.client-detail-value {
  display: block;
  font-weight: 600;
}

.client-details-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: var(--space-md);
}

.client-details-footer[hidden] {
  display: none;
}

.pricing-panel {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: var(--space-md);
  align-items: end;
  margin-top: 8px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(0, 107, 153, 0.08), rgba(255, 255, 255, 0.96));
  border: 1px solid var(--primary-border);
}

.pricing-field {
  min-width: 0;
}

.pricing-field .form-input {
  background: rgba(255, 255, 255, 0.92);
}

.pricing-field-total .form-input {
  font-weight: 700;
  border-color: rgba(0, 107, 153, 0.22);
}

.pricing-field-total {
  display: grid;
  align-content: start;
}

.tax-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  align-self: start;
  justify-self: start;
  margin-top: 29px;
  margin-bottom: 0;
  height: 44px;
  padding: 0 14px;
  border-radius: var(--radius-md);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(0, 107, 153, 0.12);
  font-size: 0.78rem;
  font-weight: 600;
  width: auto;
  min-width: 94px;
}

.tax-toggle input {
  width: 15px;
  height: 15px;
  accent-color: var(--primary);
}

.order-chat-sidebar {
  width: 420px;
  max-width: 420px;
  border-left: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  flex: 0 0 auto;
  overflow: hidden;
}

.order-chat-sidebar[hidden] {
  display: none;
}

/* Confirm modal */
.confirm-modal {
  width: 360px;
  padding: 32px 28px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.confirm-modal-icon {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: rgba(220, 38, 38, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.confirm-modal-icon svg {
  width: 24px;
  height: 24px;
  stroke: #dc2626;
}

.confirm-modal-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
}

.confirm-modal-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.confirm-modal-actions {
  display: flex;
  gap: 10px;
  margin-top: 8px;
  width: 100%;
  justify-content: center;
}

.order-chat-modal-body {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
}

.order-chat-footer {
  flex: 0 0 auto;
  justify-content: stretch;
}

.order-side-modal.is-client-editing .order-modal-body {
  overflow-y: auto;
}

.order-side-modal.is-client-editing .order-main-column {
  justify-content: flex-start;
  gap: 12px;
  padding-right: 4px;
  height: auto;
}

.order-side-modal.is-client-editing .order-main-column > .order-form-section {
  flex: 0 0 auto;
}

.order-side-modal.is-client-editing .order-form-section-client,
.order-side-modal.is-client-editing .order-form-section-order,
.order-side-modal.is-client-editing .order-form-section-logistics {
  justify-content: flex-start;
}

.comments-chat-thread {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 12px;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.comments-chat-thread::before {
  content: '';
  flex: 1;
}

.comments-chat-compose {
  width: 100%;
}

.chat-thread {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex: 1 1 auto;
  min-height: 220px;
  overflow: auto;
}

.chat-message {
  max-width: 88%;
  padding: 12px 14px;
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
}

.chat-message.from-production {
  align-self: flex-end;
  background: rgba(0, 107, 153, 0.1);
  border-bottom-right-radius: 6px;
}

.chat-message.from-admin {
  align-self: flex-start;
  background: #fff;
  border: 1px solid var(--border);
  border-bottom-left-radius: 6px;
}

.chat-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.chat-message-text {
  font-size: 0.84rem;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-compose {
  margin-top: auto;
  display: grid;
  gap: 10px;
  width: 100%;
}

.chat-input-shell {
  position: relative;
  width: 100%;
}

.chat-author-switch {
  display: inline-flex;
  padding: 4px;
  border-radius: var(--radius-md);
  background: var(--bg);
  border: 1px solid var(--border);
  width: fit-content;
}

.chat-author-btn {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  padding: 8px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 600;
}

.chat-author-btn.active {
  background: #fff;
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.chat-compose-input {
  min-height: 36px;
}

.chat-compose-input-inline {
  min-height: 36px;
  max-height: 52px;
  line-height: 1.35;
  padding-right: 46px;
  resize: none;
  overflow-y: hidden;
}

.chat-inline-send {
  position: absolute;
  right: 12px;
  top: 0;
  bottom: 0;
  margin: auto 0;
  width: 22px;
  height: 22px;
  border: none;
  border-radius: 999px;
  background: var(--primary);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
}

.chat-inline-send svg {
  width: 11px;
  height: 11px;
}

.chat-inline-send:hover {
  background: var(--primary-light);
}

.chat-send-btn {
  width: fit-content;
}

.company-quick-modal {
  max-width: 720px;
}

.company-quick-section + .company-quick-section {
  margin-top: var(--space-md);
}

.company-quick-details {
  margin-top: var(--space-md);
}

/* ============================================
   Companies Page
   ============================================ */
.companies-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: var(--space-md);
}

.company-card {
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: var(--space-lg);
  box-shadow: var(--shadow-card);
  transition: all var(--transition);
  cursor: pointer;
}

.company-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--primary-border);
}

.company-card-header {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  margin-bottom: var(--space-md);
}

.company-card-logo {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-md);
  background: var(--primary-bg);
  border: 1px solid var(--primary-border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 1.1rem;
  color: var(--primary);
  flex-shrink: 0;
}

.company-card-title {
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: -0.01em;
}

.company-card-subtitle {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.company-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-sm);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.company-stat {
  text-align: center;
  padding: var(--space-sm);
  border-radius: var(--radius-sm);
  background: var(--bg);
}

.company-stat-value {
  font-weight: 700;
  font-size: 1.05rem;
}

.company-stat-label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 2px;
}

.company-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: var(--space-md);
  padding-top: var(--space-md);
  border-top: 1px solid var(--border-light);
}

.company-contact {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.company-contact svg {
  width: 14px;
  height: 14px;
  opacity: 0.5;
}

/* ============================================
   Empty State
   ============================================ */
.empty-state {
  text-align: center;
  padding: var(--space-2xl) var(--space-xl);
}

.empty-state-icon {
  width: 64px;
  height: 64px;
  border-radius: var(--radius-lg);
  background: var(--primary-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-md);
}

.empty-state-icon svg {
  width: 28px;
  height: 28px;
  color: var(--primary);
}

.empty-state-title {
  font-size: 1rem;
  font-weight: 700;
  margin-bottom: var(--space-xs);
}

.empty-state-text {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: var(--space-lg);
}

/* ============================================
   Utilities
   ============================================ */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-primary { color: var(--primary); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.text-sm { font-size: 0.82rem; }
.text-xs { font-size: 0.72rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.table th.text-center { text-align: center; }
.table th.text-right { text-align: right; }
.nowrap { white-space: nowrap; }

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 1200px) {
  .stats-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform 0.3s ease;
  }

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

  .main {
    margin-left: 0;
  }

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

  .today-stat-card {
    grid-template-columns: 1fr;
  }

  .today-stat-card .today-stat-copy {
    align-items: center;
  }

  .today-stat-card .stat-trend {
    margin-top: 0;
  }

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

  .topbar-search {
    display: none;
  }

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

  .side-modal {
    max-width: 100vw;
  }

  .order-form-grid,
  .order-form-grid-primary {
    grid-template-columns: 1fr;
  }

  .client-picker,
  .client-details-grid,
  .client-contact-grid,
  .pricing-panel {
    grid-template-columns: 1fr;
  }

  .order-section-head,
  .client-card-header {
    flex-direction: column;
  }

  .order-main-column {
    height: auto;
  }

  .order-modal-footer {
    flex-wrap: wrap;
    justify-content: stretch;
  }

  .order-main-column {
    display: flex;
    flex-direction: column;
    height: auto;
    gap: 12px;
  }

  .order-main-column > .order-form-section {
    flex: 0 0 auto;
  }

  .order-form-section-order,
  .order-form-section-logistics {
    justify-content: flex-start;
  }

  .order-modal-footer .btn {
    width: 100%;
    justify-content: center;
  }

  .chat-send-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ============================================
   Extracted inline styles — shared utilities
   ============================================ */

/* Table */
.col-actions { width: 1%; white-space: nowrap; }
.table-empty td { text-align: center; padding: 40px; color: var(--text-muted); }
.order-open-link { cursor: pointer; }

/* Toast notifications */
/* ── Toast notification system ───────────────────────────── */
#toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  pointer-events: none;
}
.toast {
  pointer-events: all;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  min-width: 280px;
  max-width: 380px;
  padding: 14px 14px 14px 16px;
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  box-shadow: 0 4px 24px rgba(0,0,0,.12), 0 1px 6px rgba(0,0,0,.06);
  border-left: 3px solid #16a34a;
  overflow: hidden;
  position: relative;
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.25s ease;
}
.toast.toast--in {
  transform: translateX(0);
  opacity: 1;
}
.toast.toast--out {
  transform: translateX(calc(100% + 32px));
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.4, 0, 1, 1), opacity 0.22s ease;
}
.toast.toast-error { border-left-color: #dc2626; }
.toast.toast-warning { border-left-color: #f59e0b; }
.toast.toast-info { border-left-color: var(--primary); }

.toast__icon {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  margin-top: 1px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.toast__icon svg { width: 18px; height: 18px; }
.toast .toast__icon { color: #16a34a; }
.toast.toast-error .toast__icon { color: #dc2626; }
.toast.toast-warning .toast__icon { color: #f59e0b; }
.toast.toast-info .toast__icon { color: var(--primary); }

.toast__body { flex: 1; min-width: 0; }
.toast__msg {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
}

.toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: var(--text-muted);
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition), background var(--transition);
  line-height: 0;
  margin-top: 1px;
}
.toast__close:hover { color: var(--text); background: var(--bg); }
.toast__close svg { width: 15px; height: 15px; }

.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  background: #16a34a;
  border-radius: 0 0 0 var(--radius-lg);
  transform-origin: left;
  transition: transform linear;
}
.toast.toast-error .toast__progress { background: #dc2626; }
.toast.toast-warning .toast__progress { background: #f59e0b; }
.toast.toast-info .toast__progress { background: var(--primary); }

/* Modal size variants */
.modal-xl { max-width: 720px; }
.modal-lg { max-width: 600px; }
.modal-md { max-width: 520px; }

/* Form layout */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-grid-2-mt { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 12px; }
.form-grid-2-lg { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.mb-0 { margin-bottom: 0; }
.mb-12 { margin-bottom: 12px; }

/* Pricing panel — order form override */
.pricing-panel-form {
  grid-template-columns: 1fr 1fr 1fr auto;
  align-items: flex-start;
  gap: 12px;
  margin-top: 0;
}

/* VAT toggle row */
.vat-toggle { display: flex; align-items: center; gap: 6px; margin-top: 32px; }
.vat-toggle input[type="checkbox"] { width: 18px; height: 18px; cursor: pointer; }
.vat-toggle label { cursor: pointer; font-weight: 500; font-size: 0.88rem; margin: 0; }

/* Button utilities */
.btn-start { margin-right: auto; }
.btn-full { width: 100%; }
.btn-delete { color: var(--status-cancelled); }

/* Company/Contact cell text */
.company-cell-name { font-weight: 600; font-size: 0.88rem; }
.company-cell-contact { font-size: 0.75rem; color: var(--text-muted); }
.company-link { color: var(--primary); text-decoration: none; }
.company-link:hover { text-decoration: underline; }

/* Section title spacing */
.section-title-mb { margin-bottom: 16px; }

/* Settings layout */
.settings-layout { display: flex; gap: 24px; align-items: flex-start; }
.settings-table-card { flex: 1; }
.settings-sidebar-card { width: 320px; flex-shrink: 0; }
.settings-sidebar-head { padding: 16px; border-bottom: 1px solid var(--border); font-weight: 600; }
.settings-sidebar-body { padding: 16px; }
.settings-sidebar-body .form-group:last-child { margin-bottom: 0; }

/* Inline input variants */
.input-narrow-200 { max-width: 200px; }
.input-narrow-260 { max-width: 260px; }
.input-color { height: 42px; padding: 4px 8px; cursor: pointer; }
.input-color-sm { height: 38px; padding: 4px 8px; width: 80px; cursor: pointer; }
.checkbox-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; }
.checkbox-toggle input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; }
.status-badge-xs { font-size: 0.75rem; }
.status-badge-op { font-size: 0.7rem; padding: 2px 7px; }

/* Contact page — company search picker */
.ct-company-wrap { position: relative; }
.ct-company-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 2px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  z-index: 500;
  max-height: 200px;
  overflow-y: auto;
}
.ct-dropdown-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: 10px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0.875rem;
}
.ct-dropdown-item:hover { background: var(--primary-bg); }
.ct-dropdown-none { padding: 10px 14px; font-size: 0.875rem; color: var(--text-muted); }
.ct-selected-company {
  display: none;
  margin-top: 8px;
  padding: 8px 12px;
  background: var(--primary-bg);
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  align-items: center;
  justify-content: space-between;
}
.ct-clear-btn {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  line-height: 1;
  padding: 0;
}

/* Reference page — search clear button */
.ref-search-clear {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: #94a3b8;
  line-height: 1;
  align-items: center;
}
.ref-search-clear:hover { color: #475569; }

/* Reference page — entry modal */
.ref-modal-body { overflow-y: auto; flex: 1; }
.ref-sections { display: flex; flex-direction: column; gap: 16px; }
.ref-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 16px;
}
.ref-section-title { font-weight: 700; font-size: 0.92rem; margin-bottom: 14px; }
.ref-section-title-sm { font-weight: 700; font-size: 0.92rem; margin-bottom: 12px; }
.ref-material-row { display: flex; gap: 6px; }
.ref-material-row select { flex: 1; }
.ref-material-row .btn { flex-shrink: 0; }
.ref-form-row-mb { margin-bottom: 14px; }
.inline-add { margin-top: 6px; }
.add-param-btn { margin-top: 10px; }
.file-badge svg { flex-shrink: 0; color: var(--text-muted); }

/* ============================================
   Reference page component styles
   (moved from reference.php inline <style>)
   ============================================ */
.param-row { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; align-items: center; }
.param-remove { width: 32px; height: 32px; border: 1px solid var(--border); border-radius: var(--radius-sm); background: transparent; color: var(--text-muted); cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all var(--transition); flex-shrink: 0; }
.param-remove:hover { border-color: #ef4444; color: #ef4444; background: #fef2f2; }
.param-remove svg { width: 14px; height: 14px; }
.add-param-btn { display: inline-flex; align-items: center; gap: 6px; font-size: 0.82rem; font-weight: 600; color: var(--primary); background: transparent; border: none; cursor: pointer; padding: 4px 0; }
.add-param-btn:hover { opacity: .75; }
.params-list { display: flex; flex-direction: column; gap: 8px; }
.ref-search-wrap { display: flex; align-items: center; gap: 8px; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-md); padding: 7px 12px; min-width: 300px; transition: border-color .15s; }
.ref-search-wrap:focus-within { border-color: var(--primary); }
.ref-search-wrap svg { color: var(--text-muted); flex-shrink: 0; }
.ref-search-wrap input { border: none; background: none; outline: none; font-size: 0.875rem; color: var(--text-primary); flex: 1; font-family: inherit; }
.ref-container { display: flex; background: #fff; border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; }
.ref-panel-devices { width: 260px; flex-shrink: 0; border-right: 1px solid var(--border); display: flex; flex-direction: column; }
.ref-panel-ops { width: 0; flex-shrink: 0; overflow: hidden; border-right: 0px solid var(--border); background: #fff; display: flex; flex-direction: column; transition: width .22s ease, border-right-width .22s; }
.ref-panel-ops.visible { width: 260px; border-right-width: 1px; }
.ref-panel-results { flex: 1; min-width: 0; overflow-y: auto; }
.ref-panel-header { padding: 12px 16px; font-size: 0.75rem; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; border-bottom: 1px solid var(--border); background: var(--border-light); flex-shrink: 0; white-space: nowrap; }
.ref-nav-item { display: flex; align-items: center; width: 100%; padding: 14px 16px; text-align: left; border: none; background: none; cursor: pointer; font-size: 0.88rem; color: var(--text-secondary); transition: background var(--transition); border-bottom: 1px solid var(--border-light); border-left: 3px solid transparent; white-space: nowrap; }
.ref-nav-item:last-child { border-bottom: none; }
.ref-nav-item:hover { background: var(--primary-bg); color: var(--text-primary); }
.ref-nav-item.active { background: var(--primary-bg); color: #2563eb; font-weight: 600; border-left-color: #2563eb; }
.ref-nav-count { margin-left: auto; padding-left: 8px; font-size: 0.75rem; font-weight: 600; color: var(--text-muted); }
.ref-nav-item.active .ref-nav-count { color: #93c5fd; }
.ref-results-inner { padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.ref-empty { padding: 56px 24px; text-align: center; color: var(--text-muted); }
.ref-empty svg { width: 36px; height: 36px; opacity: .3; margin-bottom: 10px; }
.ref-empty p { font-size: 0.875rem; margin: 0; }
.ref-card { background: #fff; border: 1px solid var(--border); border-radius: 10px; padding: 14px 16px; display: flex; gap: 12px; align-items: flex-start; transition: box-shadow .15s; }
.ref-card:hover { box-shadow: 0 2px 10px rgba(0,0,0,.06); }
.ref-card-body { flex: 1; min-width: 0; }
.ref-card-top { display: flex; align-items: center; gap: 8px; margin-bottom: 3px; flex-wrap: wrap; }
.ref-card-name { font-weight: 700; font-size: 0.92rem; color: #0f172a; }
.ref-card-meta { font-size: 0.78rem; color: #94a3b8; margin-bottom: 10px; }
.ref-card-params { display: flex; flex-wrap: wrap; gap: 5px; }
.ref-param-chip { background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 5px; padding: 3px 8px; font-size: 0.75rem; color: #475569; }
.ref-param-chip b { color: #1e293b; font-weight: 600; }
.ref-card-note { font-size: 0.78rem; color: #64748b; padding-top: 8px; margin-top: 8px; border-top: 1px solid #f1f5f9; }
.ref-card-actions { display: flex; flex-direction: column; gap: 4px; flex-shrink: 0; padding-top: 2px; }
}

/* Chart sparkline containers */
.chart-sparkline { height: 80px; }
#chart-week { height: 112px; }
#chart-month { height: 112px; }
#chart-year { height: 112px; }

.today-stat-card {
  display: grid;
  grid-template-columns: minmax(145px, 0.75fr) minmax(260px, 1.65fr);
  align-items: start;
  gap: 18px;
  min-height: 228px;
  padding: 28px 24px 24px;
}

.today-stat-card .today-stat-copy {
  align-self: start;
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: start;
  gap: 8px;
  margin-bottom: 0;
  min-width: 0;
  padding-top: 8px;
}

.today-stat-card .stat-label {
  margin-top: 0;
  white-space: nowrap;
}

.today-stat-card .stat-value {
  font-size: 1.85rem;
}

.today-stat-card .stat-trend {
  margin-top: 26px;
  white-space: nowrap;
}

.today-stat-card .stat-progress {
  grid-column: 1 / -1;
  max-width: 154px;
}

.today-gauge-wrap {
  height: 174px;
  min-width: 0;
}

.today-gauge {
  position: relative;
  height: 174px;
}

.today-gauge-svg {
  width: 100%;
  height: 142px;
  display: block;
}

.today-gauge-track,
.today-gauge-arc {
  fill: none;
  stroke-linecap: butt;
  stroke-width: 30;
}

.today-gauge-track {
  stroke: #e5e7eb;
}

.today-gauge-arc--yesterday {
  stroke: #0aa36f;
}

.today-gauge-arc--today {
  stroke: #0f8df5;
}

.today-gauge-values {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 46px;
  pointer-events: none;
}

.today-gauge-value {
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1.05;
}

.today-gauge-value span {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-muted);
}

.today-gauge-value strong {
  font-size: 1.7rem;
  font-weight: 800;
}

.today-gauge-value--yesterday strong { color: #0aa36f; }
.today-gauge-value--today strong { color: #0f8df5; }

/* Status dropdown trigger */
.status-dropdown .status-badge { cursor: pointer; }

/* Row actions button + dropdown */
.col-actions { width: 88px; min-width: 88px; text-align: right; padding: 0 8px; white-space: nowrap; }
.row-actions-wrap { position: relative; display: inline-flex; align-items: center; gap: 2px; }
.row-icon-slot { display: inline-flex; width: 22px; height: 22px; flex-shrink: 0; }
.row-icon-btn { display: inline-flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: 4px; color: var(--text-secondary); text-decoration: none; transition: background var(--transition), color var(--transition); flex-shrink: 0; }
.row-icon-btn:hover { background: var(--bg-hover); color: var(--primary); }
.row-actions-btn { display: inline-flex; align-items: center; justify-content: center; background: none; border: 1.5px solid var(--border); cursor: pointer; padding: 3px; color: var(--text-muted); border-radius: 50%; transition: color var(--transition), background var(--transition), border-color var(--transition); line-height: 0; flex-shrink: 0; }
.row-actions-btn:hover { color: var(--primary); border-color: var(--primary); background: var(--bg-hover); }
.row-actions-menu { position: fixed; background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: 0 4px 16px rgba(0,0,0,0.12); z-index: 9999; min-width: 190px; padding: 4px 0; display: none; }
.row-actions-menu.open { display: block; }
.row-actions-item { display: flex; align-items: center; gap: 9px; padding: 8px 14px; font-size: 13px; color: var(--text-primary); cursor: pointer; white-space: nowrap; background: none; border: none; width: 100%; text-align: left; text-decoration: none; transition: background var(--transition); line-height: 1; }
.row-actions-item:hover { background: var(--bg-hover); color: var(--primary); }
.row-actions-item svg { color: var(--text-muted); flex-shrink: 0; }

/* Label print wrapper */
#label-print-wrap { position: fixed; left: -9999px; top: -9999px; width: 46mm; pointer-events: none; background: #fff; }
#label-print { width: 46mm; box-sizing: border-box; font-family: Arial, Helvetica, sans-serif; display: flex; flex-direction: column; gap: 0.5mm; }
.label-logo { display: block; width: 26mm; height: auto; }
.label-divider { display: block; border: none; border-top: 0.4mm solid #000; margin: 0.5mm 0; width: 100%; }
.label-client { font-size: 12pt; font-weight: 700; color: #000; line-height: 1.2; word-break: break-word; overflow-wrap: break-word; }
.label-order { font-size: 12pt; font-weight: 600; color: #000; line-height: 1.2; }
.label-datetime { font-size: 10pt; color: #333; line-height: 1.2; }

/* Print: show only label */
@media print {
  @page { size: 52mm 38mm; margin: 3mm; }
  body.print-label-mode > *:not(#label-print-wrap) { display: none !important; }
  body.print-label-mode #label-print-wrap {
    position: static !important;
    left: auto !important;
    top: auto !important;
    width: 46mm !important;
  }
}

/* Checkbox column */
.col-check { width: 36px; padding: 0 4px 0 12px; }
.col-check input[type="checkbox"], .row-check { width: 16px; height: 16px; accent-color: var(--accent); cursor: pointer; }
tr.row-selected { background: color-mix(in srgb, var(--accent) 6%, transparent); }

/* Bulk action bar */
.bulk-bar { display: flex; align-items: center; justify-content: space-between; padding: 8px 16px; background: var(--bg-card); border: 1px solid var(--accent); border-radius: var(--radius); margin-bottom: 8px; animation: bulk-slide-in 0.15s ease; box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 20%, transparent); }
@keyframes bulk-slide-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }
.bulk-bar-left { display: flex; align-items: center; gap: 10px; }
.bulk-clear-btn { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border: none; background: var(--bg-hover); border-radius: 50%; cursor: pointer; color: var(--text-muted); transition: background var(--transition), color var(--transition); }
.bulk-clear-btn:hover { background: var(--border); color: var(--text-primary); }
.bulk-count { font-size: 0.85rem; font-weight: 600; color: var(--accent); }
.bulk-bar-actions { display: flex; align-items: center; gap: 8px; }
.btn-sm { font-size: 0.8rem; padding: 5px 12px; height: 30px; }
.btn-danger { background: #ef4444; border-color: #ef4444; color: #fff; }
.btn-danger:hover { background: #dc2626; border-color: #dc2626; }

/* Bulk status dropdown */
.bulk-status-wrap { position: relative; }
.bulk-status-menu { position: absolute; right: 0; top: calc(100% + 4px); background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-lg); z-index: 200; min-width: 160px; padding: 4px 0; }
.bulk-status-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 14px; border: none; background: none; cursor: pointer; font-size: 0.84rem; color: var(--text-primary); text-align: left; transition: background var(--transition); }
.bulk-status-item:hover { background: var(--bg-hover); }
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }

/* Invoice button */
.btn-invoice { background: #10b981; border-color: #10b981; color: #fff; }
.btn-invoice:hover { background: #059669; border-color: #059669; }

/* Qty modal */
.confirm-modal-icon--check { background: color-mix(in srgb, #10b981 12%, transparent); color: #10b981; }
.qty-modal-input-wrap { display: flex; align-items: center; gap: 8px; margin: 12px 0 4px; }
.qty-modal-input-wrap .form-input { font-size: 1.4rem; font-weight: 700; text-align: center; width: 120px; height: 52px; }
.qty-modal-unit { font-size: 1rem; color: var(--text-muted); font-weight: 500; }

/* Modified quantity badge */
.qty-modified-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 26px; height: 26px; padding: 0 6px; background: #ef4444; color: #fff; font-size: 0.8rem; font-weight: 700; border-radius: 999px; }

.activity-text { white-space: pre-line; }
#qty-modal { z-index: 400; }

/* Delivery badges */
.delivery-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 4px; font-size: 11px; font-weight: 500; white-space: nowrap; }
.delivery-tag--courier { background: #fef9c3; color: #854d0e; border: 0.5px solid #fcd34d; }
.delivery-tag--pickup  { background: #dcfce7; color: #166534; border: 0.5px solid #86efac; }
.delivery-tag--client-courier { background: #ffedd5; color: #9a3412; border: 0.5px solid #fdba74; }

/* Venipak */
.row-venipak-btn { display:inline-flex; align-items:center; justify-content:center; width:28px; height:28px; border-radius:6px; border:0.5px solid var(--border); background:var(--surface); cursor:pointer; color:var(--text-secondary); transition:background .15s,color .15s; margin-right:2px; }
.row-venipak-btn:hover { background:#1d4ed8; color:#fff; border-color:#1d4ed8; }
.tracking-badge { display:inline-flex; align-items:center; padding:3px 5px; border-radius:4px; background:#eff6ff; color:#1d4ed8; border:0.5px solid #bfdbfe; margin-right:2px; text-decoration:none; cursor:pointer; }
.tracking-badge:hover { background:#dbeafe; }
.invoice-badge { display:inline-flex; align-items:center; gap:3px; padding:2px 6px; border-radius:4px; background:var(--status-finished-bg); color:var(--status-finished); border:0.5px solid rgba(21,128,61,0.25); font-size:10px; font-weight:600; margin-left:4px; white-space:nowrap; text-decoration:none; }
.invoice-badge:hover { background:var(--status-finished); color:#fff; }

/* Merge conflict modal */
.merge-conflict-row { display:flex; align-items:center; gap:8px; padding:8px 0; border-bottom:0.5px solid var(--border); flex-wrap:wrap; }
.merge-conflict-row:last-child { border-bottom:none; }
.merge-order-num { font-weight:600; font-size:13px; min-width:60px; }
.merge-client { flex:1; font-size:13px; color:var(--text-secondary); }
.merge-btns { display:flex; gap:4px; }
.merge-btn.active-decision { background:var(--primary); color:#fff; border-color:var(--primary); }
