/* ============================================================
   HUB PERFECT DECOR — Linear / Notion design system
   Neutral refined · negru primary · Inter + JetBrains Mono
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

:root {
  /* ─── Backgrounds ─── */
  --hub-bg:             #F8F9FB;
  --hub-bg-deep:        #F1F3F7;
  --hub-bg-soft:        #FAFBFD;
  --hub-card:           #FFFFFF;
  --hub-card-hover:     #FAFBFD;

  /* ─── Borders ─── */
  --hub-border:         #E4E7EC;
  --hub-border-soft:    #EFF1F5;
  --hub-border-strong:  #D0D5DD;

  /* ─── Text ─── */
  --hub-text:           #101828;
  --hub-text-soft:      #344054;
  --hub-text-muted:     #667085;
  --hub-text-faint:     #98A2B3;

  /* ─── Brand (primary = indigo modern) ─── */
  --hub-primary:        #4F46E5;
  --hub-primary-dark:   #4338CA;
  --hub-primary-light:  #6366F1;
  --hub-primary-pale:   #EEF2FF;
  --hub-primary-gradient: linear-gradient(135deg, #6366F1 0%, #4F46E5 100%);

  /* ─── Accents ─── */
  --hub-accent:         #8B5CF6;
  --hub-accent-pale:    #F5F3FF;
  --hub-success:        #12B76A;
  --hub-success-pale:   #D1FADF;
  --hub-warning:        #F79009;
  --hub-warning-pale:   #FEF0C7;
  --hub-danger:         #F04438;
  --hub-danger-pale:    #FEE4E2;
  --hub-info:           #0BA5EC;
  --hub-info-pale:      #E0F2FE;

  /* ─── Geometry (mai rotunjit, mai prietenos) ─── */
  --hub-radius-sm:      8px;
  --hub-radius:         14px;
  --hub-radius-lg:      18px;
  --hub-radius-pill:    999px;

  /* ─── Shadows (mai calde, layered) ─── */
  --hub-shadow-sm:      0 1px 2px rgba(16, 24, 40, 0.05);
  --hub-shadow:         0 1px 3px rgba(16, 24, 40, 0.05), 0 1px 2px rgba(16, 24, 40, 0.03);
  --hub-shadow-md:      0 4px 8px -2px rgba(16, 24, 40, 0.06), 0 2px 4px -2px rgba(16, 24, 40, 0.04);
  --hub-shadow-lg:      0 12px 24px -4px rgba(16, 24, 40, 0.08), 0 4px 8px -2px rgba(16, 24, 40, 0.04);

  /* ─── Fonts (Inter peste tot, fără mono) ─── */
  --hub-font:           'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  --hub-font-mono:      'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
}

/* ============ RESET ============ */
* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  font-family: var(--hub-font);
  background: var(--hub-bg);
  color: var(--hub-text);
  font-size: 14px;
  line-height: 1.5;
  letter-spacing: -0.005em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }

.num, code, kbd, samp, .mono { font-family: var(--hub-font-mono); font-variant-numeric: tabular-nums; }

/* ============ SIDEBAR ============ */
.hub-sidebar {
  position: fixed;
  top: 0; left: 0; bottom: 0;
  width: 256px;
  background: var(--hub-card);
  border-right: 1px solid var(--hub-border-soft);
  display: flex;
  flex-direction: column;
  z-index: 100;
  overflow-y: auto;
  overflow-x: hidden;
}

