/* ═══════════════════════════════════════════════════════
   ELECTED — Design System v2
   ═══════════════════════════════════════════════════════ */

:root {
  /* Colors */
  --c-bg:           #f4f6f9;
  --c-surface:      #ffffff;
  --c-border:       #e5e9f0;
  --c-border-light: #f0f2f7;
  --c-text:         #1e2532;
  --c-text-muted:   #6b7280;
  --c-text-light:   #9ca3af;

  /* Brand */
  --c-primary:      #0f172a;
  --c-blue:         #2563eb;
  --c-blue-light:   #eff6ff;
  --c-blue-hover:   #1d4ed8;
  --c-accent:       #e94560;

  /* Semantic */
  --c-success:      #16a34a;
  --c-success-bg:   #f0fdf4;
  --c-warning:      #d97706;
  --c-warning-bg:   #fffbeb;
  --c-danger:       #dc2626;
  --c-danger-bg:    #fef2f2;
  --c-info:         #0891b2;
  --c-info-bg:      #ecfeff;

  /* Sidebar */
  --s-width:        240px;
  --s-bg:           #0f172a;
  --s-text:         rgba(255,255,255,.75);
  --s-text-active:  #ffffff;
  --s-hover:        rgba(255,255,255,.06);
  --s-active:       rgba(37,99,235,.35);
  --s-border:       rgba(255,255,255,.07);

  /* Tokens */
  --radius:         8px;
  --radius-lg:      12px;
  --radius-xl:      16px;
  --shadow-sm:      0 1px 2px rgba(0,0,0,.06);
  --shadow:         0 1px 4px rgba(0,0,0,.08), 0 2px 8px rgba(0,0,0,.04);
  --shadow-md:      0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:      0 8px 32px rgba(0,0,0,.12);
  --transition:     .15s ease;
}

/* ─── Reset ────────────────────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--c-bg);
  color: var(--c-text);
  line-height: 1.6;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* ─── App Layout (sidebar) ─────────────────────────────── */
.app-layout {
  display: flex;
  min-height: 100vh;
}

/* ─── Sidebar ──────────────────────────────────────────── */
.sidebar {
  width: var(--s-width);
  background: var(--s-bg);
  flex-shrink: 0;
  position: fixed;
  top: 0; left: 0; bottom: 0;
  display: flex;
  flex-direction: column;
  z-index: 50;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px 20px 16px;
  border-bottom: 1px solid var(--s-border);
  text-decoration: none;
}

.sidebar-logo-mark {
  width: 32px; height: 32px;
  background: var(--c-blue);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; font-size: .75rem; color: #fff;
  letter-spacing: 1px; flex-shrink: 0;
}

.sidebar-logo-text {
  font-weight: 700;
  font-size: .875rem;
  letter-spacing: 2px;
  color: #fff;
}

.sidebar-nav {
  flex: 1;
  padding: 12px 0;
}

.sidebar-section {
  padding: 16px 20px 4px;
  font-size: .65rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: rgba(255,255,255,.3);
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 20px;
  color: var(--s-text);
  font-size: .8rem;
  font-weight: 500;
  text-decoration: none;
  transition: background var(--transition), color var(--transition);
  border-radius: 0;
  position: relative;
}

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

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

.sidebar-link.active::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--c-blue);
  border-radius: 0 2px 2px 0;
}

.sidebar-icon {
  width: 16px; height: 16px;
  flex-shrink: 0;
  opacity: .8;
  font-style: normal;
}

.sidebar-badge {
  margin-left: auto;
  background: var(--c-blue);
  color: #fff;
  font-size: .65rem;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
}

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid var(--s-border);
}

.sidebar-user {
  display: flex;
  align-items: center;
  gap: 10px;
}

.sidebar-user-avatar {
  width: 32px; height: 32px;
  background: var(--c-blue);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}

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

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

.sidebar-user-role {
  font-size: .7rem;
  color: rgba(255,255,255,.4);
}

.sidebar-logout {
  color: rgba(255,255,255,.4);
  font-size: .7rem;
  text-decoration: none;
  padding: 4px 0;
  display: block;
  margin-top: 4px;
  transition: color var(--transition);
}
.sidebar-logout:hover { color: rgba(255,255,255,.8); text-decoration: none; }

