/* ==========================================================================
   cotizaciones-cliente — modern customer extranet UI
   Inspired by Stripe/Linear/Mercury dashboards: generous whitespace,
   sidebar nav, status pills, soft shadows.
   ========================================================================== */

:root {
  --cc-bg:        #f7f8fb;
  --cc-card:      #ffffff;
  --cc-border:    #e5e7eb;
  --cc-border-2:  #eef0f3;
  --cc-text:      #0f172a;
  --cc-muted:     #64748b;
  --cc-muted-2:   #94a3b8;
  --cc-primary:   #1a3e6e;       /* keeps brand navy from the company app */
  --cc-primary-dk:#122c50;
  --cc-primary-lt:#eaf0fa;
  --cc-accent:    #c8a84b;
  --cc-success:   #047857;
  --cc-success-bg:#d1fae5;
  --cc-warning:   #b45309;
  --cc-warning-bg:#fef3c7;
  --cc-danger:    #b91c1c;
  --cc-danger-bg: #fee2e2;
  --cc-info:      #1e40af;
  --cc-info-bg:   #dbeafe;
  --cc-shadow-sm: 0 1px 2px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --cc-shadow-md: 0 4px 6px -1px rgba(15,23,42,.08), 0 2px 4px -2px rgba(15,23,42,.06);
  --cc-shadow-lg: 0 10px 15px -3px rgba(15,23,42,.1), 0 4px 6px -4px rgba(15,23,42,.05);
  --cc-radius:    12px;
  --cc-radius-sm: 8px;
}