.sidebar-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 18px 18px;
  border-bottom: 1px solid var(--hub-border-soft);
  margin-bottom: 8px;
}
.sidebar-logo {
  display: flex; align-items: center; gap: 10px;
  color: var(--hub-text);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.sidebar-logo-mark {
  width: 30px; height: 30px;
  border-radius: 9px;
  background: var(--hub-primary-gradient);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}
.sidebar-logo-text {
  display: flex; flex-direction: column;
  line-height: 1.15;
}
.sidebar-logo-text small {
  font-weight: 400;
  font-size: 10px;
  color: var(--hub-text-muted);
  letter-spacing: 0;
  text-transform: none;
  margin-top: 1px;
}
.sidebar-close { display: none; }

.sidebar-nav {
  flex: 1;
  padding: 6px 10px 14px;
  overflow-y: auto;
}
.sidebar-group { margin-bottom: 18px; }
.sidebar-group:last-child { margin-bottom: 0; }
.sidebar-group-label {
  font-size: 10.5px;
  font-weight: 600;
  color: var(--hub-text-faint);
  padding: 8px 12px 6px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}
.sidebar-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  margin-bottom: 2px;
  border-radius: 9px;
  color: var(--hub-text-soft);
  font-weight: 500;
  font-size: 13.5px;
  letter-spacing: -0.005em;
  transition: all 120ms ease;
  position: relative;
}
.sidebar-item-icon {
  display: flex;
  width: 17px; height: 17px;
  flex-shrink: 0;
  color: var(--hub-text-muted);
  transition: color 120ms;
}
.sidebar-item-icon svg { width: 17px; height: 17px; }
.sidebar-item:hover {
  background: var(--hub-primary-pale);
  color: var(--hub-primary);
}
.sidebar-item:hover .sidebar-item-icon { color: var(--hub-primary); }
.sidebar-item.active {
  background: var(--hub-primary-gradient);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.22);
}
.sidebar-item.active .sidebar-item-icon { color: #fff; }

.sidebar-foot {
  border-top: 1px solid var(--hub-border-soft);
  padding: 10px;
}
.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 7px 8px;
  border-radius: 8px;
  color: var(--hub-text);
  transition: background 80ms;
}
.sidebar-user:hover { background: rgba(0, 0, 0, 0.04); }
.sidebar-avatar {
  width: 30px; height: 30px;
  border-radius: 50%;
  background: var(--hub-primary-gradient);
  color: #fff;
  font-weight: 600;
  font-size: 11px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  box-shadow: 0 2px 6px rgba(79, 70, 229, 0.2);
}
.sidebar-user-info { flex: 1; min-width: 0; line-height: 1.25; }
.sidebar-user-name {
  font-weight: 500; font-size: 12.5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sidebar-user-role {
  font-size: 11px; color: var(--hub-text-muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* ============ CONTENT WRAPPER ============ */
.hub-content {
  margin-left: 256px;
  min-height: 100vh;
}

.hub-topbar {
  background: rgba(248, 249, 251, 0.85);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--hub-border-soft);
  padding: 12px 28px;
  display: flex;
  align-items: center;
  gap: 16px;
  position: sticky;
  top: 0;
  z-index: 50;
}
.hub-topbar-title {
  flex: 1;
  font-size: 14px;
  font-weight: 600;
  color: var(--hub-text);
  letter-spacing: -0.01em;
}
.hub-topbar-title span:first-child {
  font-size: 10px;
  font-weight: 500;
  color: var(--hub-text-muted);
  display: block;
  letter-spacing: 0;
  margin-bottom: 1px;
}
.hub-topbar-actions {
  display: flex; align-items: center; gap: 6px;
}

.hub-icon-btn {
  width: 32px; height: 32px;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--hub-text-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 100ms;
}
.hub-icon-btn:hover {
  background: rgba(0,0,0,0.04);
  color: var(--hub-text);
}
.hub-icon-btn .hub-badge {
  position: absolute;
  top: -3px; right: -3px;
  min-width: 16px; height: 16px;
  padding: 0 4px;
  border-radius: 8px;
  background: var(--hub-danger);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--hub-bg);
}

.hub-main {
  padding: 32px 28px;
  max-width: 1480px;
  margin: 0 auto;
}

/* ============ PAGE HEADER ============ */
.hub-page-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}
.hub-page-header h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--hub-text);
}
.hub-page-header p {
  margin: 0;
  color: var(--hub-text-muted);
  font-size: 14px;
}

/* ============ CARDS (mai prietenoase) ============ */
.hub-card {
  background: var(--hub-card);
  border-radius: var(--hub-radius);
  padding: 24px;
  border: 1px solid var(--hub-border-soft);
  box-shadow: var(--hub-shadow-sm);
  transition: box-shadow 150ms ease;
}
.hub-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hub-border-soft);
}
.hub-card-title {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--hub-text);
  margin: 0;
}
.hub-card-action {
  width: 28px; height: 28px;
  border-radius: 6px;
  background: transparent;
  border: 1px solid var(--hub-border);
  color: var(--hub-text-muted);
  display: inline-flex; align-items: center; justify-content: center;
}
.hub-card-action:hover { background: var(--hub-bg-deep); color: var(--hub-text); }

