/* CANISEGUROS Admin — overrides on top of Polaris CDN. */
/* ===================================================================
   DESIGN TOKENS
   See admin/DESIGN-SYSTEM.md for the full system documentation.
   =================================================================== */
:root {
  /* Surfaces */
  --cs-bg: #f6f6f7;
  --cs-surface: #ffffff;
  --cs-surface-alt: #fafbfb;
  --cs-side: #1a1c1d;
  --cs-side-fg: #e3e5e7;
  --cs-side-active: #2c2e30;

  /* Foreground */
  --cs-text: #202223;
  --cs-text-muted: #6d7175;
  --cs-text-subdued: #8c9196;

  /* Brand & semantic */
  --cs-accent: #008060;
  --cs-accent-hover: #006e52;
  --cs-danger: #d72c0d;
  --cs-danger-hover: #b3260b;
  --cs-warning: #b98900;
  --cs-success: #008060;
  --cs-info: #0070b8;

  /* Borders & radii */
  --cs-border: #e1e3e5;
  --cs-border-strong: #c9cccf;
  --cs-radius-sm: 4px;
  --cs-radius-md: 8px;
  --cs-radius-lg: 12px;

  /* Elevation */
  --cs-shadow-sm: 0 1px 0 rgba(0,0,0,0.05);
  --cs-shadow-md: 0 4px 8px -2px rgba(0,0,0,0.06), 0 1px 0 rgba(0,0,0,0.05);
  --cs-shadow-lg: 0 12px 24px -4px rgba(0,0,0,0.08);

  /* Spacing scale */
  --cs-space-1: 4px;
  --cs-space-2: 8px;
  --cs-space-3: 12px;
  --cs-space-4: 16px;
  --cs-space-5: 24px;
  --cs-space-6: 32px;
  --cs-space-7: 48px;

  /* Typography scale */
  --cs-font-xs: 12px;
  --cs-font-sm: 13px;
  --cs-font-base: 14px;
  --cs-font-md: 15px;
  --cs-font-lg: 17px;
  --cs-font-xl: 20px;
  --cs-font-2xl: 24px;
  --cs-font-3xl: 32px;
  --cs-line-tight: 1.2;
  --cs-line-base: 1.5;

  /* Z-index scale (use these instead of magic numbers) */
  --z-base: 1;
  --z-sticky: 10;
  --z-dropdown: 100;
  --z-sidebar-mobile: 200;
  --z-drawer-bg: 800;
  --z-drawer: 850;
  --z-modal-backdrop: 900;
  --z-modal: 1000;
  --z-toast: 1100;
  --z-palette: 1200;
}
* { box-sizing: border-box; }
body { margin: 0; background: var(--cs-bg); font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: #202223; }
.cs-shell { display: flex; min-height: 100vh; }
.cs-sidebar { width: 220px; background: var(--cs-side); color: var(--cs-side-fg); display: flex; flex-direction: column; }
.cs-brand { padding: 20px; font-weight: 700; letter-spacing: 0.5px; border-bottom: 1px solid #2c2e30; }
.cs-brand span { font-weight: 400; opacity: 0.6; font-size: 12px; }
.cs-sidebar nav { display: flex; flex-direction: column; padding: 8px 0; flex: 1; }
.cs-sidebar nav a { color: var(--cs-side-fg); text-decoration: none; padding: 10px 20px; font-size: 14px; }
.cs-sidebar nav a:hover { background: var(--cs-side-active); }
.cs-sidebar nav a.active { background: var(--cs-side-active); border-left: 3px solid var(--cs-accent); padding-left: 17px; }
.cs-user { padding: 16px 20px; border-top: 1px solid #2c2e30; display: flex; align-items: center; justify-content: space-between; font-size: 13px; }
.cs-main { flex: 1; padding: 24px 32px; max-width: calc(100vw - 220px); }

h1.cs-h1 { font-size: 22px; margin: 0 0 16px; font-weight: 600; }
h2.cs-h2 { font-size: 16px; margin: 24px 0 8px; font-weight: 600; }

.cs-card { background: white; border: 1px solid var(--cs-border); border-radius: 8px; padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 1px 0 rgba(0,0,0,0.05); }

.cs-stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 12px; margin-bottom: 24px; }
.cs-stat { background: white; border: 1px solid var(--cs-border); border-radius: 8px; padding: 16px; }
.cs-stat .label { font-size: 12px; color: #6d7175; text-transform: uppercase; letter-spacing: 0.4px; }
.cs-stat .value { font-size: 28px; font-weight: 600; margin-top: 4px; }
.cs-stat .sub { font-size: 12px; color: #6d7175; margin-top: 4px; }

table.cs-table { width: 100%; border-collapse: collapse; background: white; border: 1px solid var(--cs-border); border-radius: 8px; overflow: hidden; }
table.cs-table th, table.cs-table td { padding: 10px 14px; text-align: left; border-bottom: 1px solid var(--cs-border); font-size: 14px; }
table.cs-table th { background: #f6f6f7; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: 0.4px; color: #6d7175; }
table.cs-table tr:last-child td { border-bottom: none; }
table.cs-table tr:hover td { background: #fafbfb; }
table.cs-table a { color: var(--cs-accent); text-decoration: none; }

.cs-badge { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 12px; font-weight: 500; }
.cs-badge-new { background: #e3f1df; color: #155724; }
.cs-badge-in_review { background: #fff4e5; color: #8a4b00; }
.cs-badge-replied { background: #e0e7ff; color: #1d3580; }
.cs-badge-closed { background: #ececec; color: #444; }
.cs-badge-pending { background: #fff4e5; color: #8a4b00; }
.cs-badge-approved { background: #e3f1df; color: #155724; }
.cs-badge-rejected { background: #fde2e2; color: #8a1f1f; }
.cs-badge-onhold { background: #ececec; color: #444; }

.cs-tabs { display: flex; gap: 4px; margin-bottom: 16px; border-bottom: 1px solid var(--cs-border); }
.cs-tabs a { padding: 8px 12px; text-decoration: none; color: #444; font-size: 14px; border-bottom: 2px solid transparent; }
.cs-tabs a.active { border-color: var(--cs-accent); color: var(--cs-accent); font-weight: 600; }

.cs-form-row { margin-bottom: 14px; }
.cs-form-row label { display: block; font-size: 13px; margin-bottom: 4px; font-weight: 500; }
.cs-form-row input[type=text], .cs-form-row input[type=email], .cs-form-row input[type=password], .cs-form-row input[type=number], .cs-form-row input[type=url], .cs-form-row select, .cs-form-row textarea {
  width: 100%; padding: 8px 10px; border: 1px solid #c9cccf; border-radius: 4px; font-size: 14px; font-family: inherit;
}
.cs-form-row textarea { min-height: 100px; resize: vertical; }

.cs-btn { display: inline-block; padding: 8px 14px; background: var(--cs-accent); color: white; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; text-decoration: none; }
.cs-btn:hover { background: #006e52; }
.cs-btn-secondary { background: white; color: #202223; border: 1px solid #c9cccf; }
.cs-btn-secondary:hover { background: #f6f6f7; }
.cs-btn-danger { background: #d72c0d; }
.cs-btn-danger:hover { background: #b3260b; }

.cs-flash { padding: 10px 14px; border-radius: 4px; margin-bottom: 16px; font-size: 14px; }
.cs-flash-success { background: #e3f1df; color: #155724; }
.cs-flash-error { background: #fde2e2; color: #8a1f1f; }
.cs-flash-info { background: #e0e7ff; color: #1d3580; }

.cs-banner { padding: 10px 14px; border-radius: 4px; background: #fff8e0; color: #8a6d00; border-left: 4px solid #d4a000; margin-bottom: 16px; font-size: 13px; }

.cs-photo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.cs-photo-grid img { width: 100%; height: 140px; object-fit: cover; border-radius: 4px; border: 1px solid var(--cs-border); cursor: pointer; }

.cs-chip { display: inline-block; padding: 4px 10px; border-radius: 12px; background: #e0e7ff; color: #1d3580; font-size: 12px; margin: 2px; }

.cs-toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-bottom: 14px; }
.cs-toolbar input, .cs-toolbar select { padding: 6px 10px; border: 1px solid #c9cccf; border-radius: 4px; font-size: 14px; }

.cs-login { max-width: 360px; margin: 80px auto; padding: 32px; background: white; border-radius: 8px; border: 1px solid var(--cs-border); }
.cs-login h1 { text-align: center; margin: 0 0 24px; }

.cs-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cs-kv { display: grid; grid-template-columns: 180px 1fr; gap: 6px 16px; font-size: 14px; }
.cs-kv .k { color: #6d7175; }

/* ===== Settings hub additions ===== */
.cs-nav-group { padding: 0; }
.cs-nav-group > summary { color: var(--cs-side-fg); padding: 10px 20px; font-size: 14px; cursor: pointer; list-style: none; }
.cs-nav-group > summary::-webkit-details-marker { display: none; }
.cs-nav-group > summary::before { content: '▸ '; opacity: 0.6; margin-right: 4px; }
.cs-nav-group[open] > summary::before { content: '▾ '; }
.cs-nav-group > summary:hover { background: var(--cs-side-active); }
.cs-nav-group > summary.active { background: var(--cs-side-active); }
.cs-nav-group a { padding-left: 36px !important; font-size: 13px !important; opacity: 0.9; }

.cs-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.cs-row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.cs-row-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
@media (max-width: 900px) { .cs-row-2, .cs-row-3 { grid-template-columns: 1fr; } }

.cs-btn { display: inline-block; padding: 8px 14px; background: var(--cs-accent); color: white; border: none; border-radius: 4px; font-size: 14px; cursor: pointer; text-decoration: none; }
.cs-btn:hover { filter: brightness(0.95); }
.cs-btn-secondary { background: white; color: #202223; border: 1px solid #c9cccf; }
.cs-btn-danger { background: #d72c0d; }
.cs-btn-sm { padding: 4px 10px; font-size: 12px; }

.cs-status { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; padding: 2px 8px; border-radius: 10px; font-weight: 500; }
.cs-status::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.cs-status-connected    { background: #e3f1df; color: #155724; }
.cs-status-unconfigured { background: #ececec; color: #555; }
.cs-status-error        { background: #fde2e2; color: #8a1f1f; }
.cs-status-testing      { background: #fff4e5; color: #8a4b00; }
.cs-status-disabled     { background: #ececec; color: #888; }

.cs-tile { background: white; border: 1px solid var(--cs-border); border-radius: 8px; padding: 18px; text-decoration: none; color: inherit; display: flex; flex-direction: column; gap: 6px; transition: box-shadow 0.15s; }
.cs-tile:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }
.cs-tile .icon { font-size: 28px; }
.cs-tile .title { font-weight: 600; font-size: 15px; }
.cs-tile .meta { font-size: 12px; color: #6d7175; }

.cs-progress { background: #ececec; border-radius: 6px; height: 10px; overflow: hidden; }
.cs-progress > div { height: 100%; background: var(--cs-accent); transition: width 0.3s; }

.cs-flash { padding: 10px 14px; border-radius: 6px; margin-bottom: 14px; font-size: 14px; }
.cs-flash-success { background: #e3f1df; color: #155724; }
.cs-flash-error   { background: #fde2e2; color: #8a1f1f; }
.cs-flash-info    { background: #e0e7ff; color: #1d3580; }

.cs-secret-row { display: flex; gap: 6px; align-items: center; }
.cs-secret-row input { font-family: ui-monospace, "SF Mono", Menlo, monospace; }

.cs-toggle { position: relative; display: inline-block; width: 40px; height: 22px; }
.cs-toggle input { opacity: 0; width: 0; height: 0; }
.cs-toggle .slider { position: absolute; cursor: pointer; inset: 0; background: #c9cccf; border-radius: 22px; transition: 0.2s; }
.cs-toggle .slider::before { content: ''; position: absolute; height: 16px; width: 16px; left: 3px; bottom: 3px; background: white; border-radius: 50%; transition: 0.2s; }
.cs-toggle input:checked + .slider { background: var(--cs-accent); }
.cs-toggle input:checked + .slider::before { transform: translateX(18px); }

.cs-zone-pill { display: inline-block; padding: 2px 8px; margin: 2px; background: #f0f0f0; border-radius: 10px; font-size: 11px; }

/* === Order shipping UI === */
.cs-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:11px; font-weight:600; text-transform:uppercase; letter-spacing:0.3px; }
.cs-badge-gray   { background:#ececec; color:#555; }
.cs-badge-blue   { background:#dbeafe; color:#1e40af; }
.cs-badge-yellow { background:#fef3c7; color:#92400e; }
.cs-badge-orange { background:#ffedd5; color:#9a3412; }
.cs-badge-green  { background:#d1fae5; color:#065f46; }
.cs-badge-red    { background:#fee2e2; color:#991b1b; }
.cs-badge-purple { background:#ede9fe; color:#5b21b6; }

.cs-btn-primary { background: var(--cs-accent); color: white; }

.cs-dialog { border:1px solid var(--cs-border); border-radius:8px; padding:20px; max-width:640px; width:90vw; box-shadow:0 12px 40px rgba(0,0,0,0.2); }
.cs-dialog::backdrop { background: rgba(0,0,0,0.45); }

.cs-timeline { list-style:none; padding-left:0; }
.cs-timeline li { padding:4px 0 4px 22px; position:relative; color:#6d7175; }
.cs-timeline li::before { content:''; position:absolute; left:6px; top:10px; width:8px; height:8px; border-radius:50%; background:#d0d2d4; }
.cs-timeline li.active { color:#202223; font-weight:500; }
.cs-timeline li.active::before { background: var(--cs-accent); }

.cs-toolbar { display:flex; gap:12px; flex-wrap:wrap; align-items:end; }

/* ===== Customer center / content / settings additions ===== */
.cs-badge-active     { background: #e3f1df; color: #155724; }
.cs-badge-disabled   { background: #ececec; color: #444; }
.cs-badge-blocked    { background: #fde2e2; color: #8a1f1f; }
.cs-badge-published  { background: #e3f1df; color: #155724; }
.cs-badge-draft      { background: #ececec; color: #444; }
.cs-badge-scheduled  { background: #fff4e5; color: #8a4b00; }
.cs-badge-archived   { background: #ececec; color: #888; }
.cs-badge-sent       { background: #e3f1df; color: #155724; }
.cs-badge-failed     { background: #fde2e2; color: #8a1f1f; }
.cs-badge-bounced    { background: #fde2e2; color: #8a1f1f; }
.cs-badge-queued     { background: #fff4e5; color: #8a4b00; }
.cs-badge-sending    { background: #e0e7ff; color: #1d3580; }
.cs-badge-paid       { background: #e3f1df; color: #155724; }
.cs-badge-refunded   { background: #ececec; color: #444; }
.cs-badge-partially_sent { background: #fff4e5; color: #8a4b00; }

.cs-tl-row { display: flex; gap: 10px; padding: 10px; border: 1px solid var(--cs-border); border-radius: 6px; margin-bottom: 6px; background: white; }
.cs-tl-icon { width: 28px; height: 28px; border-radius: 50%; background: #f0f0f0; display: flex; align-items: center; justify-content: center; font-weight: 600; flex-shrink: 0; }
.cs-tl-body { flex: 1; min-width: 0; }

.cs-modal-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: var(--z-modal); }
.cs-modal { background: white; border-radius: 8px; padding: 20px; width: min(680px, 92vw); max-height: 90vh; overflow-y: auto; }
.cs-modal-h { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--cs-border); }
.cs-modal-x { background: none; border: 0; font-size: 22px; cursor: pointer; color: #888; }
.cs-chips-input { min-height: 28px; padding: 4px; border: 1px solid var(--cs-border); border-radius: 4px; margin-bottom: 4px; max-height: 120px; overflow-y: auto; }

.cs-settings-shell { display: grid; grid-template-columns: 240px 1fr; gap: 16px; }
.cs-settings-side { background: white; border: 1px solid var(--cs-border); border-radius: 8px; padding: 8px 0; position: sticky; top: 16px; align-self: start; max-height: calc(100vh - 32px); overflow-y: auto; }
.cs-settings-side-h { padding: 12px 16px; font-weight: 600; font-size: 13px; color: #6d7175; text-transform: uppercase; letter-spacing: 0.4px; border-bottom: 1px solid var(--cs-border); }
.cs-settings-side nav { display: flex; flex-direction: column; }
.cs-settings-side nav a { padding: 8px 16px; font-size: 14px; color: #202223; text-decoration: none; display: flex; align-items: center; gap: 8px; }
.cs-settings-side nav a:hover { background: #f6f6f7; }
.cs-settings-side nav a.active { background: #f1f8f5; color: var(--cs-accent); border-left: 3px solid var(--cs-accent); padding-left: 13px; font-weight: 500; }
.cs-settings-side-ic { width: 20px; text-align: center; font-size: 14px; }
.cs-settings-content { min-width: 0; }

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

/* ===== Audit-pass additions ===== */
/* Canonical badge palette — alias classes so views can pick a color directly. */
.cs-badge--gray   { background:#ececec; color:#444; }
.cs-badge--blue   { background:#dbeafe; color:#1e40af; }
.cs-badge--green  { background:#d1fae5; color:#065f46; }
.cs-badge--yellow { background:#fef3c7; color:#92400e; }
.cs-badge--red    { background:#fee2e2; color:#991b1b; }
.cs-badge--purple { background:#ede9fe; color:#5b21b6; }
.cs-badge--orange { background:#ffedd5; color:#9a3412; }

/* Field-level form errors */
.cs-field-error { color:#991b1b; font-size:12px; margin-top:4px; }
.cs-form-row.has-error input,
.cs-form-row.has-error select,
.cs-form-row.has-error textarea { border-color:#991b1b; }
.cs-help-text { color:#6d7175; font-size:12px; margin-top:4px; }

/* Empty state */
.cs-empty { padding:48px 20px; text-align:center; color:#6d7175; background:white; border:1px dashed var(--cs-border); border-radius:8px; }
.cs-empty .cs-empty-icon { font-size:36px; margin-bottom:8px; opacity:0.6; }
.cs-empty .cs-empty-title { font-size:16px; font-weight:600; color:#202223; margin-bottom:4px; }
.cs-empty .cs-empty-actions { margin-top:12px; }

/* Spinner */
.cs-spinner { display:inline-block; width:14px; height:14px; border:2px solid #c9cccf; border-top-color: var(--cs-accent); border-radius:50%; animation: cs-spin 0.8s linear infinite; vertical-align:middle; }
.cs-spinner-lg { width:24px; height:24px; border-width:3px; }
@keyframes cs-spin { to { transform: rotate(360deg); } }
.cs-loading { opacity:0.6; pointer-events:none; }

/* Pagination */
.cs-pagination { display:flex; justify-content:space-between; align-items:center; gap:12px; margin-top:14px; padding:8px 4px; flex-wrap:wrap; }
.cs-pagination-info { font-size:13px; color:#6d7175; }
.cs-pagination-links { display:flex; align-items:center; gap:6px; flex-wrap:wrap; }

/* Bulk action bar */
.cs-bulk-bar { display:none; background:#1d3580; color:white; padding:10px 14px; border-radius:6px; margin-bottom:10px; align-items:center; gap:12px; }
.cs-bulk-bar.is-visible { display:flex; }
.cs-bulk-bar .cs-bulk-count { font-weight:600; }
.cs-bulk-bar .cs-btn { background:white; color:#1d3580; }

/* Icon button */
.cs-icon-btn { background:none; border:none; cursor:pointer; padding:4px 6px; color:#6d7175; font-size:16px; line-height:1; border-radius:4px; }
.cs-icon-btn:hover { background:#f0f0f0; color:#202223; }

/* Mobile basics — collapsible nav, table scroll */
.cs-mobile-nav-toggle { display: none; background: var(--cs-side-active); color:white; padding:8px 12px; border-radius:4px; cursor:pointer; font-size:13px; border:none; margin:8px; }
@media (max-width: 768px) {
  .cs-shell { flex-direction: column; }
  .cs-sidebar { width: 100%; }
  .cs-sidebar nav, .cs-sidebar .cs-user { display: none; }
  .cs-sidebar.is-open nav, .cs-sidebar.is-open .cs-user { display: flex; }
  .cs-mobile-nav-toggle { display: inline-block; }
  .cs-main { padding: 14px; max-width: 100vw; }
  table.cs-table { font-size: 12.5px; display:block; overflow-x:auto; white-space:nowrap; }
  .cs-settings-shell { grid-template-columns: 1fr; }
  .cs-settings-side { position: static; }
  .cs-row-2, .cs-row-3, .cs-row-4 { grid-template-columns: 1fr; }
  .cs-kv { grid-template-columns: 1fr; }
}

/* ===== Global search palette (Cmd+K) ===== */
.cs-topbar { display:flex; align-items:center; gap:8px; padding:10px 16px; background:white; border-bottom:1px solid var(--cs-border); position:sticky; top:0; z-index: var(--z-sticky); }
.cs-topbar-search { flex:1; max-width:560px; display:flex; align-items:center; gap:8px; padding:6px 12px; background:#f6f6f7; border:1px solid var(--cs-border); border-radius:6px; cursor:pointer; color:#6d7175; font-size:14px; }
.cs-topbar-search:hover { background:#eef0f1; }
.cs-topbar-search kbd { font-family:ui-monospace,monospace; background:white; border:1px solid var(--cs-border); border-radius:3px; padding:1px 6px; font-size:11px; }

.search-palette { position:fixed; inset:0; z-index: var(--z-palette); display:none; }
.search-palette.open { display:block; }
.search-palette-bg { position:absolute; inset:0; background:rgba(0,0,0,0.45); }
.search-palette-box { position:relative; max-width:640px; margin:80px auto 0; background:white; border-radius:10px; box-shadow:0 20px 60px rgba(0,0,0,0.4); display:flex; flex-direction:column; max-height:70vh; }
.search-palette-input { padding:16px 20px; border:none; border-bottom:1px solid var(--cs-border); font-size:16px; outline:none; border-radius:10px 10px 0 0; }
.search-palette-results { overflow-y:auto; flex:1; padding:4px 0; }
.search-palette-foot { padding:8px 16px; border-top:1px solid var(--cs-border); font-size:11px; color:#6d7175; }
.search-palette-group { padding:8px 16px 4px; font-size:11px; text-transform:uppercase; color:#6d7175; letter-spacing:0.4px; font-weight:600; }
.search-palette-row { display:flex; gap:10px; padding:8px 16px; cursor:pointer; align-items:center; }
.search-palette-row.active, .search-palette-row:hover { background:#f1f8f5; }
.search-palette-row img, .search-palette-noimg { width:32px; height:32px; border-radius:4px; background:#ececec; object-fit:cover; flex-shrink:0; }
.search-palette-meta { flex:1; min-width:0; }
.search-palette-title { font-size:14px; font-weight:500; }
.search-palette-sub { font-size:12px; color:#6d7175; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.search-palette-empty { padding:24px; text-align:center; color:#6d7175; font-size:13px; }

/* ===== Autocomplete picker ===== */
.cs-picker { position:relative; }
.cs-picker-label { display:block; font-size:13px; margin-bottom:4px; font-weight:500; }
.cs-picker-chips { display:flex; flex-wrap:wrap; gap:4px; padding:4px; min-height:0; }
.cs-picker-chips:empty { display:none; }
.cs-picker-chip { display:inline-flex; align-items:center; gap:4px; padding:3px 6px 3px 10px; background:#e0e7ff; color:#1d3580; border-radius:12px; font-size:12px; }
.cs-picker-chip button { background:none; border:none; color:#1d3580; cursor:pointer; font-size:14px; line-height:1; padding:0 2px; }
.cs-picker-input { width:100%; padding:8px 10px; border:1px solid #c9cccf; border-radius:4px; font-size:14px; }
.cs-picker-dropdown { position:absolute; left:0; right:0; top:100%; z-index:50; background:white; border:1px solid var(--cs-border); border-radius:0 0 6px 6px; max-height:260px; overflow-y:auto; box-shadow:0 6px 20px rgba(0,0,0,0.1); }
.cs-picker-row { display:flex; gap:8px; padding:8px 10px; cursor:pointer; align-items:center; }
.cs-picker-row.active, .cs-picker-row:hover { background:#f1f8f5; }
.cs-picker-row img, .cs-picker-noimg { width:28px; height:28px; border-radius:4px; background:#ececec; object-fit:cover; flex-shrink:0; }
.cs-picker-meta { flex:1; min-width:0; }
.cs-picker-title { font-size:13px; font-weight:500; }
.cs-picker-sub { font-size:11px; color:#6d7175; }
.cs-picker-empty { padding:12px; text-align:center; color:#6d7175; font-size:12px; }

/* ===== Drag-drop dropzone ===== */
.dropzone { border:2px dashed #c9cccf; border-radius:8px; padding:0; transition:border-color 0.15s, background 0.15s; }
.dropzone.drag { border-color:var(--cs-accent); background:#f1f8f5; }
.dropzone-inner { padding:32px; text-align:center; cursor:pointer; }
.dropzone-icon { font-size:32px; margin-bottom:8px; }
.dropzone-text { font-size:14px; color:#202223; }
.dropzone-sub { font-size:12px; color:#6d7175; margin-top:4px; }
.dropzone-queue { padding:8px; display:flex; flex-direction:column; gap:6px; }
.dropzone-queue:empty { display:none; }
.dropzone-row { display:flex; gap:10px; padding:8px; border:1px solid var(--cs-border); border-radius:6px; align-items:center; }
.dropzone-row img, .dropzone-noimg { width:48px; height:48px; border-radius:4px; background:#ececec; object-fit:cover; flex-shrink:0; }
.dropzone-row.ok { border-color:#16a34a; background:#f1f8f5; }
.dropzone-row.error { border-color:#dc2626; background:#fee; }
.dropzone-row-meta { flex:1; min-width:0; }
.dropzone-row-name { font-size:13px; font-weight:500; }
.dropzone-row-size { font-size:11px; color:#6d7175; }
.dropzone-progress { background:#ececec; border-radius:6px; height:4px; overflow:hidden; margin-top:4px; }
.dropzone-progress > div { height:100%; background:var(--cs-accent); width:0%; transition:width 0.2s; }
.dropzone-msg { font-size:11px; color:#6d7175; margin-top:2px; }

/* ===== Empty state ===== */
.empty-state { text-align:center; padding:48px 24px; background:white; border:1px solid var(--cs-border); border-radius:8px; }
.empty-state-icon { font-size:48px; margin-bottom:12px; }
.empty-state-headline { font-size:18px; font-weight:600; margin:0 0 8px; }
.empty-state-desc { font-size:14px; color:#6d7175; margin:0 0 16px; max-width:480px; margin-left:auto; margin-right:auto; }
.empty-state-actions { display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }

/* ===== Field error / success ===== */
.field-error { color:#8a1f1f; font-size:12px; margin-top:4px; }
.field-success { color:#155724; font-size:12px; margin-top:4px; }
.field-success a { color:inherit; text-decoration:underline; }
.cs-invalid { border-color:#dc2626 !important; box-shadow:0 0 0 1px #dc2626 inset; }

/* ===== Filter active indicator ===== */
.cs-filter-active { display:inline-flex; align-items:center; gap:6px; padding:4px 10px; background:#fff4e5; color:#8a4b00; border-radius:12px; font-size:12px; }
.cs-filter-active a { color:#8a4b00; text-decoration:underline; }

/* ===== Variant matrix ===== */
.cs-option-row { display:flex; gap:8px; align-items:center; margin-bottom:8px; }
.cs-option-values { display:flex; flex-wrap:wrap; gap:4px; padding:4px; border:1px solid var(--cs-border); border-radius:4px; min-height:34px; flex:1; }
.cs-option-value { display:inline-flex; align-items:center; gap:4px; padding:3px 6px 3px 10px; background:#ececec; border-radius:12px; font-size:12px; }
.cs-option-value button { background:none; border:none; cursor:pointer; padding:0 2px; }

/* Aliases for partials/empty-state.ejs (uses .empty-state-*) */
.empty-state { padding:48px 20px; text-align:center; color:#6d7175; background:white; border:1px dashed var(--cs-border); border-radius:8px; }
.empty-state-icon { font-size:36px; margin-bottom:8px; opacity:0.6; }
.empty-state-headline { font-size:16px; font-weight:600; color:#202223; margin:0 0 4px; }
.empty-state-desc { margin:0 0 12px; }
.empty-state-actions { margin-top:12px; display:flex; gap:8px; justify-content:center; flex-wrap:wrap; }

/* ===================================================================
   POLISH PASS — STANDARD COMPONENT LIBRARY
   These extend (not replace) the legacy classes above. Existing
   .cs-btn / .cs-card / .cs-table classes continue to work; the new
   BEM-style aliases (.cs-btn--primary, etc.) are documented in
   admin/DESIGN-SYSTEM.md as the preferred form going forward.
   =================================================================== */

/* ---------- Buttons (BEM aliases + missing variants) ---------- */
.cs-btn { font-weight: 500; line-height: 1.2; transition: background 0.15s, box-shadow 0.15s, opacity 0.15s; user-select: none; }
.cs-btn:focus-visible { outline: 2px solid var(--cs-accent); outline-offset: 2px; }
.cs-btn[disabled], .cs-btn.is-disabled { opacity: 0.55; cursor: not-allowed; pointer-events: none; }
.cs-btn.is-loading { position: relative; color: transparent !important; pointer-events: none; }
.cs-btn.is-loading::after { content: ''; position: absolute; inset: 0; margin: auto; width: 14px; height: 14px; border: 2px solid currentColor; border-top-color: transparent; border-radius: 50%; animation: cs-spin 0.7s linear infinite; color: white; }

.cs-btn--primary  { background: var(--cs-accent); color: #fff; border: 1px solid var(--cs-accent); }
.cs-btn--primary:hover { background: var(--cs-accent-hover); border-color: var(--cs-accent-hover); }
.cs-btn--secondary { background: #fff; color: var(--cs-text); border: 1px solid var(--cs-border-strong); }
.cs-btn--secondary:hover { background: var(--cs-bg); }
.cs-btn--danger  { background: var(--cs-danger); color: #fff; border: 1px solid var(--cs-danger); }
.cs-btn--danger:hover { background: var(--cs-danger-hover); border-color: var(--cs-danger-hover); }
.cs-btn--plain  { background: transparent; color: var(--cs-accent); border: none; padding: 4px 6px; }
.cs-btn--plain:hover { background: rgba(0,128,96,0.08); }
.cs-btn--small  { padding: 4px 10px; font-size: var(--cs-font-xs); }
.cs-btn--icon   { width: 32px; height: 32px; padding: 0; display: inline-flex; align-items: center; justify-content: center; }

/* ---------- Cards (BEM aliases) ---------- */
.cs-card__header { display: flex; justify-content: space-between; align-items: center; gap: var(--cs-space-3); padding-bottom: var(--cs-space-3); margin-bottom: var(--cs-space-4); border-bottom: 1px solid var(--cs-border); }
.cs-card__header:last-child { border-bottom: none; padding-bottom: 0; margin-bottom: 0; }
.cs-card__title { font-size: var(--cs-font-md); font-weight: 600; margin: 0; line-height: var(--cs-line-tight); }
.cs-card__subtitle { font-size: var(--cs-font-sm); color: var(--cs-text-muted); margin: 2px 0 0; }
.cs-card__actions { display: flex; gap: var(--cs-space-2); align-items: center; flex-shrink: 0; }
.cs-card__body { font-size: var(--cs-font-base); }
.cs-card__footer { margin-top: var(--cs-space-4); padding-top: var(--cs-space-3); border-top: 1px solid var(--cs-border); display: flex; justify-content: flex-end; gap: var(--cs-space-2); }

/* ---------- Page layout ---------- */
.cs-page { max-width: 1280px; margin: 0 auto; }
.cs-page__header { display: flex; justify-content: space-between; align-items: flex-start; gap: var(--cs-space-4); margin-bottom: var(--cs-space-5); flex-wrap: wrap; }
.cs-page__title { font-size: var(--cs-font-2xl); font-weight: 600; margin: 0; line-height: var(--cs-line-tight); }
.cs-page__subtitle { font-size: var(--cs-font-sm); color: var(--cs-text-muted); margin-top: 4px; }
.cs-page__actions { display: flex; gap: var(--cs-space-2); flex-shrink: 0; flex-wrap: wrap; }
.cs-page__body { display: flex; flex-direction: column; gap: var(--cs-space-4); }

/* ---------- Detail (2-column grid with sticky sidebar) ---------- */
.cs-detail { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: var(--cs-space-5); align-items: start; }
.cs-detail__main { display: flex; flex-direction: column; gap: var(--cs-space-4); min-width: 0; }
.cs-detail__side { display: flex; flex-direction: column; gap: var(--cs-space-4); position: sticky; top: var(--cs-space-4); }
@media (max-width: 1024px) {
  .cs-detail { grid-template-columns: 1fr; }
  .cs-detail__side { position: static; }
}

/* ---------- Form layout (modern field component) ---------- */
.cs-form-field { display: flex; flex-direction: column; gap: 4px; margin-bottom: var(--cs-space-3); }
.cs-form-field > label { font-size: var(--cs-font-sm); font-weight: 600; color: var(--cs-text); }
.cs-form-field input[type=text],
.cs-form-field input[type=email],
.cs-form-field input[type=password],
.cs-form-field input[type=number],
.cs-form-field input[type=url],
.cs-form-field input[type=tel],
.cs-form-field input[type=date],
.cs-form-field input[type=datetime-local],
.cs-form-field select,
.cs-form-field textarea {
  width: 100%; padding: 8px 10px; border: 1px solid var(--cs-border-strong); border-radius: var(--cs-radius-sm);
  font-size: var(--cs-font-base); font-family: inherit; background: #fff; color: var(--cs-text);
  transition: border-color 0.15s, box-shadow 0.15s;
}
.cs-form-field input:focus, .cs-form-field select:focus, .cs-form-field textarea:focus {
  outline: none; border-color: var(--cs-accent); box-shadow: 0 0 0 3px rgba(0,128,96,0.15);
}
.cs-form-field textarea { min-height: 96px; resize: vertical; }
.cs-form-help { font-size: var(--cs-font-xs); color: var(--cs-text-muted); margin-top: 2px; }
.cs-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--cs-space-4); }
@media (max-width: 768px) { .cs-form-grid { grid-template-columns: 1fr; } }

/* Sticky bottom action bar for long forms */
.cs-form-actions { display: flex; justify-content: flex-end; align-items: center; gap: var(--cs-space-2); padding: var(--cs-space-3) 0; }
.cs-form-actions--sticky { position: sticky; bottom: 0; background: var(--cs-surface); border-top: 1px solid var(--cs-border); padding: var(--cs-space-3) var(--cs-space-4); margin: var(--cs-space-4) calc(-1 * var(--cs-space-4)) 0; box-shadow: 0 -4px 8px -4px rgba(0,0,0,0.06); z-index: 5; }
.cs-form-actions__spacer { flex: 1; }

/* ---------- Tables (responsive wrap) ---------- */
.cs-table-wrap { width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; border: 1px solid var(--cs-border); border-radius: var(--cs-radius-md); background: var(--cs-surface); }
.cs-table-wrap > table.cs-table { border: none; border-radius: 0; }
table.cs-table td.cs-num, table.cs-table th.cs-num { text-align: right; font-variant-numeric: tabular-nums; }
table.cs-table td.cs-actions, table.cs-table th.cs-actions { text-align: right; white-space: nowrap; }

/* ---------- Filter bar ---------- */
.cs-filter-bar { background: var(--cs-bg); border: 1px solid var(--cs-border); border-radius: var(--cs-radius-md); padding: var(--cs-space-3) var(--cs-space-4); margin-bottom: var(--cs-space-3); }
.cs-filter-bar__row { display: flex; flex-wrap: wrap; gap: var(--cs-space-3); align-items: end; }
.cs-filter-bar__row > * { min-width: 140px; }

/* ---------- Tabs (better contrast + count chip) ---------- */
.cs-tabs__item { padding: 8px 12px; text-decoration: none; color: var(--cs-text-muted); font-size: var(--cs-font-base); border-bottom: 2px solid transparent; cursor: pointer; }
.cs-tabs__item:hover { color: var(--cs-text); }
.cs-tabs__item.is-active, .cs-tabs__item.active { border-color: var(--cs-accent); color: var(--cs-accent); font-weight: 600; }
.cs-tabs__count { display: inline-block; margin-left: 6px; padding: 0 6px; background: var(--cs-bg); border-radius: 10px; font-size: 11px; color: var(--cs-text-muted); font-weight: 500; }
.cs-tabs__item.is-active .cs-tabs__count, .cs-tabs__item.active .cs-tabs__count { background: rgba(0,128,96,0.12); color: var(--cs-accent); }

/* ---------- Drawer (slide from right) ---------- */
.cs-drawer-bg { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: var(--z-drawer-bg); display: none; }
.cs-drawer-bg.is-open { display: block; }
.cs-drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(480px, 92vw); background: #fff; box-shadow: var(--cs-shadow-lg); z-index: var(--z-drawer); transform: translateX(100%); transition: transform 0.2s ease-out; display: flex; flex-direction: column; }
.cs-drawer.is-open { transform: translateX(0); }
.cs-drawer__header { display: flex; justify-content: space-between; align-items: center; padding: var(--cs-space-4); border-bottom: 1px solid var(--cs-border); }
.cs-drawer__title { font-size: var(--cs-font-lg); font-weight: 600; margin: 0; }
.cs-drawer__body { flex: 1; overflow-y: auto; padding: var(--cs-space-4); }
.cs-drawer__footer { padding: var(--cs-space-3) var(--cs-space-4); border-top: 1px solid var(--cs-border); display: flex; justify-content: flex-end; gap: var(--cs-space-2); }

/* ---------- Mobile breakpoint sweep (375px target) ---------- */
@media (max-width: 480px) {
  .cs-main { padding: 12px; }
  .cs-page__title { font-size: var(--cs-font-xl); }
  .cs-page__header { flex-direction: column; align-items: stretch; }
  .cs-page__actions { justify-content: stretch; }
  .cs-page__actions .cs-btn { flex: 1; text-align: center; }
  .cs-card { padding: 12px; }
  .cs-form-grid { grid-template-columns: 1fr; }
  .cs-filter-bar__row > * { min-width: 0; flex-basis: 100%; }
  .cs-detail__side { position: static; }
  .cs-tabs { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; }
  .cs-tabs__item, .cs-tabs a { white-space: nowrap; }
  .cs-kv { grid-template-columns: 1fr; }
}

/* ---------- Sticky save bar (partials/sticky-actions.ejs) ---------- */
.cs-sticky-actions { position: fixed; left: 232px; right: 0; bottom: 0; background: var(--cs-surface); border-top: 1px solid var(--cs-border); box-shadow: 0 -4px 12px rgba(0,0,0,0.08); z-index: var(--z-sticky); padding: 10px 24px; }
.cs-sticky-actions__inner { display: flex; justify-content: flex-end; gap: var(--cs-space-2); max-width: 1280px; margin: 0 auto; }
body.cs-sidebar-collapsed .cs-sticky-actions { left: 60px; }
@media (max-width: 768px) { .cs-sticky-actions { left: 0; padding: 10px 12px; } }

/* ---------- Keyboard shortcuts modal ---------- */
.cs-kbd-modal { position: fixed; inset: 0; z-index: var(--z-modal); display: none; align-items: center; justify-content: center; background: rgba(0,0,0,0.45); }
.cs-kbd-modal.is-open { display: flex; }
.cs-kbd-modal__box { background: white; border-radius: 10px; max-width: 480px; width: 92vw; padding: 20px 24px; box-shadow: var(--cs-shadow-lg); }
.cs-kbd-modal h2 { margin: 0 0 12px; font-size: 16px; }
.cs-kbd-modal table { width: 100%; border-collapse: collapse; }
.cs-kbd-modal td { padding: 6px 0; font-size: 13px; }
.cs-kbd-modal td:last-child { text-align: right; }
.cs-kbd-modal kbd { display: inline-block; padding: 2px 6px; background: #f6f6f7; border: 1px solid var(--cs-border); border-radius: 3px; font-family: ui-monospace, monospace; font-size: 11px; margin: 0 2px; }

/* ---------- Helpers: numeric / monospace / sr-only ---------- */
.cs-num, .cs-money { font-variant-numeric: tabular-nums; }
.cs-mono { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: 0.95em; }
.cs-sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.cs-stack { display: flex; flex-direction: column; gap: var(--cs-space-3); }
.cs-inline { display: flex; gap: var(--cs-space-2); align-items: center; flex-wrap: wrap; }
.cs-text-muted { color: var(--cs-text-muted); }
.cs-text-subdued { color: var(--cs-text-subdued); }
.cs-text-danger { color: var(--cs-danger); }
.cs-text-success { color: var(--cs-success); }

/* ---------- Toast auto-dismiss helper ---------- */
.cs-flash { transition: opacity 0.3s, transform 0.3s; }
.cs-flash.is-dismissing { opacity: 0; transform: translateY(-8px); }
.cs-flash--success { background: #e3f1df; color: #155724; }
.cs-flash--error   { background: #fde2e2; color: #8a1f1f; }
.cs-flash--warning { background: #fff4e5; color: #8a4b00; }
.cs-flash--info    { background: #e0e7ff; color: #1d3580; }

/* =========================================================================
   Restructured sidebar — clean Shopify-style nav (overrides legacy rules)
   ========================================================================= */
.cs-sidebar { width: 232px; background: var(--cs-side); color: var(--cs-side-fg); display: flex; flex-direction: column; transition: width 0.18s ease; position: sticky; top: 0; height: 100vh; overflow: hidden; flex-shrink: 0; }
.cs-sidebar.is-collapsed { width: 60px; }

.cs-sidebar__brand { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #2c2e30; gap: 8px; }
.cs-sidebar__brand-link { color: var(--cs-side-fg); text-decoration: none; display: flex; flex-direction: column; line-height: 1.15; flex: 1; min-width: 0; }
.cs-sidebar__brand-name { font-weight: 700; letter-spacing: 0.4px; font-size: 14px; }
.cs-sidebar__brand-sub { font-weight: 400; opacity: 0.55; font-size: 11px; text-transform: uppercase; letter-spacing: 0.6px; }
.cs-sidebar__collapse { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: transparent; border: 1px solid #2c2e30; border-radius: 4px; color: var(--cs-side-fg); cursor: pointer; font-size: 14px; line-height: 1; opacity: 0.7; }
.cs-sidebar__collapse:hover { opacity: 1; background: var(--cs-side-active); }
.cs-sidebar.is-collapsed .cs-sidebar__collapse { transform: rotate(180deg); }

.cs-sidebar__nav { display: flex; flex-direction: column; padding: 6px 0; flex: 1; overflow-y: auto; gap: 1px; }
.cs-sidebar__nav::-webkit-scrollbar { width: 6px; }
.cs-sidebar__nav::-webkit-scrollbar-thumb { background: #2c2e30; border-radius: 3px; }

/* Reset legacy "nav a" styling */
.cs-sidebar nav a { padding: 0; font-size: inherit; color: inherit; }

.cs-nav-item {
  display: flex; align-items: center; gap: 12px;
  padding: 9px 16px; font-size: 13.5px; line-height: 1.3;
  color: var(--cs-side-fg); text-decoration: none; cursor: pointer;
  border-left: 3px solid transparent;
  transition: background 0.12s, border-color 0.12s, color 0.12s;
  /* Konsistente Emoji-Darstellung über alle Plattformen */
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', Roboto, sans-serif;
}
.cs-nav-item:hover { background: var(--cs-side-active); color: #fff; }
.cs-nav-item.active { background: var(--cs-side-active); border-left-color: var(--cs-accent); color: #fff; font-weight: 500; }
.cs-nav-item.active-branch { color: #fff; }

.cs-nav-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; flex-shrink: 0; font-size: 16px; line-height: 1;
  font-family: 'Segoe UI Emoji', 'Apple Color Emoji', 'Noto Color Emoji', sans-serif;
}
.cs-nav-label { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* Mehr Atmungsraum zwischen Sektionen + klarere Optik */
.cs-nav-section {
  font-size: 10px; text-transform: uppercase; letter-spacing: 0.7px;
  color: rgba(255,255,255,0.45); padding: 14px 19px 6px; margin-top: 4px;
  font-weight: 600;
}
.cs-nav-section:first-of-type { margin-top: 0; }
/* Sub-items: dezenter, weniger Padding */
.cs-nav-sub a { padding: 6px 16px 6px 38px; font-size: 12.5px; color: rgba(255,255,255,0.75); }
.cs-nav-sub a:hover { background: rgba(255,255,255,0.06); color: #fff; }
.cs-nav-sub a.active { color: var(--cs-accent); font-weight: 500; }

.cs-nav-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 18px; padding: 0 6px; border-radius: 10px; background: var(--cs-accent); color: #fff; font-size: 11px; font-weight: 600; line-height: 1; }
.cs-nav-sub a .cs-nav-badge { background: #4a4d50; }

/* Collapsible groups */
.cs-nav-group { padding: 0; margin: 0; }
.cs-nav-group > summary { list-style: none; }
.cs-nav-group > summary::-webkit-details-marker { display: none; }
.cs-nav-group > summary::before { content: ''; }
.cs-nav-group > summary::after {
  content: '›'; margin-left: auto; opacity: 0.5; font-size: 14px; transition: transform 0.15s;
}
.cs-nav-group[open] > summary::after { transform: rotate(90deg); opacity: 0.85; }

.cs-nav-sub { display: flex; flex-direction: column; padding: 2px 0 6px; }
.cs-nav-sub a {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px 6px 49px !important;
  font-size: 13px !important; color: var(--cs-side-fg); opacity: 0.78;
  text-decoration: none; border-left: 3px solid transparent;
  transition: background 0.12s, opacity 0.12s, color 0.12s, border-color 0.12s;
}
.cs-nav-sub a:hover { background: var(--cs-side-active); opacity: 1; color: #fff; }
.cs-nav-sub a.active { background: var(--cs-side-active); opacity: 1; color: #fff; border-left-color: var(--cs-accent); font-weight: 500; }

/* User block stuck to bottom */
.cs-sidebar__user { margin-top: auto; border-top: 1px solid #2c2e30; padding: 4px 0; }
.cs-user-menu > summary { display: flex; align-items: center; gap: 10px; }
.cs-user-avatar { background: var(--cs-accent); color: #fff; border-radius: 50%; width: 24px; height: 24px; font-size: 12px; font-weight: 600; }
.cs-user-meta { display: block; padding: 6px 14px 4px 49px; font-size: 11px; color: var(--cs-side-fg); opacity: 0.55; }
.cs-user-disabled { opacity: 0.45 !important; cursor: not-allowed; }
.cs-user-logout { padding: 4px 14px 4px 49px; }
.cs-user-logout button { background: transparent; border: 1px solid #4a4d50; color: var(--cs-side-fg); padding: 4px 10px; border-radius: 4px; font-size: 12px; cursor: pointer; }
.cs-user-logout button:hover { background: var(--cs-side-active); color: #fff; border-color: var(--cs-accent); }

/* Hide legacy .cs-brand / .cs-user blocks when new ones are present */
.cs-sidebar > .cs-brand,
.cs-sidebar > .cs-user { display: none !important; }

/* Adjust main width to new sidebar */
.cs-main { max-width: calc(100vw - 232px); }

/* Collapsed (icon-only) state, desktop */
@media (min-width: 769px) {
  .cs-sidebar.is-collapsed .cs-nav-label,
  .cs-sidebar.is-collapsed .cs-sidebar__brand-name,
  .cs-sidebar.is-collapsed .cs-sidebar__brand-sub,
  .cs-sidebar.is-collapsed .cs-nav-group > summary::after,
  .cs-sidebar.is-collapsed .cs-nav-sub,
  .cs-sidebar.is-collapsed .cs-nav-badge { display: none !important; }
  .cs-sidebar.is-collapsed .cs-nav-item { justify-content: center; padding: 10px 0; }
  .cs-sidebar.is-collapsed .cs-sidebar__brand { justify-content: center; padding: 10px 6px; }
  body.cs-sidebar-collapsed .cs-main { max-width: calc(100vw - 60px); }
}

/* Mobile: hamburger-driven */
@media (max-width: 768px) {
  .cs-sidebar__nav, .cs-sidebar__user { display: none; }
  .cs-sidebar.is-open .cs-sidebar__nav,
  .cs-sidebar.is-open .cs-sidebar__user { display: flex; }
  .cs-sidebar__collapse { display: none; }
}

/* ===== B2C / B2B segment nav styling (added 022_b2c_b2b_split) ===== */
.cs-nav-section {
  text-transform: uppercase;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: #6d7175;
  padding: 16px 16px 6px;
  margin-top: 8px;
  border-top: 1px solid #e1e3e5;
}
.cs-nav-section--b2c { color: #1f9c4d; border-top-color: #c7ecd5; }
.cs-nav-section--b2b { color: #0070b8; border-top-color: #c4dff0; }

.cs-nav-item--b2c.cs-nav-item--active,
.cs-nav-item--b2c.active,
.cs-nav-item--b2c.active-branch {
  border-left: 3px solid #1f9c4d;
  background: #f0faf3;
}
.cs-nav-item--b2b.cs-nav-item--active,
.cs-nav-item--b2b.active,
.cs-nav-item--b2b.active-branch {
  border-left: 3px solid #0070b8;
  background: #eef6fb;
}

/* Segment badge headers used on per-segment pages */
.cs-seg-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  font-weight: 700;
  font-size: 13px;
  letter-spacing: 0.02em;
}
.cs-seg-badge--b2c { background: #e8f8ee; color: #1f9c4d; border: 1px solid #c7ecd5; }
.cs-seg-badge--b2b { background: #e6f1f8; color: #0070b8; border: 1px solid #c4dff0; }

.cs-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}
.cs-kpi {
  background: #fff;
  border: 1px solid #e1e3e5;
  border-radius: 8px;
  padding: 14px;
}
.cs-kpi__label { font-size: 11px; color: #6d7175; text-transform: uppercase; letter-spacing: .06em; }
.cs-kpi__value { font-size: 24px; font-weight: 700; margin-top: 4px; }
.cs-kpi--b2c { border-top: 3px solid #1f9c4d; }
.cs-kpi--b2b { border-top: 3px solid #0070b8; }