/* ─── Main content ──────────────────────────────────────── */
.main-wrapper {
  margin-left: var(--s-width);
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* ─── Top bar ────────────────────────────────────────────── */
.topbar {
  background: var(--c-surface);
  border-bottom: 1px solid var(--c-border);
  padding: 0 28px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 40;
}

.topbar-title {
  font-size: .875rem;
  font-weight: 600;
  color: var(--c-text);
}

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

.topbar-bell {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--c-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: .875rem;
  text-decoration: none;
  position: relative;
  transition: background var(--transition);
  border: 1px solid var(--c-border);
}

.topbar-bell:hover { background: var(--c-border-light); text-decoration: none; }

.bell-badge {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--c-accent);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  width: 16px; height: 16px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* ─── Page content ──────────────────────────────────────── */
.page-content {
  padding: 24px 28px;
  flex: 1;
}

/* Legacy support */
.container { max-width: 100%; padding: 0; }
.main-content { padding: 24px 28px; flex: 1; }

/* ─── Page header ───────────────────────────────────────── */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 24px;
  flex-wrap: wrap;
  gap: 12px;
}

.page-header h1 {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--c-text);
}

.page-header-sub {
  font-size: .8rem;
  color: var(--c-text-muted);
  margin-top: 2px;
}

/* ─── Buttons ───────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: var(--radius);
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  border: 1.5px solid transparent;
  transition: all var(--transition);
  text-decoration: none;
  white-space: nowrap;
  line-height: 1.4;
  font-family: inherit;
}

.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

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

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

.btn-success {
  background: var(--c-success);
  color: #fff;
  border-color: var(--c-success);
}
.btn-success:hover { background: #15803d; border-color: #15803d; color: #fff; }

.btn-outline {
  background: transparent;
  color: var(--c-text);
  border-color: var(--c-border);
}
.btn-outline:hover { background: var(--c-bg); border-color: #c0c7d4; color: var(--c-text); }

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

.btn-sm { padding: 5px 12px; font-size: .75rem; }
.btn-xs { padding: 3px 8px; font-size: .7rem; }
.btn-lg { padding: 11px 24px; font-size: .875rem; }

/* ─── Cards ─────────────────────────────────────────────── */
.card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

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

.card-header h2,
.card-header h3 {
  font-size: .9rem;
  font-weight: 700;
  color: var(--c-text);
}

.card-body {
  padding: 20px;
}

.card-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--c-border);
  background: var(--c-bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mb-2 { margin-bottom: 10px; }
.mt-3 { margin-top: 16px; }
.mt-2 { margin-top: 10px; }

/* ─── Stat cards ─────────────────────────────────────────── */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;
}

.stat-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 3px;
}

.stat-card.blue::before  { background: var(--c-blue); }
.stat-card.green::before { background: var(--c-success); }
.stat-card.orange::before{ background: var(--c-warning); }
.stat-card.red::before   { background: var(--c-danger); }

.stat-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--c-text-muted);
  text-transform: uppercase;
  letter-spacing: .4px;
}

.stat-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--c-text);
}

.stat-note {
  font-size: .75rem;
  color: var(--c-text-muted);
}

.stat-icon {
  position: absolute;
  top: 16px; right: 16px;
  font-size: 1.5rem;
  opacity: .2;
}

/* ─── Tables ─────────────────────────────────────────────── */
.table-wrap {
  overflow-x: auto;
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
  box-shadow: var(--shadow-sm);
}

.table {
  width: 100%;
  border-collapse: collapse;
  background: var(--c-surface);
  font-size: .8rem;
}

.table thead th {
  padding: 11px 16px;
  text-align: left;
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--c-text-muted);
  background: var(--c-bg);
  border-bottom: 1px solid var(--c-border);
  white-space: nowrap;
}

.table tbody tr {
  border-bottom: 1px solid var(--c-border-light);
  transition: background var(--transition);
}