/* ============ BUTTONS ============ */
.hub-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 16px;
  border-radius: 10px;
  font-weight: 500;
  font-size: 13px;
  letter-spacing: -0.005em;
  border: 1px solid transparent;
  transition: all 140ms ease;
  white-space: nowrap;
  cursor: pointer;
  line-height: 1.4;
}
.hub-btn-primary {
  background: var(--hub-primary-gradient);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 1px 2px rgba(79, 70, 229, 0.15), inset 0 1px 0 rgba(255,255,255,0.1);
}
.hub-btn-primary:hover {
  filter: brightness(1.05);
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.3), inset 0 1px 0 rgba(255,255,255,0.1);
  transform: translateY(-1px);
}
.hub-btn-primary:active { transform: translateY(0); }
.hub-btn-primary:disabled {
  background: var(--hub-border-strong);
  border-color: var(--hub-border-strong);
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}
.hub-btn-ghost {
  background: var(--hub-card);
  color: var(--hub-text);
  border-color: var(--hub-border);
}
.hub-btn-ghost:hover {
  background: var(--hub-bg-deep);
  border-color: var(--hub-border-strong);
}

/* ============ KPI GRID ============ */
.hub-kpis {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 14px;
  margin-bottom: 24px;
}
.hub-kpi {
  background: var(--hub-card);
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius);
  padding: 20px 22px;
  box-shadow: var(--hub-shadow-sm);
  position: relative;
  overflow: hidden;
  transition: transform 200ms ease, box-shadow 200ms ease;
}
.hub-kpi::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--hub-primary-gradient);
  opacity: 0;
  transition: opacity 200ms;
}
.hub-kpi:hover {
  box-shadow: var(--hub-shadow-md);
  transform: translateY(-2px);
}
.hub-kpi:hover::before { opacity: 1; }
.hub-kpi-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.hub-kpi-title {
  display: flex; align-items: center; gap: 7px;
  font-size: 12px;
  color: var(--hub-text-muted);
  font-weight: 500;
}
.hub-kpi-icon {
  width: 15px; height: 15px;
  color: var(--hub-text-muted);
}
.hub-kpi-trend {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: var(--hub-radius-pill);
  font-variant-numeric: tabular-nums;
}
.hub-kpi-trend.up   { color: var(--hub-success); background: var(--hub-success-pale); }
.hub-kpi-trend.down { color: var(--hub-danger);  background: var(--hub-danger-pale);  }
.hub-kpi-value {
  font-size: 28px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.03em;
  margin-top: 4px;
  color: var(--hub-text);
}

/* ============ GRIDS ============ */
.hub-grid-2 {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 12px;
  margin-bottom: 12px;
}
.hub-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hub-edit-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
}
.hub-offer-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 16px;
}

/* ============ TOOLBAR ============ */
.hub-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.hub-search {
  position: relative;
  flex: 1;
  min-width: 220px;
}
.hub-search input {
  width: 100%;
  padding: 8px 14px 8px 36px;
  border: 1px solid var(--hub-border);
  border-radius: 7px;
  background: var(--hub-card);
  font-size: 13px;
  color: var(--hub-text);
  transition: border-color 100ms, box-shadow 100ms;
}
.hub-search input:focus {
  outline: none;
  border-color: var(--hub-primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.hub-search input::placeholder { color: var(--hub-text-faint); }
.hub-search svg {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--hub-text-muted);
}
.hub-select {
  padding: 8px 32px 8px 12px;
  border: 1px solid var(--hub-border);
  border-radius: 7px;
  background: var(--hub-card) url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%2371717A' stroke-width='2' stroke-linecap='round'><path d='m6 9 6 6 6-6'/></svg>") no-repeat right 10px center;
  font-size: 13px;
  color: var(--hub-text);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  min-width: 140px;
}
.hub-select:focus {
  outline: none;
  border-color: var(--hub-primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}

/* ============ FORM FIELDS ============ */
.hub-form-section { margin-bottom: 14px; }
.hub-form-section:last-child { margin-bottom: 0; }
.hub-form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--hub-text-soft);
  margin-bottom: 6px;
}
.hub-input,
.hub-textarea {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--hub-border);
  border-radius: 7px;
  background: var(--hub-card);
  color: var(--hub-text);
  font-size: 13px;
  line-height: 1.5;
  transition: border-color 100ms, box-shadow 100ms;
}
.hub-input:focus,
.hub-textarea:focus {
  outline: none;
  border-color: var(--hub-primary-light);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.12);
}
.hub-input::placeholder,
.hub-textarea::placeholder { color: var(--hub-text-faint); }
.hub-textarea { resize: vertical; min-height: 70px; }

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