html, body.cc-modal-body {
  margin: 0; padding: 0;
  background: var(--cc-bg);
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  color: var(--cc-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

* { box-sizing: border-box; }
a { color: var(--cc-primary); text-decoration: none; }
a:hover { text-decoration: underline; }

/* ============== AUTHENTICATED LAYOUT (sidebar + main) ============== */

.cc-layout {
  display: grid;
  grid-template-columns: 244px 1fr;
  min-height: 100vh;
}

.cc-sidebar {
  background: #fff;
  border-right: 1px solid var(--cc-border);
  display: flex;
  flex-direction: column;
  padding: 22px 14px 14px;
}

.cc-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 0 6px 22px;
  border-bottom: 1px solid var(--cc-border-2);
}
.cc-brand-logo { width: 38px; height: 38px; border-radius: 8px; background: #fff; }
.cc-brand-name { font-weight: 700; font-size: 1rem; color: var(--cc-text); letter-spacing: .2px; }
.cc-brand-tag  { font-size: .72rem; color: var(--cc-muted); letter-spacing: 1px; text-transform: uppercase; }

.cc-nav { display: flex; flex-direction: column; gap: 2px; padding-top: 12px; flex: 1; }
.cc-nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 10px;
  border-radius: var(--cc-radius-sm);
  color: var(--cc-muted);
  font-weight: 500;
  font-size: .9rem;
  transition: background .15s, color .15s;
}
.cc-nav-item:hover { background: var(--cc-primary-lt); color: var(--cc-primary); text-decoration: none; }
.cc-nav-item.active { background: var(--cc-primary); color: #fff; box-shadow: var(--cc-shadow-sm); }
.cc-nav-item svg { width: 18px; height: 18px; flex-shrink: 0; }
.cc-nav-sep {
  margin: 14px 6px 6px;
  font-size: .68rem; font-weight: 700; letter-spacing: 1px;
  text-transform: uppercase; color: var(--cc-muted-2);
  border-top: 1px solid var(--cc-border-2); padding-top: 12px;
}

.cc-sidebar-foot { padding-top: 14px; border-top: 1px solid var(--cc-border-2); }
.cc-user { display: flex; gap: 10px; align-items: center; padding: 6px; }
.cc-user-avatar {
  width: 32px; height: 32px; border-radius: 50%;
  background: linear-gradient(135deg, var(--cc-primary) 0%, #2a5298 100%);
  color: #fff; font-weight: 700; font-size: .85rem;
  display: flex; align-items: center; justify-content: center;
}
.cc-user-meta { min-width: 0; flex: 1; }
.cc-user-company {
  font-size: .82rem; font-weight: 700; color: var(--cc-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.2;
}
.cc-user-email {
  font-size: .7rem; font-weight: 400; color: var(--cc-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  line-height: 1.2; margin-top: 1px;
}
.cc-user-logout { font-size: .72rem; color: var(--cc-muted); }
.cc-user-logout:hover { color: var(--cc-danger); }
.cc-user-logout-icon { display: none; color: var(--cc-muted); }
.cc-user-logout-icon svg { width: 18px; height: 18px; }
.cc-user-logout-icon:hover { color: var(--cc-danger); }

.cc-main { background: var(--cc-bg); display: flex; flex-direction: column; min-width: 0; }
.cc-topbar {
  display: flex; align-items: center; gap: 14px;
  padding: 18px 30px;
  background: #fff;
  border-bottom: 1px solid var(--cc-border);
  position: sticky; top: 0; z-index: 10;
}
.cc-menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--cc-text);
}
.cc-menu-toggle svg { width: 24px; height: 24px; }
.cc-page-title { margin: 0; font-size: 1.15rem; font-weight: 600; color: var(--cc-text); }
.cc-content { padding: 28px 30px 60px; max-width: 980px; width: 100%; }

/* ============== PUBLIC (login/register) shell ============== */
.cc-public-shell { max-width: 480px; margin: 0 auto; padding: 32px 18px; }
.cc-public-header {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 12px 8px 24px;
  border-bottom: 1px solid var(--cc-border-2);
  margin-bottom: 28px;
  text-align: center;
}
.cc-public-logo { width: auto; max-width: 220px; height: auto; border-radius: 0; }
.cc-public-name { font-weight: 700; font-size: 1rem; color: var(--cc-text); line-height: 1.25; }
.cc-public-tag  { font-size: .82rem; color: var(--cc-muted); }
.cc-public-body {
  background: #fff; border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius); padding: 28px;
  box-shadow: var(--cc-shadow-md);
}
.cc-public-footer { text-align: center; padding-top: 22px; color: var(--cc-muted); }
.cc-public-footer a { color: var(--cc-primary); }

/* ============== TYPOGRAPHY HELPERS ============== */
.cc-content h1, .cc-content h2 { font-weight: 700; color: var(--cc-text); margin: 0 0 6px; }
.cc-content h2 { font-size: 1.4rem; }
.cc-content h3 { font-size: 1.05rem; font-weight: 600; color: var(--cc-text); margin: 18px 0 10px; }
.cc-content > p { color: var(--cc-muted); margin: 4px 0 22px; line-height: 1.5; }
.cc-public-body h2 { margin: 0 0 8px; font-size: 1.4rem; color: var(--cc-text); font-weight: 700; }
.cc-public-body p  { color: var(--cc-muted); margin: 0 0 18px; line-height: 1.5; font-size: .9rem; }

/* ============== FORMS ============== */
.cc-form .form-group { margin-bottom: 14px; }
.cc-form .form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.cc-form label { display: block; font-size: .8rem; font-weight: 600; color: var(--cc-text); margin-bottom: 5px; }
.cc-form .help { font-size: .75rem; color: var(--cc-muted); margin-top: 4px; }
.cc-form .actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: 18px; padding-top: 16px; border-top: 1px solid var(--cc-border-2); flex-wrap: wrap; }

.form-control {
  width: 100%; padding: 9px 12px;
  border: 1px solid var(--cc-border); border-radius: var(--cc-radius-sm);
  font-size: .9rem; font-family: inherit; background: #fff;
  color: var(--cc-text);
  transition: border-color .15s, box-shadow .15s;
}
.form-control:focus {
  outline: none; border-color: var(--cc-primary);
  box-shadow: 0 0 0 3px rgba(26,62,110,.12);
}
.form-control[readonly] { background: #f8f9fa; color: var(--cc-muted); }

.code-input {
  font-family: 'JetBrains Mono', 'Courier New', monospace;
  font-size: 1.6rem; letter-spacing: 12px;
  text-align: center; width: 240px; padding: 10px 12px;
  font-weight: 600;
}

/* RUT input with live validation status */
input.rut-ok  { border-color: var(--cc-success) !important; box-shadow: 0 0 0 3px rgba(4,120,87,.10) !important; }
input.rut-bad { border-color: var(--cc-danger)  !important; box-shadow: 0 0 0 3px rgba(185,28,28,.10) !important; }
.rut-status { font-size: .76rem; margin-top: 4px; min-height: 1em; font-weight: 500; }
.rut-status.ok  { color: var(--cc-success); }
.rut-status.bad { color: var(--cc-danger);  }

/* ============== BUTTONS ============== */
.btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 9px 18px;
  border: 1px solid transparent; border-radius: var(--cc-radius-sm);
  background: #fff; color: var(--cc-text);
  font: 500 .88rem 'Inter', sans-serif; cursor: pointer;
  transition: all .15s; text-decoration: none;
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--cc-primary); color: #fff; border-color: var(--cc-primary); box-shadow: var(--cc-shadow-sm); }
.btn-primary:hover { background: var(--cc-primary-dk); color: #fff; box-shadow: var(--cc-shadow-md); }
.btn-outline { background: #fff; border-color: var(--cc-border); color: var(--cc-text); }
.btn-outline:hover { border-color: var(--cc-primary); color: var(--cc-primary); }
.btn-ghost { background: transparent; color: var(--cc-muted); border: none; padding: 6px 10px; }
.btn-ghost:hover { color: var(--cc-text); background: var(--cc-border-2); }
.btn-danger-soft { background: var(--cc-danger-bg); color: var(--cc-danger); }
.btn-sm { padding: 5px 12px; font-size: .78rem; }
.btn[disabled], .btn-disabled { opacity: .5; cursor: not-allowed; }

/* ============== CARDS / EMPTY STATES ============== */
.cc-card {
  background: var(--cc-card); border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius); padding: 18px 20px;
  box-shadow: var(--cc-shadow-sm);
  margin-bottom: 14px;
}
.cc-card-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.cc-card .cc-card-title { font-weight: 600; color: var(--cc-text); }
.cc-card .cc-card-meta { color: var(--cc-muted); font-size: .82rem; margin-top: 4px; }

.cc-empty {
  text-align: center; padding: 60px 20px;
  background: #fff; border: 1px dashed var(--cc-border);
  border-radius: var(--cc-radius); color: var(--cc-muted);
}
.cc-empty-icon { width: 56px; height: 56px; margin: 0 auto 12px; opacity: .4; }
.cc-empty h3 { margin: 0 0 6px; color: var(--cc-text); font-weight: 600; }
.cc-empty p  { margin: 0 0 16px; }

/* ============== STATUS PILLS ============== */
.cc-pill {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 3px 10px; border-radius: 999px;
  font-size: .72rem; font-weight: 600; letter-spacing: .2px;
  text-transform: uppercase;
}
.cc-pill::before { content: ''; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.cc-pill.pending    { background: var(--cc-warning-bg); color: var(--cc-warning); }
.cc-pill.procesando { background: var(--cc-success-bg); color: var(--cc-success); }
.cc-pill.emitida    { background: #cce5ff; color: #004085; }   /* matches .badge-sent in cotizaciones/quote_list.php */
.cc-pill.imported   { background: var(--cc-success-bg); color: var(--cc-success); }   /* legacy fallback */
.cc-pill.discarded  { background: #f1f5f9; color: var(--cc-muted); }

/* ============== ALERTS ============== */
.alert { padding: 11px 14px; border-radius: var(--cc-radius-sm); margin-bottom: 14px; font-size: .87rem; border: 1px solid transparent; }
.alert-success { background: var(--cc-success-bg); color: var(--cc-success); border-color: rgba(4,120,87,.15); }
.alert-danger  { background: var(--cc-danger-bg);  color: var(--cc-danger);  border-color: rgba(185,28,28,.15); }
.alert-info    { background: var(--cc-info-bg);    color: var(--cc-info);    border-color: rgba(30,64,175,.15); }
.alert-warning { background: var(--cc-warning-bg); color: var(--cc-warning); border-color: rgba(180,83,9,.15); }

/* ============== PROFILE CARDS ============== */
.profile-card {
  background: #fff; border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius); padding: 16px 18px;
  margin-bottom: 12px; box-shadow: var(--cc-shadow-sm);
}
.profile-card .pc-head { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; }
.profile-card .pc-rut  { font-weight: 700; color: var(--cc-primary); font-family: 'JetBrains Mono', monospace; }
.profile-card .pc-name { font-size: .98rem; font-weight: 500; }
.profile-card .pc-meta { color: var(--cc-muted); font-size: .82rem; margin-top: 6px; line-height: 1.5; }

/* ============== QUOTE ITEMS TABLE ============== */
.cc-items {
  width: 100%; border-collapse: separate; border-spacing: 0;
  background: #fff; border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius); overflow: hidden;
}
.cc-items th {
  background: #f8fafc; color: var(--cc-muted);
  padding: 10px 12px; font-size: .72rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .4px; text-align: center;
  border-bottom: 1px solid var(--cc-border);
}
.cc-items td { padding: 8px 12px; border-bottom: 1px solid var(--cc-border-2); vertical-align: middle; }
.cc-items tr:last-child td { border-bottom: none; }
.cc-items input[type=text],
.cc-items input[type=number] {
  width: 100%; padding: 6px 8px;
  border: 1px solid transparent; border-radius: 5px; font-size: .88rem;
  background: transparent; transition: border-color .15s, background .15s;
}
.cc-items input:focus { outline: none; border-color: var(--cc-primary); background: #fff; }
.cc-items td.col-qty { width: 90px; }
.cc-items td.col-qty input { text-align: right; }
.cc-items td.col-sku, .cc-items th.col-sku { width: 90px; }     /* ~8 monospace chars */
.cc-items td.col-sku input.sku { font-family: 'JetBrains Mono', monospace; text-align: center; padding: 6px 4px; }
.cc-items td.col-price { width: 110px; text-align: right; font-family: 'JetBrains Mono', monospace; color: var(--cc-muted); font-size: .85rem; }
.cc-items td.col-total, .cc-items th.col-total {
  width: 120px; text-align: right;
  font-family: 'JetBrains Mono', monospace; color: var(--cc-text);
  font-weight: 700; font-size: .9rem;
}
.cc-items td.col-del { width: 36px; text-align: center; }
.cc-items td.col-del button { background: none; border: none; cursor: pointer; color: var(--cc-muted-2); font-size: 1.1rem; padding: 4px 6px; border-radius: 4px; }
.cc-items td.col-del button:hover { background: var(--cc-danger-bg); color: var(--cc-danger); }

/* ============== AUTOCOMPLETE / PRODUCT RESULTS ============== */
.cc-results {
  background: #fff; border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius-sm); margin-top: 8px;
  max-height: 280px; overflow-y: auto;
  box-shadow: var(--cc-shadow-md);
}
.cc-result {
  display: flex; align-items: center; gap: 10px;
  padding: 9px 12px; cursor: pointer;
  border-bottom: 1px solid var(--cc-border-2);
  transition: background .15s;
}
.cc-result:last-child { border-bottom: none; }
.cc-result:hover { background: var(--cc-primary-lt); }
.cc-result-img { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; background: #f1f5f9; }
.cc-result-sku { font-family: 'JetBrains Mono', monospace; font-weight: 600; color: var(--cc-primary); font-size: .78rem; min-width: 80px; }
.cc-result-name {
  flex: 1; min-width: 0;       /* allow shrink below content size */
  font-size: .88rem; color: var(--cc-text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.cc-result-price { font-family: 'JetBrains Mono', monospace; color: var(--cc-success); font-weight: 600; font-size: .85rem; }

/* ============== SPINNER ============== */
.cc-spinner {
  width: 16px; height: 16px; border: 2px solid var(--cc-border);
  border-top-color: var(--cc-primary); border-radius: 50%;
  display: inline-block; animation: cc-spin .8s linear infinite;
  vertical-align: middle;
}
@keyframes cc-spin { to { transform: rotate(360deg); } }

/* ============== CONFIRMATION PAGE ============== */
.cc-confirm {
  max-width: 620px; margin: 0 auto;
  background: #fff; border: 1px solid var(--cc-border);
  border-radius: var(--cc-radius); padding: 36px 32px;
  box-shadow: var(--cc-shadow-md); text-align: center;
}
.cc-confirm-logo { max-width: 200px; height: auto; margin: 0 auto 18px; display: block; }
.cc-confirm-icon { width: 72px; height: 72px; margin: 0 auto 14px; color: var(--cc-success); }
.cc-confirm-icon svg { width: 100%; height: 100%; }
.cc-confirm h2 { color: var(--cc-text); font-weight: 700; font-size: 1.6rem; margin: 0 0 8px; }
.cc-confirm .cc-confirm-lead { color: var(--cc-muted); font-size: .95rem; line-height: 1.55; max-width: 460px; margin: 0 auto 26px; }
.cc-confirm-meta {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 18px;
  background: #f8fafc; border-radius: var(--cc-radius-sm);
  padding: 16px 18px; text-align: left; margin-bottom: 22px;
  border: 1px solid var(--cc-border-2);
}
.cc-confirm-meta > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cc-confirm-meta span { font-size: .68rem; color: var(--cc-muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 600; }
.cc-confirm-meta strong { font-size: .92rem; color: var(--cc-text); font-weight: 600; overflow: hidden; text-overflow: ellipsis; }
.cc-confirm-disclaimer {
  background: var(--cc-warning-bg); color: #6b3e07;
  border: 1px solid rgba(180,83,9,.18); border-left: 4px solid var(--cc-warning);
  border-radius: var(--cc-radius-sm); padding: 14px 16px;
  text-align: left; font-size: .85rem; line-height: 1.55; margin-bottom: 22px;
}
.cc-confirm-disclaimer strong { color: var(--cc-warning); }
.cc-confirm-disclaimer em { font-style: italic; color: #6b3e07; }
.cc-confirm-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* ============== RESPONSIVE ============== */
@media (max-width: 760px) {
  /* Always-visible icon-only sidebar (no hamburger drawer) */
  .cc-layout { grid-template-columns: 64px 1fr; }
  .cc-sidebar {
    width: 64px; padding: 14px 4px;
    position: sticky; top: 0; align-self: stretch;
    height: 100vh; overflow-y: auto;
  }
  /* Brand: just the logo, centered, no text */
  .cc-brand { padding: 0 0 14px; justify-content: center; gap: 0; }
  .cc-brand-text { display: none; }
  .cc-brand-logo { width: 32px; height: 32px; }
  /* Nav: icon-only, centered */
  .cc-nav { padding-top: 6px; gap: 4px; }
  .cc-nav-item { justify-content: center; padding: 12px 0; }
  .cc-nav-item span { display: none; }
  .cc-nav-item svg { width: 22px; height: 22px; }
  .cc-nav-sep {
    margin: 8px 4px 4px; padding-top: 8px;
    text-align: center; font-size: .56rem; letter-spacing: .5px;
  }
  /* Footer: avatar + logout icon stacked */
  .cc-sidebar-foot { padding-top: 10px; }
  .cc-user { flex-direction: column; align-items: center; gap: 8px; padding: 4px 0; }
  .cc-user-meta { display: none; }
  .cc-user-logout-icon { display: inline-flex; padding: 6px; border-radius: 6px; }

  /* Hide the (now redundant) hamburger toggle */
  .cc-menu-toggle { display: none; }

  .cc-topbar { padding: 12px 14px; }
  .cc-page-title { font-size: 1rem; }
  .cc-content { padding: 16px 14px 40px; max-width: 100%; }
  .cc-content > h2 { font-size: 1.2rem; }
  .cc-content > p  { font-size: .88rem; }
  .cc-form .form-row { grid-template-columns: 1fr; gap: 0; }
  .cc-form .actions { flex-direction: column-reverse; align-items: stretch; }
  .cc-form .actions > .btn { width: 100%; text-align: center; justify-content: center; }
  .cc-form .actions > a { text-align: center; padding: 6px 0; }
  .form-control { font-size: 16px; }    /* prevents iOS Safari auto-zoom on focus */
  .btn { padding: 11px 18px; }          /* slightly larger touch target */

  /* Public shell — register/login/etc. */
  .cc-public-shell { padding: 18px 12px; }
  .cc-public-body { padding: 20px 16px; }
  .cc-public-name { font-size: .92rem; }

  /* Product autocomplete dropdown */
  .cc-result { padding: 10px 10px; gap: 8px; }
  .cc-result-img { width: 32px; height: 32px; flex-shrink: 0; }
  .cc-result-sku { min-width: 60px; font-size: .72rem; }
  .cc-result-price { font-size: .78rem; white-space: nowrap; }

  /* Items table — convert each row to a stacked card so 5 columns don't squeeze on phones */
  #items-table, .cc-items { font-size: .9rem; border: none; box-shadow: none; background: transparent; }
  .cc-items thead { display: none; }
  .cc-items, .cc-items tbody { display: block; }
  .cc-items tr {
    display: grid;
    grid-template-areas:
      "name  name  del"
      "sku   sku   sku"
      "qty   qty   price"
      "total total total";
    grid-template-columns: auto 1fr auto;
    gap: 6px 10px;
    border: 1px solid var(--cc-border);
    border-radius: var(--cc-radius-sm);
    padding: 12px 14px;
    margin-bottom: 10px;
    background: #fff;
    box-shadow: var(--cc-shadow-sm);
  }
  .cc-items tr#items-empty {
    display: block; text-align: center;
    border: 1px dashed var(--cc-border); background: transparent; box-shadow: none;
  }
  .cc-items tr#items-empty td { display: block; padding: 0; border: none; }

  .cc-items td { display: block; border: none; padding: 0; width: auto; text-align: left; }
  .cc-items tr td:nth-child(2) { grid-area: sku; }      /* SKU input cell */
  .cc-items tr td:nth-child(3) { grid-area: name; }     /* Name input cell */
  .cc-items td.col-qty   { grid-area: qty; display: flex; align-items: center; gap: 6px; }
  .cc-items td.col-price { grid-area: price; text-align: right; align-self: center; }
  .cc-items td.col-total {
    grid-area: total; text-align: right;
    border-top: 1px dashed var(--cc-border-2); padding-top: 8px;
    width: auto;     /* override desktop fixed width */
  }
  .cc-items td.col-total::before {
    content: "Total IVA Inc:"; font-size: .76rem; color: var(--cc-muted);
    font-weight: 500; font-family: 'Inter', sans-serif; margin-right: 8px;
  }
  .cc-items td.col-total .line-total { font-family: 'JetBrains Mono', monospace; font-weight: 700; color: var(--cc-text); font-size: 1rem; }
  .cc-items td.col-del   { grid-area: del; text-align: right; }

  /* Render the readonly SKU/Name as plain text (no input chrome on mobile) */
  .cc-items input[readonly] {
    background: transparent; border: none; padding: 0; cursor: default;
  }
  .cc-items tr td:nth-child(2) input.sku {
    font-family: 'JetBrains Mono', monospace; font-size: .78rem;
    color: var(--cc-primary); font-weight: 600;
  }
  .cc-items tr td:nth-child(3) input.name {
    font-size: .95rem; color: var(--cc-text); font-weight: 600;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* "Cant.:" label before qty input */
  .cc-items td.col-qty::before {
    content: "Cant.:"; font-size: .76rem; color: var(--cc-muted); font-weight: 500;
  }
  .cc-items td.col-qty input { width: 70px; padding: 6px 8px; border: 1px solid var(--cc-border); border-radius: 5px; text-align: center; }
  /* "Precio:" label before price */
  .cc-items td.col-price::before {
    content: "Precio:"; font-size: .76rem; color: var(--cc-muted);
    font-weight: 500; margin-right: 6px;
  }
  .cc-items td.col-price .price {
    font-family: 'JetBrains Mono', monospace; font-size: .92rem;
    color: var(--cc-muted); font-weight: 600;
  }
  /* Override desktop fixed widths in mobile cards */
  .cc-items td.col-sku { width: auto; }
  /* Wider tap target for delete */
  .cc-items td.col-del button {
    width: 36px; height: 36px; border-radius: 6px; font-size: 1.3rem;
    background: var(--cc-danger-bg); color: var(--cc-danger);
  }
  .cc-items td.col-del button:hover { background: var(--cc-danger); color: #fff; }

  /* Confirmation page meta grid → single column */
  .cc-confirm { padding: 24px 18px; }
  .cc-confirm-meta { grid-template-columns: 1fr; gap: 8px 0; padding: 12px 14px; }

  /* Profile cards: tighter */
  .profile-card { padding: 12px 14px; }
  .profile-card .pc-head { flex-direction: column; align-items: flex-start; gap: 6px; }
  .profile-card .pc-meta { font-size: .78rem; }

  /* Stats tiles on my_quotes */
  .cc-card { padding: 14px 16px; }
  .cc-card-row { flex-direction: column; align-items: stretch; gap: 10px; }
  .cc-card-row > div:last-child { justify-content: flex-start; }

  /* Code input shouldn't be wider than viewport */
  .code-input { width: 100%; max-width: 240px; font-size: 1.4rem; letter-spacing: 8px; }

  /* Admin tables — allow horizontal scroll instead of overflowing */
  .cc-content table.cc-items { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* My quotes stat tiles — single column on phones */
  .cc-content > div[style*="grid-template-columns:repeat(auto-fit"] {
    grid-template-columns: repeat(3, 1fr) !important;
    gap: 8px !important;
  }
}

/* Extra-small phones (≤380px) — tighten further so no horizontal scroll */
@media (max-width: 380px) {
  .cc-layout { grid-template-columns: 56px 1fr; }
  .cc-sidebar { width: 56px; }
  .cc-nav-item svg { width: 20px; height: 20px; }
  .cc-content { padding: 14px 10px 36px; }
  .cc-public-shell { padding: 12px 8px; }
  .cc-public-body  { padding: 16px 12px; }
  .cc-result-img { display: none; }       /* drop product thumbnail to free width */
  .cc-result-sku { min-width: 0; }
  .cc-form label { font-size: .78rem; }
  .code-input    { font-size: 1.2rem; letter-spacing: 6px; }
}