.table tbody tr:last-child { border-bottom: none; }
.table tbody tr:hover { background: #fafbfc; }

.table tbody td {
  padding: 12px 16px;
  color: var(--c-text);
  vertical-align: middle;
}

.table tbody td .text-muted { color: var(--c-text-muted); }

.table .td-actions {
  white-space: nowrap;
  text-align: right;
}

.row-danger { background: #fff8f8 !important; }
.row-warn   { background: #fffdf0 !important; }

/* ─── Badges / Status ───────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }

.badge-success { background: var(--c-success-bg); color: #15803d; }
.badge-warning { background: var(--c-warning-bg); color: #b45309; }
.badge-danger  { background: var(--c-danger-bg);  color: #b91c1c; }
.badge-info    { background: #ecfeff;              color: #0e7490; }
.badge-blue    { background: var(--c-blue-light);  color: var(--c-blue); }
.badge-gray    { background: #f3f4f6;              color: #374151; }
.badge-purple  { background: #f5f3ff;              color: #6d28d9; }

/* Статусы заказов */
.status-accepted    { background: #eff6ff; color: #1d4ed8; }
.status-preparation { background: #faf5ff; color: #7c3aed; }
.status-production  { background: #fffbeb; color: #b45309; }
.status-application { background: #fff7ed; color: #c2410c; }
.status-inspection  { background: #fef9c3; color: #854d0e; }
.status-shipped     { background: #f0fdf4; color: #15803d; }
.status-customs     { background: #ecfeff; color: #0e7490; }
.status-delivered   { background: #f0fdf4; color: #166534; }
.status-client_accepted { background: #dcfce7; color: #14532d; }

/* ─── Forms ─────────────────────────────────────────────── */
.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  color: var(--c-text);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: .3px;
}

.form-label.required::after {
  content: ' *';
  color: var(--c-danger);
}

.form-control {
  display: block;
  width: 100%;
  padding: 9px 12px;
  font-size: .8rem;
  color: var(--c-text);
  background: var(--c-surface);
  border: 1.5px solid var(--c-border);
  border-radius: var(--radius);
  transition: border-color var(--transition), box-shadow var(--transition);
  font-family: inherit;
  line-height: 1.5;
  appearance: none;
}

.form-control:focus {
  outline: none;
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px rgba(37,99,235,.1);
}

.form-control::placeholder { color: var(--c-text-light); }

select.form-control {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  padding-right: 28px;
}

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

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

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

.form-hint {
  font-size: .72rem;
  color: var(--c-text-muted);
  margin-top: 4px;
}

.form-error {
  font-size: .72rem;
  color: var(--c-danger);
  margin-top: 4px;
}

.form-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--c-border);
}

/* ─── Alerts ─────────────────────────────────────────────── */
.alert {
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: .8rem;
  margin-bottom: 16px;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  border: 1px solid transparent;
}

.alert-danger  { background: var(--c-danger-bg);  color: #991b1b; border-color: #fecaca; }
.alert-warning { background: var(--c-warning-bg); color: #92400e; border-color: #fde68a; }
.alert-success { background: var(--c-success-bg); color: #14532d; border-color: #bbf7d0; }
.alert-info    { background: #eff6ff; color: #1e40af; border-color: #bfdbfe; }

/* ─── Breadcrumb ─────────────────────────────────────────── */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .75rem;
  color: var(--c-text-muted);
  margin-bottom: 16px;
}

.breadcrumb a { color: var(--c-text-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--c-blue); }
.breadcrumb-sep { color: var(--c-border); }
.breadcrumb-current { color: var(--c-text); font-weight: 500; }

/* ─── Tabs ───────────────────────────────────────────────── */
.tabs {
  display: flex;
  gap: 0;
  border-bottom: 2px solid var(--c-border);
  margin-bottom: 24px;
}

.tab {
  padding: 10px 18px;
  font-size: .8rem;
  font-weight: 600;
  color: var(--c-text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  text-decoration: none;
  transition: color var(--transition), border-color var(--transition);
}

.tab:hover { color: var(--c-text); text-decoration: none; }
.tab.active { color: var(--c-blue); border-bottom-color: var(--c-blue); }

/* ─── Wizard steps ───────────────────────────────────────── */
.wizard-steps {
  display: flex;
  align-items: center;
  margin-bottom: 32px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.wizard-step {
  display: flex;
  align-items: center;
  flex-shrink: 0;
}

.wizard-step-dot {
  width: 32px; height: 32px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .75rem;
  font-weight: 700;
  border: 2px solid var(--c-border);
  background: var(--c-surface);
  color: var(--c-text-muted);
  transition: all var(--transition);
}

.wizard-step.done .wizard-step-dot   { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.wizard-step.active .wizard-step-dot { background: var(--c-blue); border-color: var(--c-blue); color: #fff; }

.wizard-step-label {
  font-size: .72rem;
  font-weight: 600;
  color: var(--c-text-muted);
  margin-top: 4px;
  white-space: nowrap;
}

.wizard-step.active .wizard-step-label { color: var(--c-blue); }
.wizard-step.done .wizard-step-label   { color: var(--c-success); }

.wizard-step-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.wizard-connector {
  flex: 1;
  height: 2px;
  background: var(--c-border);
  margin: 0 8px;
  min-width: 24px;
  margin-bottom: 20px;
}

.wizard-connector.done { background: var(--c-success); }

/* ─── Kanban ─────────────────────────────────────────────── */
.kanban {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  align-items: flex-start;
}

.kanban-col {
  flex-shrink: 0;
  width: 260px;
  background: var(--c-bg);
  border-radius: var(--radius-lg);
  border: 1px solid var(--c-border);
}

.kanban-col-header {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--c-border);
}

.kanban-col-title {
  font-size: .78rem;
  font-weight: 700;
  color: var(--c-text);
}

.kanban-col-count {
  font-size: .7rem;
  background: var(--c-border);
  color: var(--c-text-muted);
  padding: 1px 7px;
  border-radius: 10px;
}

.kanban-col-body {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 80px;
}

.kanban-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: box-shadow var(--transition), transform var(--transition);
  text-decoration: none;
  display: block;
  color: var(--c-text);
}

.kanban-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
  text-decoration: none;
  color: var(--c-text);
}

.kanban-card-title {
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 6px;
}

.kanban-card-meta {
  font-size: .72rem;
  color: var(--c-text-muted);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.kanban-card-amount {
  font-size: .78rem;
  font-weight: 700;
  color: var(--c-blue);
  margin-top: 6px;
}

/* ─── Timeline ───────────────────────────────────────────── */
.timeline {
  position: relative;
  padding-left: 24px;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 7px; top: 0; bottom: 0;
  width: 2px;
  background: var(--c-border);
}

.timeline-item {
  position: relative;
  padding-bottom: 20px;
}

.timeline-item:last-child { padding-bottom: 0; }

.timeline-dot {
  position: absolute;
  left: -21px;
  top: 3px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  z-index: 1;
}

.timeline-dot.done   { border-color: var(--c-success); background: var(--c-success); }
.timeline-dot.active { border-color: var(--c-blue);    background: var(--c-blue); }

.timeline-label {
  font-size: .78rem;
  font-weight: 600;
  color: var(--c-text);
}

.timeline-meta {
  font-size: .72rem;
  color: var(--c-text-muted);
  margin-top: 2px;
}

/* ─── Detail layout ──────────────────────────────────────── */
.detail-grid {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 20px;
}

.dl-table {
  width: 100%;
  font-size: .8rem;
}

.dl-table tr td:first-child {
  color: var(--c-text-muted);
  font-weight: 500;
  width: 40%;
  padding: 6px 0;
  vertical-align: top;
}

.dl-table tr td:last-child {
  color: var(--c-text);
  font-weight: 500;
  padding: 6px 0 6px 12px;
}

/* ─── Configurator grids ────────────────────────────────── */
.model-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.model-card {
  background: var(--c-surface);
  border: 2px solid var(--c-border);
  border-radius: var(--radius-lg);
  padding: 20px;
  cursor: pointer;
  text-decoration: none;
  color: var(--c-text);
  transition: all var(--transition);
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 10px;
}

.model-card:hover {
  border-color: var(--c-blue);
  box-shadow: 0 0 0 3px var(--c-blue-light);
  text-decoration: none;
  color: var(--c-text);
}

.model-card.selected {
  border-color: var(--c-blue);
  background: var(--c-blue-light);
}

.model-card-icon {
  width: 56px; height: 56px;
  border-radius: var(--radius);
  background: var(--c-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
}

.model-card-name {
  font-size: .85rem;
  font-weight: 700;
}

.model-card-meta {
  font-size: .72rem;
  color: var(--c-text-muted);
}

/* Fabric swatches */
.fabric-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 12px;
}

.fabric-card {
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  padding: 12px;
  cursor: pointer;
  transition: all var(--transition);
  background: var(--c-surface);
}

.fabric-card:hover { border-color: var(--c-blue); }
.fabric-card.selected { border-color: var(--c-blue); background: var(--c-blue-light); }

.fabric-swatch {
  width: 100%;
  height: 60px;
  border-radius: 6px;
  background: var(--c-bg);
  margin-bottom: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.5rem;
}

.fabric-name { font-size: .8rem; font-weight: 600; }
.fabric-meta { font-size: .7rem; color: var(--c-text-muted); }

/* Color palette */
.color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-swatch {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 3px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  position: relative;
}

.color-swatch:hover { transform: scale(1.1); }
.color-swatch.selected { border-color: var(--c-blue); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--c-blue); }

/* Tech/zone cards */
.tech-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 10px;
}

.tech-card {
  border: 2px solid var(--c-border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--c-surface);
  cursor: pointer;
  transition: all var(--transition);
}

.tech-card:hover { border-color: var(--c-blue); }
.tech-card.selected { border-color: var(--c-blue); background: var(--c-blue-light); }

/* Size grid */
.size-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
  gap: 8px;
}

.size-row {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.size-label {
  font-size: .7rem;
  font-weight: 700;
  color: var(--c-text-muted);
  text-transform: uppercase;
  text-align: center;
}

.size-row .form-control {
  text-align: center;
  padding: 7px 6px;
}

/* ─── Price breakdown ────────────────────────────────────── */
.price-table {
  width: 100%;
  font-size: .8rem;
}

.price-table tr td {
  padding: 7px 0;
  border-bottom: 1px solid var(--c-border-light);
}

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

.price-table .td-label { color: var(--c-text-muted); }
.price-table .td-value { text-align: right; font-weight: 600; }

.price-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0 0;
  border-top: 2px solid var(--c-border);
  margin-top: 8px;
}

.price-total-label { font-size: .85rem; font-weight: 700; }
.price-total-val   { font-size: 1.25rem; font-weight: 800; color: var(--c-blue); }

.margin-badge {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 20px;
  font-size: .7rem;
  font-weight: 600;
}

.margin-ok  { background: var(--c-success-bg); color: #15803d; }
.margin-low { background: var(--c-danger-bg);  color: #b91c1c; }

/* ─── Notifications ──────────────────────────────────────── */
.notifications-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notification-card {
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 14px 16px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  transition: background var(--transition);
}

.notification-card.unread {
  background: #fafbff;
  border-left: 3px solid var(--c-blue);
}

.notification-icon { font-size: 1.25rem; flex-shrink: 0; margin-top: 2px; }

.notification-body { flex: 1; }
.notification-message { font-size: .8rem; font-weight: 500; margin-bottom: 2px; }
.notification-actions { display: flex; gap: 6px; flex-shrink: 0; }

/* ─── Payment calendar ───────────────────────────────────── */
.pay-calendar {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}

.pay-week {
  border: 1px solid var(--c-border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--c-surface);
}

.pay-week-label { font-size: .7rem; font-weight: 700; color: var(--c-text-muted); margin-bottom: 6px; }
.pay-week-in  { color: var(--c-success); font-weight: 700; font-size: .85rem; }
.pay-week-out { color: var(--c-danger);  font-weight: 700; font-size: .85rem; }

/* ─── Funnel ─────────────────────────────────────────────── */
.funnel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.funnel-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.funnel-label {
  width: 140px;
  font-size: .78rem;
  color: var(--c-text-muted);
  flex-shrink: 0;
  text-align: right;
}

.funnel-bar-wrap {
  flex: 1;
  height: 28px;
  background: var(--c-bg);
  border-radius: 4px;
  overflow: hidden;
}

.funnel-bar {
  height: 100%;
  background: var(--c-blue);
  border-radius: 4px;
  transition: width .5s ease;
}

.funnel-val {
  width: 60px;
  font-size: .78rem;
  font-weight: 700;
  color: var(--c-text);
}

.funnel-pct {
  width: 50px;
  font-size: .72rem;
  color: var(--c-text-muted);
  text-align: right;
}

/* ─── Misc ───────────────────────────────────────────────── */
.text-center  { text-align: center; }
.text-right   { text-align: right; }
.text-muted   { color: var(--c-text-muted); }
.text-success { color: var(--c-success); }
.text-danger  { color: var(--c-danger); }
.text-warning { color: var(--c-warning); }
.text-blue    { color: var(--c-blue); }
.text-sm      { font-size: .78rem; }
.text-xs      { font-size: .7rem; }
.fw-bold      { font-weight: 700; }
.fw-semi      { font-weight: 600; }

.d-flex { display: flex; }
.align-center { align-items: center; }
.gap-2 { gap: 8px; }
.gap-3 { gap: 12px; }

.row { display: flex; gap: 16px; }
.col { flex: 1; }
.col-4 { flex: 0 0 33.33%; max-width: 33.33%; }
.col-8 { flex: 0 0 66.66%; max-width: 66.66%; }

.divider {
  border: none;
  border-top: 1px solid var(--c-border);
  margin: 20px 0;
}

.empty-state {
  text-align: center;
  padding: 48px 24px;
  color: var(--c-text-muted);
}

.empty-state-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
  opacity: .5;
}

.empty-state h3 { font-size: .9rem; font-weight: 600; margin-bottom: 6px; color: var(--c-text); }
.empty-state p  { font-size: .8rem; }

/* ─── Login page ─────────────────────────────────────────── */
.auth-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--c-bg);
  padding: 24px;
}

.auth-card {
  width: 100%;
  max-width: 400px;
  background: var(--c-surface);
  border: 1px solid var(--c-border);
  border-radius: var(--radius-xl);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}

.auth-logo {
  text-align: center;
  margin-bottom: 32px;
}

.auth-logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px; height: 48px;
  background: var(--c-blue);
  border-radius: 12px;
  color: #fff;
  font-weight: 800;
  font-size: .85rem;
  letter-spacing: 1px;
  margin-bottom: 12px;
}

.auth-logo h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: 2px;
  color: var(--c-primary);
}

.auth-logo p {
  font-size: .8rem;
  color: var(--c-text-muted);
  margin-top: 4px;
}

/* ─── Legacy / compat ────────────────────────────────────── */
.nav-bell { text-decoration: none; }
.btn-outline-dark { background: transparent; color: var(--c-text); border: 1.5px solid var(--c-border); padding: 8px 16px; border-radius: var(--radius); font-size: .8rem; font-weight: 600; cursor: pointer; transition: all var(--transition); display: inline-flex; align-items: center; gap: 6px; }
.btn-outline-dark:hover { border-color: #9ca3af; color: var(--c-text); text-decoration: none; background: var(--c-bg); }
.form-row.col { gap: 16px; }

/* ─── Responsive ─────────────────────────────────────────── */
@media (max-width: 1024px) {
  .sidebar { width: 56px; }
  .sidebar-logo-text,
  .sidebar-section,
  .sidebar-link span,
  .sidebar-badge,
  .sidebar-user-info,
  .sidebar-logout { display: none; }
  .sidebar-link { padding: 12px; justify-content: center; }
  .sidebar-link.active::before { display: none; }
  .main-wrapper { margin-left: 56px; }
  .sidebar-logo { padding: 14px; justify-content: center; }
  .sidebar-logo-mark { margin: 0; }
  .sidebar-footer { padding: 12px; }
  .sidebar-user { justify-content: center; }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 768px) {
  .sidebar { display: none; }
  .main-wrapper { margin-left: 0; }
  .page-content, .main-content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .kanban { flex-direction: column; }
  .kanban-col { width: 100%; }
  .topbar { padding: 0 16px; }
}