.hub-switch {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
}
.hub-switch input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 32px; height: 18px;
  border-radius: 9px;
  background: var(--hub-border);
  position: relative;
  cursor: pointer;
  transition: background 120ms;
}
.hub-switch input[type="checkbox"]::after {
  content: '';
  position: absolute;
  top: 2px; left: 2px;
  width: 14px; height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(0,0,0,0.15);
  transition: left 120ms;
}
.hub-switch input[type="checkbox"]:checked { background: var(--hub-primary); }
.hub-switch input[type="checkbox"]:checked::after { left: 16px; }

/* ============ SEGMENTED CONTROL ============ */
.hub-segmented {
  display: inline-flex;
  background: var(--hub-bg-deep);
  border-radius: 8px;
  padding: 3px;
}
.hub-segmented label {
  cursor: pointer;
  padding: 6px 14px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--hub-text-muted);
  border-radius: 6px;
  transition: all 100ms;
}
.hub-segmented input { display: none; }
.hub-segmented input:checked + span {
  background: var(--hub-card);
  color: var(--hub-text);
  font-weight: 600;
  box-shadow: var(--hub-shadow-sm);
  padding: 6px 14px;
  border-radius: 6px;
}

/* ============ TABLES (compacte dar respirabile) ============ */
.hub-items-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
}
.hub-items-table thead th {
  text-align: left;
  padding: 11px 14px;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--hub-text-muted);
  border-bottom: 1px solid var(--hub-border-soft);
  background: var(--hub-bg-soft);
  letter-spacing: -0.005em;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.hub-items-table thead th.num { text-align: right; }
.hub-items-table tbody tr {
  transition: background 100ms;
}
.hub-items-table tbody tr:hover {
  background: var(--hub-primary-pale);
}
.hub-items-table tbody td {
  padding: 11px 14px;
  border-bottom: 1px solid var(--hub-border-soft);
  color: var(--hub-text);
  vertical-align: top;
}
.hub-items-table tbody td.num {
  text-align: right;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  font-weight: 500;
}
.hub-items-table tbody tr:last-child td { border-bottom: 0; }
.hub-items-table .drag {
  color: var(--hub-text-faint);
  cursor: grab;
  padding: 0 6px;
}
.hub-items-table input,
.hub-items-table textarea {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: transparent;
  font-size: 12.5px;
  color: var(--hub-text);
}
.hub-items-table input:focus,
.hub-items-table textarea:focus {
  outline: none;
  border-color: var(--hub-text);
  background: var(--hub-card);
}
.hub-items-table input.num {
  text-align: right;
  font-family: var(--hub-font-mono);
  font-variant-numeric: tabular-nums;
}
.hub-items-table .del-btn {
  width: 24px; height: 24px;
  border-radius: 5px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--hub-text-faint);
  display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer;
}
.hub-items-table .del-btn:hover {
  background: var(--hub-danger-pale);
  color: var(--hub-danger);
}

/* ============ TAGS / STATUS PILLS ============ */
.hub-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--hub-bg-deep);
  color: var(--hub-text-soft);
}
.hub-tag.success { background: var(--hub-success-pale); color: #075F3C; }
.hub-tag.danger  { background: var(--hub-danger-pale);  color: #912018;  }
.hub-tag.warning { background: var(--hub-warning-pale); color: #93370D; }
.hub-tag.muted   { background: var(--hub-bg-deep);      color: var(--hub-text-muted); }

.hub-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 7px;
  font-size: 11.5px;
  font-weight: 500;
}
.hub-status::before {
  content: '';
  width: 5px; height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.hub-status.new         { color: #6366F1; background: #EEF2FF; }
.hub-status.in_progress { color: var(--hub-warning); background: var(--hub-warning-pale); }
.hub-status.quoted      { color: var(--hub-info); background: var(--hub-info-pale); }
.hub-status.accepted    { color: var(--hub-success); background: var(--hub-success-pale); }
.hub-status.rejected    { color: var(--hub-danger); background: var(--hub-danger-pale); }
.hub-status.closed      { color: var(--hub-text-muted); background: var(--hub-bg-deep); }
.hub-status.draft       { color: var(--hub-text-muted); background: var(--hub-bg-deep); }
.hub-status.sent        { color: var(--hub-info); background: var(--hub-info-pale); }
.hub-status.viewed      { color: var(--hub-accent); background: var(--hub-accent-pale); }
.hub-status.expired     { color: var(--hub-text-muted); background: var(--hub-bg-deep); }

.hub-site-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 2px 8px;
  border-radius: 5px;
  font-size: 11px;
  font-weight: 500;
  background: var(--site-color, var(--hub-bg-deep));
  color: #fff;
}

/* ============ EMPTY STATE ============ */
.hub-empty {
  text-align: center;
  padding: 50px 24px;
  color: var(--hub-text-muted);
}
.hub-empty-icon {
  width: 44px; height: 44px;
  border-radius: 10px;
  background: var(--hub-bg-deep);
  color: var(--hub-text-muted);
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.hub-empty h3 {
  color: var(--hub-text);
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}
.hub-empty p {
  font-size: 13px;
  margin: 0;
}

/* ============ PAGINATION ============ */
.hub-pagination {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 20px;
}
.hub-pagination a,
.hub-pagination span {
  min-width: 32px;
  height: 32px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 8px;
  font-size: 12.5px;
  font-weight: 500;
  color: var(--hub-text-soft);
  background: var(--hub-card);
  border: 1px solid var(--hub-border-soft);
}
.hub-pagination a:hover { background: var(--hub-bg-deep); color: var(--hub-text); }
.hub-pagination .current {
  background: var(--hub-primary);
  color: #fff;
  border-color: var(--hub-primary);
}
.hub-pagination a.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ============ LOGIN ============ */
.hub-login-card {
  max-width: 380px;
  background: var(--hub-card);
  padding: 36px 32px;
  border-radius: var(--hub-radius);
  border: 1px solid var(--hub-border-soft);
  box-shadow: var(--hub-shadow-lg);
  margin: 80px auto;
}
.hub-login-card h1 {
  font-size: 22px;
  font-weight: 700;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.hub-login-card .hub-btn {
  width: 100%;
  justify-content: center;
  padding: 11px;
  margin-top: 8px;
  font-size: 13.5px;
  font-weight: 600;
}

/* ============ TOAST ============ */
.hub-toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--hub-text);
  color: #fff;
  font-size: 12.5px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0,0,0,.15);
  z-index: 1000;
}
.hub-toast.success { background: var(--hub-success); }
.hub-toast.error { background: var(--hub-danger); }

/* ============ PRODUCT GRID ============ */
.hub-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}
.hub-product-card {
  background: var(--hub-card);
  border: 1px solid var(--hub-border-soft);
  border-radius: var(--hub-radius);
  overflow: hidden;
  transition: all 120ms;
  color: inherit;
}
.hub-product-card:hover {
  box-shadow: var(--hub-shadow-lg);
  transform: translateY(-1px);
}
.hub-product-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--hub-bg-deep) center / cover no-repeat;
  position: relative;
}
.hub-product-img-placeholder {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%;
  color: var(--hub-text-faint);
}
.hub-product-body { padding: 12px 14px; }
.hub-product-sku {
  font-size: 10px;
  font-family: var(--hub-font-mono);
  color: var(--hub-text-muted);
  margin-bottom: 4px;
}
.hub-product-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--hub-text);
  margin: 0 0 8px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hub-product-meta {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ============ ALERTS ============ */
.hub-alert {
  padding: 10px 14px;
  border-radius: 8px;
  background: var(--hub-danger-pale);
  color: var(--hub-danger);
  font-size: 13px;
  font-weight: 500;
}

/* ============ MODAL ============ */
.hub-modal-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 200;
}
.hub-modal {
  background: var(--hub-card);
  border-radius: var(--hub-radius);
  max-width: 720px;
  width: 90%;
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
  border: 1px solid var(--hub-border-soft);
}
.hub-modal-header {
  padding: 14px 18px;
  border-bottom: 1px solid var(--hub-border-soft);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}
.hub-modal-header h3 { margin: 0; font-size: 14px; font-weight: 600; letter-spacing: -0.01em; }
.hub-modal-close {
  width: 26px; height: 26px;
  border-radius: 5px;
  background: transparent;
  border: 1px solid transparent;
  color: var(--hub-text-muted);
  cursor: pointer;
  font-size: 18px;
  line-height: 1;
}
.hub-modal-close:hover { background: var(--hub-bg-deep); color: var(--hub-text); }
.hub-modal-body {
  padding: 16px 18px;
  overflow-y: auto;
  flex: 1;
}
.hub-modal-search {
  position: relative;
  margin-bottom: 14px;
}
.hub-modal-search input {
  width: 100%;
  padding: 10px 14px 10px 38px;
  border: 1px solid var(--hub-border);
  border-radius: 8px;
  background: var(--hub-bg-soft);
  font-size: 13px;
}
.hub-modal-search svg {
  position: absolute;
  left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--hub-text-muted);
}

.hub-pick-list { max-height: 50vh; overflow-y: auto; }
.hub-pick-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 7px;
  cursor: pointer;
}
.hub-pick-row:hover { background: var(--hub-bg-deep); }
.hub-pick-row img {
  width: 44px; height: 44px;
  border-radius: 6px;
  object-fit: cover;
  background: var(--hub-bg-deep);
}
.hub-pick-row .info { flex: 1; min-width: 0; }
.hub-pick-row .name { font-size: 13px; font-weight: 500; color: var(--hub-text); }
.hub-pick-row .sku { font-size: 11px; color: var(--hub-text-muted); margin-top: 2px; font-family: var(--hub-font-mono); }

/* ============ DASHBOARD: chart + pipeline + lists ============ */
.hub-chart {
  height: 220px;
  display: flex;
  align-items: flex-end;
  gap: 8px;
  padding-top: 20px;
}
.hub-bar {
  flex: 1;
  background: var(--hub-bg-deep);
  border-radius: 6px 6px 0 0;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  transition: background 120ms;
  min-height: 30px;
}
.hub-bar.active { background: var(--hub-primary); }
.hub-bar-day {
  position: absolute;
  bottom: -22px;
  left: 0; right: 0;
  text-align: center;
  font-size: 10px;
  color: var(--hub-text-muted);
  font-weight: 500;
}
.hub-bar.active .hub-bar-day { color: var(--hub-text); font-weight: 600; }
.hub-bar-value {
  font-family: var(--hub-font-mono);
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  padding: 8px 6px 4px;
  white-space: nowrap;
}
.hub-bar-label-bottom { font-size: 9px; color: rgba(255,255,255,.7); padding-bottom: 6px; }

.hub-pipeline {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  align-items: center;
}
.hub-pipeline-list { display: flex; flex-direction: column; gap: 10px; }
.hub-pipeline-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 0;
  border-bottom: 1px solid var(--hub-border-soft);
}
.hub-pipeline-item:last-child { border-bottom: 0; }
.hub-pipeline-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--hub-text-soft);
}
.hub-pipeline-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
}
.hub-pipeline-value {
  font-family: var(--hub-font-mono);
  font-size: 14px;
  font-weight: 600;
  color: var(--hub-text);
}
.hub-donut { width: 140px; height: 140px; margin-left: auto; }

.hub-period-select {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--hub-border);
  background: var(--hub-card);
  color: var(--hub-text-muted);
  font-size: 11px;
  font-weight: 500;
}

.hub-list { display: flex; flex-direction: column; gap: 4px; }
.hub-list-row {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 7px;
  align-items: center;
}
.hub-list-row:hover { background: var(--hub-bg-soft); }
.hub-list-thumb {
  width: 38px; height: 38px;
  border-radius: 7px;
  background: var(--hub-bg-deep);
  flex-shrink: 0;
}
.hub-list-main { flex: 1; min-width: 0; }
.hub-list-title { font-size: 12.5px; font-weight: 500; color: var(--hub-text); margin-bottom: 2px; }
.hub-list-sub { font-size: 11px; color: var(--hub-text-muted); display: flex; align-items: center; gap: 4px; }
.hub-list-right { text-align: right; flex-shrink: 0; }
.hub-list-amount {
  font-family: var(--hub-font-mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--hub-text);
}
.hub-list-amount-label { font-size: 10px; color: var(--hub-text-muted); margin-top: 1px; }

.hub-mini-table { width: 100%; border-collapse: collapse; font-size: 12px; }
.hub-mini-table th {
  text-align: left;
  padding: 8px 0;
  font-size: 10.5px;
  font-weight: 500;
  color: var(--hub-text-muted);
  border-bottom: 1px solid var(--hub-border-soft);
}
.hub-mini-table td {
  padding: 9px 0;
  border-bottom: 1px solid var(--hub-border-soft);
}
.hub-mini-table tr:last-child td { border-bottom: 0; }

.hub-fin-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px solid var(--hub-border-soft);
}
.hub-fin-row:last-of-type { border-bottom: 0; }
.hub-fin-icon {
  width: 30px; height: 30px;
  border-radius: 6px;
  background: var(--hub-bg-deep);
  color: var(--hub-text-muted);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.hub-fin-label { flex: 1; font-size: 12.5px; color: var(--hub-text-soft); }
.hub-fin-value { font-family: var(--hub-font-mono); font-size: 13px; font-weight: 600; }
.hub-fin-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 2px solid var(--hub-text);
}
.hub-fin-total-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--hub-text);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hub-fin-total-value {
  font-family: var(--hub-font-mono);
  font-size: 18px;
  font-weight: 700;
  color: var(--hub-text);
}

/* ============ WELCOME (dashboard) ============ */
.hub-welcome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  flex-wrap: wrap;
  gap: 14px;
}
.hub-welcome h1 {
  margin: 0;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.025em;
}
.hub-welcome-actions { display: flex; gap: 8px; }
.hub-welcome-actions .hub-btn { padding: 8px 14px; font-weight: 500; }

/* ============ TOTALS BOX ============ */
.hub-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 5px 0;
  font-size: 12.5px;
  color: var(--hub-text-soft);
}
.hub-totals-row strong {
  font-family: var(--hub-font-mono);
  font-weight: 600;
  color: var(--hub-text);
}
.hub-totals-grand {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 10px;
  padding-top: 12px;
  border-top: 2px solid var(--hub-text);
}
.hub-totals-grand .label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.hub-totals-grand .value {
  font-family: var(--hub-font-mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
}

/* ============ MOBILE SIDEBAR ============ */
.sidebar-backdrop {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  backdrop-filter: blur(2px);
  z-index: 95;
  display: none;
}
.hub-burger {
  display: none;
  width: 32px; height: 32px;
  border-radius: 7px;
  border: 1px solid var(--hub-border);
  background: var(--hub-card);
  color: var(--hub-text);
  align-items: center; justify-content: center;
}
.hub-burger:hover { background: var(--hub-bg-deep); }

.hub-nav { display: none !important; }
.hub-shell { all: unset; display: contents; }

/* ============ RESPONSIVE ============ */
@media (max-width: 1280px) {
  .hub-kpis { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .hub-sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    width: 280px;
    box-shadow: 6px 0 30px rgba(0,0,0,.15);
  }
  .hub-sidebar.is-open { transform: translateX(0); }
  body.sidebar-open .sidebar-backdrop { display: block; }
  .hub-content { margin-left: 0; }
  .hub-burger { display: inline-flex; }
  .sidebar-close {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px;
    background: transparent; border: 1px solid var(--hub-border);
    border-radius: 6px; color: var(--hub-text-muted); cursor: pointer;
  }
  .hub-edit-grid, .hub-offer-grid { grid-template-columns: 1fr; }
  .hub-edit-grid aside, .hub-offer-grid aside { position: static !important; top: auto !important; }
  .hub-grid-2 { grid-template-columns: 1fr; }
  .hub-grid-3 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .hub-main { padding: 16px; }
  .hub-topbar { padding: 10px 14px; }
  .hub-topbar-title span:first-child { display: none; }
  .hub-page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .hub-page-header h1 { font-size: 18px; }
  .hub-toolbar { flex-direction: column; align-items: stretch; }
  .hub-toolbar > * { width: 100%; }
  .hub-form-row, .hub-form-row-3 { grid-template-columns: 1fr; }
  .hub-kpis { grid-template-columns: repeat(2, 1fr); }
  .hub-kpi-value { font-size: 22px; }
  .hub-grid-3 { grid-template-columns: 1fr; }
  article.hub-card { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .hub-items-table { min-width: 640px; }
  .hub-modal { width: 95%; max-width: 95%; }
}

@media (max-width: 480px) {
  .hub-kpis { grid-template-columns: 1fr 1fr; }
  input, select, textarea { font-size: 16px !important; }
}

/* ============ PRINT ============ */
@media print {
  .hub-sidebar, .hub-content > .hub-topbar, .sidebar-backdrop { display: none !important; }
  .hub-content { margin-left: 0 !important; }
  body { background: #fff !important; }
}

[x-cloak] { display: none !important; }
