/* ============================================================
   assets/css/app.css  —  InvoiceLix shared component styles
   Builds on tokens.css design variables.
   ============================================================ */

/* ── RESET & BASE ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
  font-family: var(--ff-body);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  line-height: 1.6;
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }

/* ── GRAIN OVERLAY ── */
body::before {
  content: '';
  position: fixed; inset: 0; z-index: 0; pointer-events: none;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.035'/%3E%3C/svg%3E");
  opacity: 0.4;
}

/* ── LAYOUT ── */
.wrap { width: min(calc(100% - 2.5rem), 1320px); margin: 0 auto; }
.container { width: min(calc(100% - 2.5rem), 820px); margin: 0 auto; }

/* ── NAVBAR ── */
.navbar {
  position: sticky; top: 0; z-index: 50;
  background: rgba(30,42,56,0.97);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(181,154,106,0.15);
  box-shadow: 0 1px 0 rgba(0,0,0,0.2), var(--sh-sm);
}
.navbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1.5rem; height: 72px;
}
.brand { display: inline-flex; align-items: center; gap: 0.85rem; }
.brand-mark {
  width: 40px; height: 40px; border-radius: 12px;
  background: linear-gradient(140deg, var(--accent-lt) 0%, var(--accent) 60%, var(--accent-dk) 100%);
  display: grid; place-items: center;
  font-family: var(--ff-head); font-weight: 800; font-size: 0.9rem;
  color: var(--primary); letter-spacing: -0.04em;
  box-shadow: 0 4px 16px rgba(181,154,106,0.35); flex-shrink: 0;
}
.brand-name { font-family: var(--ff-head); font-weight: 800; font-size: 1.15rem; color: #fff; letter-spacing: -0.03em; }
.brand-sub  { font-size: 0.72rem; color: rgba(255,255,255,0.38); letter-spacing: 0.04em; margin-top: 1px; }
.nav-actions { display: flex; align-items: center; gap: 0.75rem; }
.nav-pill {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.45rem 0.9rem; border-radius: 999px;
  border: 1px solid rgba(181,154,106,0.3);
  background: rgba(181,154,106,0.08);
  color: rgba(255,255,255,0.6);
  font-size: 0.78rem; font-weight: 600; font-family: var(--ff-head);
}
.nav-pill-dot { width: 6px; height: 6px; border-radius: 50%; background: #6fcf97; box-shadow: 0 0 6px #6fcf97; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  border: none; border-radius: var(--r-sm);
  padding: 0.72rem 1.3rem;
  font-family: var(--ff-head); font-size: 0.875rem; font-weight: 700;
  cursor: pointer; white-space: nowrap;
  transition: transform 0.18s, box-shadow 0.18s, background 0.18s, opacity 0.18s;
}
.btn:active { transform: scale(0.98); }
.btn-gold {
  background: linear-gradient(135deg, var(--accent-lt) 0%, var(--accent) 50%, var(--accent-dk) 100%);
  color: var(--primary);
  box-shadow: 0 4px 20px rgba(181,154,106,0.38), inset 0 1px 0 rgba(255,255,255,0.2);
}
.btn-gold:hover { transform: translateY(-1px); box-shadow: 0 8px 28px rgba(181,154,106,0.45); }
.btn-outline-light {
  background: transparent; color: rgba(255,255,255,0.82);
  border: 1px solid rgba(255,255,255,0.18);
}
.btn-outline-light:hover { background: rgba(255,255,255,0.07); color: #fff; }
.btn-ghost-light {
  background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.6);
  border: 1px solid rgba(255,255,255,0.12);
}
.btn-ghost {
  background: rgba(30,42,56,0.05); border: 1px solid var(--border-lt); color: var(--text-mid);
}
.btn-ghost:hover { background: rgba(30,42,56,0.09); border-color: var(--border); }
.btn-ghost-danger {
  background: rgba(176,40,40,0.05); border: 1px solid rgba(176,40,40,0.15); color: var(--danger);
}
.btn-ghost-danger:hover { background: rgba(176,40,40,0.1); }
.btn-primary-dark { background: var(--primary); color: #fff; box-shadow: var(--sh-sm); }
.btn-primary-dark:hover { background: var(--primary-mid); transform: translateY(-1px); box-shadow: var(--sh-md); }
.btn-success { background: var(--success); color: #fff; }
.btn-sm  { padding: 0.5rem 1rem; font-size: 0.8rem; border-radius: 8px; }
.btn-xs  { padding: 0.38rem 0.75rem; font-size: 0.75rem; border-radius: 7px; }
.btn-lg  { padding: 0.9rem 2rem; font-size: 1rem; }
.btn-block { width: 100%; }
.btn-icon {
  width: 38px; height: 38px; padding: 0; border-radius: 9px;
  background: rgba(30,42,56,0.05); border: 1px solid var(--border-lt);
  color: var(--text-muted); font-size: 1.1rem;
}
.btn-icon:hover { background: rgba(176,40,40,0.08); border-color: rgba(176,40,40,0.2); color: var(--danger); }

/* ── FORMS ── */
.form-grid { display: grid; gap: 1rem; }
.row-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.row-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.field { display: grid; gap: 0.4rem; }
.field label {
  font-family: var(--ff-head); font-size: 0.72rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em;
}
.field input,
.field select,
.field textarea {
  width: 100%; background: var(--surface-2); border: 1.5px solid var(--border-lt);
  border-radius: var(--r-sm); padding: 0.72rem 0.9rem; color: var(--text);
  transition: border-color 0.15s, box-shadow 0.15s, background 0.15s;
}
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--border); }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; background: var(--surface);
  border-color: var(--accent); box-shadow: 0 0 0 3px rgba(181,154,106,0.15);
}
.field textarea { min-height: 110px; resize: vertical; line-height: 1.65; }
.field-note { font-size: 0.78rem; color: var(--text-muted); line-height: 1.6; }

/* ── PANELS ── */
.panel { background: var(--surface); border: 1px solid var(--border-lt); border-radius: var(--r); box-shadow: var(--sh-xs); overflow: hidden; }
.panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  padding: 1rem 1.25rem;
  background: linear-gradient(180deg, var(--surface-2) 0%, rgba(255,255,255,0) 100%);
  border-bottom: 1px solid var(--border-lt);
}
.panel-title-row { display: flex; align-items: center; gap: 0.8rem; }
.panel-badge {
  width: 32px; height: 32px; border-radius: 9px; flex-shrink: 0;
  background: var(--primary); color: var(--accent-lt);
  display: grid; place-items: center;
  font-family: var(--ff-head); font-weight: 800; font-size: 0.75rem;
}
.panel-title { font-family: var(--ff-head); font-size: 0.95rem; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.panel-sub   { font-size: 0.78rem; color: var(--text-muted); margin-top: 0.15rem; }
.panel-body  { padding: 1.25rem; }

/* ── SECTION LABELS ── */
.section-label {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.35rem 0.85rem; border-radius: 999px;
  background: rgba(181,154,106,0.12); border: 1px solid rgba(181,154,106,0.25);
  color: var(--accent-dk); font-size: 0.72rem; font-weight: 800;
  font-family: var(--ff-head); letter-spacing: 0.07em; text-transform: uppercase;
  margin-bottom: 0.85rem;
}
.section-title {
  font-family: var(--ff-head); font-weight: 800;
  font-size: clamp(1.65rem, 3vw, 2.4rem);
  letter-spacing: -0.035em; line-height: 1.1; color: var(--primary);
  margin-bottom: 0.6rem;
}
.section-lead { color: var(--text-muted); font-size: 0.98rem; line-height: 1.8; max-width: 60ch; font-weight: 300; }
.stack { display: grid; gap: 1.1rem; }

/* ── DASHBOARD LAYOUT ── */
.dash-wrap { display: flex; min-height: 100vh; }
.sidebar {
  width: 240px; flex-shrink: 0;
  background: var(--primary);
  border-right: 1px solid rgba(181,154,106,0.1);
  display: flex; flex-direction: column;
  position: sticky; top: 72px; height: calc(100vh - 72px); overflow-y: auto;
}
.sidebar-logo { padding: 1.25rem 1.25rem 0.75rem; }
.sidebar-logo-text { font-family: var(--ff-head); font-size: 0.8rem; font-weight: 700; color: rgba(255,255,255,0.35); letter-spacing: 0.08em; text-transform: uppercase; }
.sidebar-user { padding: 0.75rem 1.25rem 1rem; border-bottom: 1px solid rgba(255,255,255,0.07); }
.sidebar-user-name  { font-family: var(--ff-head); font-weight: 700; font-size: 0.9rem; color: #fff; }
.sidebar-user-email { font-size: 0.75rem; color: rgba(255,255,255,0.4); margin-top: 0.1rem; }
.sidebar-nav { flex: 1; padding: 0.75rem 0.75rem; display: flex; flex-direction: column; gap: 0.2rem; }
.sidebar-section-label { padding: 0.6rem 0.75rem 0.3rem; font-size: 0.63rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: rgba(255,255,255,0.25); }
.sidebar-item {
  display: flex; align-items: center; gap: 0.65rem; padding: 0.6rem 0.75rem;
  border-radius: 9px; font-size: 0.875rem; font-weight: 600;
  color: rgba(255,255,255,0.55); cursor: pointer; transition: all 0.15s;
  text-decoration: none;
}
.sidebar-item:hover { background: rgba(255,255,255,0.06); color: rgba(255,255,255,0.85); }
.sidebar-item.active { background: rgba(181,154,106,0.15); color: var(--accent-lt); }
.sidebar-item-icon { font-size: 1rem; width: 20px; text-align: center; }
.dash-main { flex: 1; min-height: calc(100vh - 72px); background: var(--bg); }
.dash-header {
  padding: 1.75rem 2.25rem 1.25rem;
  background: var(--surface); border-bottom: 1px solid var(--border-lt);
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
}
.dash-title { font-family: var(--ff-head); font-size: 1.4rem; font-weight: 800; color: var(--primary); letter-spacing: -0.03em; }
.dash-sub   { font-size: 0.85rem; color: var(--text-muted); margin-top: 0.2rem; }
.dash-content { padding: 2rem 2.25rem; }

/* ── STAT CARDS ── */
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; margin-bottom: 2rem; }
.stat-card { background: var(--surface); border: 1px solid var(--border-lt); border-radius: var(--r); padding: 1.25rem; box-shadow: var(--sh-xs); }
.stat-label { font-family: var(--ff-head); font-size: 0.7rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em; margin-bottom: 0.5rem; }
.stat-value { font-family: var(--ff-head); font-size: 1.55rem; font-weight: 800; color: var(--primary); letter-spacing: -0.03em; }
.stat-sub   { font-size: 0.75rem; color: var(--text-muted); margin-top: 0.25rem; }

/* ── INVOICE TABLE ── */
.inv-table-wrap { background: var(--surface); border: 1px solid var(--border-lt); border-radius: var(--r); overflow: hidden; box-shadow: var(--sh-xs); }
.inv-list-table { width: 100%; border-collapse: collapse; }
.inv-list-table th {
  text-align: left; font-family: var(--ff-head); font-size: 0.68rem; font-weight: 700;
  color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.07em;
  padding: 0.85rem 1rem; border-bottom: 1.5px solid var(--border-lt);
  background: var(--surface-2);
}
.inv-list-table td { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border-lt); font-size: 0.875rem; vertical-align: middle; }
.inv-list-table tr:last-child td { border-bottom: none; }
.inv-list-table tr:hover td { background: var(--surface-2); }
.status-badge {
  display: inline-flex; align-items: center; gap: 0.35rem;
  padding: 0.25rem 0.7rem; border-radius: 999px;
  font-family: var(--ff-head); font-size: 0.72rem; font-weight: 700;
}
.status-paid    { background: #e8f5ec; color: var(--success); }
.status-pending { background: #fef9e7; color: var(--warning); }
.status-draft   { background: var(--surface-2); color: var(--text-muted); }
.status-overdue { background: #fce8e8; color: var(--danger); }

/* ── ALERTS ── */
.alert { padding: 0.75rem 1rem; border-radius: var(--r-sm); font-size: 0.875rem; margin-bottom: 1rem; }
.alert-success { background: #e8f5ec; color: var(--success); border: 1px solid #b7e2c4; }
.alert-error   { background: #fce8e8; color: var(--danger);  border: 1px solid #f5c2c2; }
.alert-info    { background: rgba(181,154,106,0.1); color: var(--accent-dk); border: 1px solid rgba(181,154,106,0.25); }

/* ── EMPTY STATE ── */
.empty-state { text-align: center; padding: 4rem 2rem; color: var(--text-muted); }
.empty-state-icon  { font-size: 2.5rem; margin-bottom: 1rem; }
.empty-state-title { font-family: var(--ff-head); font-size: 1.1rem; color: var(--text); margin-bottom: 0.5rem; font-weight: 800; }
.empty-state-sub   { font-size: 0.875rem; margin-bottom: 1.5rem; }

/* ── AUTH PAGES ── */
.auth-wrap { min-height: 100vh; display: grid; grid-template-columns: 1fr 1fr; }
.auth-left {
  background: linear-gradient(160deg, var(--primary) 0%, var(--primary-mid) 55%, var(--primary-lt) 100%);
  display: flex; flex-direction: column; justify-content: center; padding: 4rem;
}
.auth-left-title { font-family: var(--ff-head); font-size: 2rem; font-weight: 800; color: #fff; line-height: 1.15; margin-bottom: 1rem; letter-spacing: -0.04em; }
.auth-left-sub   { color: rgba(255,255,255,0.55); font-size: 0.95rem; line-height: 1.8; margin-bottom: 2rem; font-weight: 300; }
.auth-points { list-style: none; display: flex; flex-direction: column; gap: 0.65rem; }
.auth-points li { display: flex; align-items: center; gap: 0.75rem; color: rgba(255,255,255,0.7); font-size: 0.9rem; }
.auth-points li::before {
  content: '✓'; background: rgba(181,154,106,0.2); border-radius: 50%;
  width: 22px; height: 22px; display: grid; place-items: center;
  font-size: 0.7rem; flex-shrink: 0; color: var(--accent-lt);
}
.auth-right { display: flex; align-items: center; justify-content: center; padding: 3rem 2rem; }
.auth-box { width: 100%; max-width: 440px; }
.auth-box-title { font-family: var(--ff-head); font-size: 1.75rem; font-weight: 800; margin-bottom: 0.3rem; color: var(--primary); letter-spacing: -0.04em; }
.auth-box-sub   { color: var(--text-muted); font-size: 0.9rem; margin-bottom: 2rem; }
.auth-switch { text-align: center; font-size: 0.875rem; color: var(--text-muted); margin-top: 1.25rem; }
.auth-switch a { color: var(--accent-dk); font-weight: 700; }

/* ── LOGO UPLOAD ── */
.logo-upload {
  border: 2px dashed var(--border); border-radius: var(--r-sm); background: var(--surface-2);
  padding: 1.5rem; text-align: center; cursor: pointer;
  transition: border-color 0.15s, background 0.15s;
}
.logo-upload:hover { border-color: var(--accent); background: rgba(181,154,106,0.04); }
.logo-upload input { display: none; }
.logo-thumb { max-height: 70px; max-width: 180px; margin: 0 auto 0.6rem; object-fit: contain; display: none; }
.logo-empty-state { color: var(--text-muted); font-size: 0.83rem; line-height: 1.6; }
.logo-empty-state strong { display: block; font-family: var(--ff-head); color: var(--text-mid); margin-bottom: 0.25rem; }

/* ── FOOTER ── */
.footer { padding: 2.5rem 0 2rem; position: relative; z-index: 1; }
.footer-inner { background: var(--primary); border-radius: var(--r-xl); overflow: hidden; }
.footer-main { padding: 2.25rem 2rem; display: grid; grid-template-columns: 1fr auto; gap: 2rem; align-items: center; }
.footer-brand { font-family: var(--ff-head); font-size: 1.05rem; font-weight: 800; color: #fff; letter-spacing: -0.03em; margin-bottom: 0.4rem; }
.footer-copy  { font-size: 0.85rem; color: rgba(255,255,255,0.45); line-height: 1.7; max-width: 52ch; font-weight: 300; margin-bottom: 0.85rem; }
.footer-links { display: flex; flex-wrap: wrap; gap: 0.4rem 1.25rem; }
.footer-links a { font-size: 0.8rem; color: var(--accent-lt); font-weight: 600; }
.footer-links a:hover { color: #fff; }
.footer-badge {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.55rem 1rem; border-radius: 999px;
  border: 1px solid rgba(181,154,106,0.25); background: rgba(181,154,106,0.08);
  color: var(--accent-lt); font-size: 0.78rem; font-weight: 700; font-family: var(--ff-head);
  white-space: nowrap;
}
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.07); padding: 1rem 2rem;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 0.75rem;
  font-size: 0.8rem; color: rgba(255,255,255,0.3);
}
.footer-bottom a { color: var(--accent-lt); }

/* ── TOAST ── */
.toast {
  position: fixed; right: 1.25rem; bottom: 1.25rem; z-index: 99;
  background: var(--primary); color: #fff;
  border: 1px solid rgba(181,154,106,0.25); border-radius: var(--r-sm);
  padding: 0.85rem 1.15rem;
  font-family: var(--ff-head); font-size: 0.85rem; font-weight: 600;
  box-shadow: var(--sh-lg); opacity: 0; transform: translateY(12px);
  transition: opacity 0.22s, transform 0.22s; pointer-events: none; max-width: 300px;
}
.toast.show { opacity: 1; transform: translateY(0); }

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--border-lt); margin: 0.75rem 0; }

/* ── COOKIE BANNER ── */
.cookie-banner {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 90;
  background: var(--primary); border-top: 1px solid rgba(181,154,106,0.2);
  padding: 1rem 1.5rem; box-shadow: 0 -8px 32px rgba(0,0,0,0.2);
}
.cookie-banner-inner {
  max-width: 1200px; margin: 0 auto;
  display: flex; align-items: center; gap: 1.5rem; flex-wrap: wrap; justify-content: space-between;
}
.cookie-banner-text strong { display: block; font-family: var(--ff-head); color: #fff; font-size: 0.9rem; margin-bottom: 0.2rem; }
.cookie-banner-text p { font-size: 0.82rem; color: rgba(255,255,255,0.55); line-height: 1.6; }
.cookie-banner-text a { color: var(--accent-lt); }
.cookie-banner-actions { display: flex; gap: 0.6rem; flex-shrink: 0; flex-wrap: wrap; }

.cookie-modal-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(4px);
  display: flex; align-items: center; justify-content: center; padding: 1rem;
}
.cookie-modal {
  background: var(--surface); border-radius: var(--r); padding: 2rem;
  max-width: 520px; width: 100%; box-shadow: var(--sh-xl);
}
.cookie-modal h2 { font-family: var(--ff-head); font-size: 1.25rem; font-weight: 800; color: var(--primary); margin-bottom: 0.5rem; }
.cookie-modal-lead { font-size: 0.9rem; color: var(--text-muted); margin-bottom: 1.5rem; }
.cookie-toggle-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem;
  padding: 1rem 0; border-bottom: 1px solid var(--border-lt);
}
.cookie-toggle-row:last-of-type { border-bottom: none; }
.cookie-toggle-row strong { display: block; font-family: var(--ff-head); font-size: 0.875rem; color: var(--primary); margin-bottom: 0.2rem; }
.cookie-toggle-row p { font-size: 0.8rem; color: var(--text-muted); line-height: 1.6; }
.cookie-toggle-state { font-family: var(--ff-head); font-size: 0.72rem; font-weight: 700; color: var(--success); white-space: nowrap; margin-top: 0.25rem; }
.cookie-switch { position: relative; display: inline-block; width: 44px; height: 24px; flex-shrink: 0; margin-top: 2px; }
.cookie-switch input { opacity: 0; width: 0; height: 0; }
.cookie-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: var(--border); border-radius: 24px; transition: 0.2s;
}
.cookie-slider::before {
  content: ''; position: absolute; height: 18px; width: 18px;
  left: 3px; bottom: 3px; background: #fff; border-radius: 50%; transition: 0.2s;
}
.cookie-switch input:checked + .cookie-slider { background: var(--accent-dk); }
.cookie-switch input:checked + .cookie-slider::before { transform: translateX(20px); }
.cookie-modal-footer { display: flex; gap: 0.75rem; margin-top: 1.5rem; }

/* ── POLICY PAGES ── */
.policy-body { max-width: 760px; margin: 0 auto; padding: 3rem 1.25rem 5rem; position: relative; z-index: 1; }
.policy-body h1 { font-family: var(--ff-head); font-size: clamp(1.75rem, 3vw, 2.5rem); font-weight: 800; color: var(--primary); letter-spacing: -0.04em; margin-bottom: 0.5rem; }
.policy-body .meta { font-size: 0.82rem; color: var(--text-muted); margin-bottom: 2.5rem; }
.policy-body h2 { font-family: var(--ff-head); font-size: 1.1rem; font-weight: 800; color: var(--primary); margin: 2rem 0 0.6rem; }
.policy-body p, .policy-body li { font-size: 0.95rem; color: var(--text-mid); line-height: 1.85; }
.policy-body ul { padding-left: 1.25rem; margin: 0.5rem 0 1rem; display: grid; gap: 0.3rem; }
.policy-body a { color: var(--accent-dk); font-weight: 600; }

/* ── SUPPORT/REPORT PAGE ── */
.support-wrap { max-width: 680px; margin: 0 auto; padding: 3rem 1.25rem 5rem; position: relative; z-index: 1; }

/* ── RESPONSIVE ── */
@media (max-width: 1100px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 900px) {
  .auth-wrap { grid-template-columns: 1fr; }
  .auth-left { display: none; }
  .dash-wrap { flex-direction: column; }
  .sidebar { width: 100%; height: auto; position: static; flex-direction: row; overflow-x: auto; }
  .sidebar-nav { flex-direction: row; padding: 0.5rem; }
  .sidebar-user { display: none; }
  .sidebar-logo { display: none; }
  .footer-main { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  .navbar-inner { height: 60px; }
  .nav-pill { display: none; }
  .row-2, .row-3 { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .dash-content { padding: 1.25rem; }
  .dash-header { padding: 1.25rem; }
}


/* ── BRAND LOGO, GLASS, ADS, AND MOBILE POLISH ── */
.brand-logo-frame { width: 46px; height: 46px; border-radius: 16px; display: grid; place-items: center; overflow: hidden; background: rgba(255,255,255,0.08); border: 1px solid rgba(255,255,255,0.12); box-shadow: 0 14px 34px rgba(0,0,0,0.22); flex: 0 0 auto; }
.brand-logo-img { width: 100%; height: 100%; object-fit: contain; padding: 6px; }
.brand-fallback { display: none; width: 100%; height: 100%; border-radius: 14px; }
.brand span { display: block; }
.navbar { background: rgba(20,26,35,0.82); backdrop-filter: blur(24px) saturate(140%); }
.nav-actions { min-width: 0; }
.liquid-card { background: rgba(255,255,255,0.62); border: 1px solid rgba(255,255,255,0.55); box-shadow: 0 22px 60px rgba(30,42,56,0.12); backdrop-filter: blur(18px) saturate(135%); }
.panel { box-shadow: 0 14px 38px rgba(30,42,56,0.07); }
.panel:hover { box-shadow: 0 18px 44px rgba(30,42,56,0.095); }
.ad-slot { width: min(calc(100% - 2.5rem), 1320px); margin: 1.35rem auto; min-height: 96px; border-radius: var(--r); border: 1px dashed rgba(181,154,106,0.42); background: linear-gradient(135deg, rgba(255,255,255,0.72), rgba(245,241,231,0.78)); display: grid; place-items: center; position: relative; overflow: hidden; box-shadow: var(--sh-xs); }
.ad-slot::before { content: ''; position: absolute; inset: 0; background: radial-gradient(circle at 20% 10%, rgba(181,154,106,0.13), transparent 34%), radial-gradient(circle at 80% 100%, rgba(30,42,56,0.08), transparent 36%); pointer-events: none; }
.ad-slot-label { position: absolute; top: 0.55rem; left: 0.8rem; z-index: 1; font-family: var(--ff-head); font-size: 0.62rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.1em; color: var(--text-muted); }
.ad-slot .adsbygoogle { width: 100%; min-height: 90px; z-index: 1; }
.ad-slot-hero-bottom, .ad-slot-dashboard-top, .ad-slot-dashboard-mid { min-height: 118px; }
.ad-slot-compact { min-height: 78px; }
.dash-wrap { min-height: calc(100vh - 72px); }
.dash-main { min-width: 0; }
.sidebar { color: #fff; background: linear-gradient(180deg, #111927 0%, #172235 58%, #101723 100%); box-shadow: inset -1px 0 0 rgba(255,255,255,0.06); }
.sidebar * { color: inherit; }
.sidebar-brand { display: flex; align-items: center; gap: 0.7rem; color: #fff; }
.sidebar-logo-img { width: 42px; height: 42px; object-fit: contain; border-radius: 14px; background: rgba(255,255,255,0.08); padding: 5px; border: 1px solid rgba(255,255,255,0.12); }
.sidebar-logo-name { font-family: var(--ff-head); font-size: 1rem; font-weight: 800; letter-spacing: -0.03em; color: #fff; }
.sidebar-logo-sub { font-size: 0.68rem; color: rgba(255,255,255,0.55); margin-top: 1px; }
.sidebar-logo-text { color: #fff; }
.sidebar-section-label { color: rgba(255,255,255,0.45); }
.sidebar-item { color: rgba(255,255,255,0.76); }
.sidebar-item:hover { color: #fff; }
.sidebar-item.active { color: #fff; background: linear-gradient(135deg, rgba(181,154,106,0.28), rgba(255,255,255,0.08)); border: 1px solid rgba(181,154,106,0.22); }
.inv-table-wrap { overflow-x: auto; }
.inv-list-table { min-width: 760px; }
.footer-logo-row { display: flex; align-items: center; gap: 0.7rem; margin-bottom: 0.4rem; }
.footer-logo { width: 44px; height: 44px; object-fit: contain; border-radius: 14px; background: rgba(255,255,255,0.08); padding: 5px; border: 1px solid rgba(255,255,255,0.1); }
.swatches { gap: 0.55rem; }
.swatch { width: 34px; height: 34px; }
@media (max-width: 900px) {
  .navbar-inner { height: auto; min-height: 66px; padding: 0.65rem 0; align-items: flex-start; }
  .nav-actions { overflow-x: auto; padding-bottom: 0.15rem; max-width: 100%; scrollbar-width: none; }
  .nav-actions::-webkit-scrollbar { display: none; }
  .nav-actions .btn { flex: 0 0 auto; }
  .dash-wrap { display: block; min-height: auto; }
  .sidebar { width: 100%; height: auto; position: sticky; top: 0; z-index: 40; overflow-x: auto; }
  .sidebar-logo { display: block; padding: 0.85rem 1rem 0.35rem; }
  .sidebar-user { display: none; }
  .sidebar-nav { flex-direction: row; overflow-x: auto; gap: 0.45rem; padding: 0.55rem 1rem 0.85rem; scrollbar-width: none; }
  .sidebar-nav::-webkit-scrollbar { display: none; }
  .sidebar-section-label { display: none; }
  .sidebar-item { flex: 0 0 auto; white-space: nowrap; background: rgba(255,255,255,0.06); border: 1px solid rgba(255,255,255,0.08); }
  .dash-header { align-items: flex-start; }
}
@media (max-width: 640px) {
  .wrap, .container { width: min(calc(100% - 1.25rem), 1320px); }
  .brand-sub { display: none; }
  .brand-logo-frame { width: 40px; height: 40px; border-radius: 14px; }
  .brand-name { font-size: 1rem; }
  .nav-actions .btn-outline-light { display: none; }
  .btn { white-space: normal; text-align: center; }
  .stats-grid { grid-template-columns: 1fr; }
  .dash-content { padding: 1rem 0.75rem 1.25rem; }
  .dash-header { padding: 1.1rem 0.85rem; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .panel-head .btn { width: 100%; }
  .auth-right { padding: 2rem 1rem; }
  .auth-box-title { font-size: 1.45rem; }
  .footer { padding: 1.5rem 0; }
  .footer-main, .footer-bottom { padding-left: 1.2rem; padding-right: 1.2rem; }
  .footer-inner { border-radius: 24px; }
  .ad-slot { width: min(calc(100% - 1.25rem), 1320px); min-height: 86px; margin: 1rem auto; }
}
@media (max-width: 480px) {
  .nav-actions .btn-sm { padding: 0.48rem 0.75rem; font-size: 0.74rem; }
  .sidebar-logo-name { font-size: 0.92rem; }
  .sidebar-logo-sub { display: none; }
  .inv-list-table { min-width: 680px; }
}

/* ── Final mobile, logo, dashboard menu, and advert fixes ── */
html, body { width: 100%; max-width: 100%; overflow-x: hidden; }
.wrap, .container, .dash-main, .panel, .tool-layout, .builder-wrap, .hero-layout, .auth-wrap { min-width: 0; }
.brand { min-width: 0; }
.brand-logo-stack { width: 52px !important; height: 52px !important; max-width: 52px !important; object-fit: cover !important; padding: 6px !important; border-radius: 50% !important; background: #ffffff !important; border: 1px solid rgba(255,255,255,0.14) !important; box-shadow: 0 12px 28px rgba(0,0,0,0.22); }
.brand-text-fallback { align-items: flex-start; flex-direction: column; line-height: 1.1; }
.sidebar-logo-name, .sidebar-logo-sub { display: none !important; }
.sidebar-logo { display: flex; justify-content: center; padding: 1.35rem 1rem 1rem; }
.sidebar-brand { width: 100%; min-height: 96px; justify-content: center; pointer-events: none; cursor: default; }
.sidebar-logo-img { width: 100px !important; height: 100px !important; max-width: 100px !important; max-height: 100px !important; object-fit: cover !important; border-radius: 50% !important; background: #ffffff !important; padding: 10px !important; border: 1px solid rgba(255,255,255,0.14) !important; box-shadow: 0 18px 34px rgba(0,0,0,0.22); }
.sidebar-brand > span { display: none !important; }
.footer-logo { width: 150px !important; height: auto !important; max-height: 56px !important; object-fit: contain !important; border-radius: 0 !important; background: transparent !important; padding: 0 !important; border: 0 !important; }
.footer-logo-row { align-items: center; }
.footer-brand { display: none; }

.ad-slot { max-width: 100%; isolation: isolate; }
.ad-slot-placeholder { position: relative; z-index: 1; display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.62rem 0.9rem; border-radius: 999px; background: rgba(255,255,255,0.62); color: var(--text-muted); font-family: var(--ff-head); font-size: 0.78rem; font-weight: 800; border: 1px solid rgba(181,154,106,0.22); }
.ad-slot .adsbygoogle { position: absolute; inset: 0; z-index: 2; }
.ad-slot .adsbygoogle[data-ad-status="filled"] ~ .ad-slot-placeholder { display: none; }

.cookie-banner { width: 100%; max-width: 100vw; overflow: hidden; padding-left: max(1rem, env(safe-area-inset-left)); padding-right: max(1rem, env(safe-area-inset-right)); }
.cookie-banner-inner { width: 100%; max-width: 1180px; min-width: 0; }
.cookie-banner-text { min-width: 0; flex: 1 1 280px; }
.cookie-banner-actions { min-width: 0; }
.cookie-modal { max-width: min(520px, calc(100vw - 2rem)); }

.sidebar-toggle { display: none !important; align-items: center; justify-content: space-between; gap: 0.75rem; margin: 0 1rem 0.9rem; padding: 0.82rem 1rem; border-radius: 14px; border: 1px solid rgba(181,154,106,0.26); background: linear-gradient(135deg, rgba(181,154,106,0.22), rgba(255,255,255,0.08)); color: #fff; font-family: var(--ff-head); font-weight: 800; cursor: pointer; box-shadow: inset 0 1px 0 rgba(255,255,255,0.06); }
.sidebar-toggle i { font-size: 1rem; color: #fff; }
.sidebar-toggle span { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.sidebar-toggle::after { content: 'Open'; font-family: var(--ff-head); font-size: 0.74rem; font-weight: 700; color: rgba(255,255,255,0.68); }
.sidebar.is-open .sidebar-toggle::after { content: 'Close'; }

@media (min-width: 901px) {
  .sidebar-toggle { display: none !important; }
  .sidebar-nav { max-height: none !important; opacity: 1 !important; overflow: visible !important; padding: 1rem 0.75rem !important; }
}

@media (max-width: 900px) {
  .dash-wrap { display: block !important; min-height: auto; }
  .sidebar { width: 100% !important; height: auto !important; position: sticky !important; top: 0 !important; z-index: 60 !important; overflow: visible !important; display: flex !important; flex-direction: column !important; }
  .sidebar-logo { display: flex !important; justify-content: flex-start !important; padding: 0.9rem 1rem 0.55rem !important; }
  .sidebar-brand { justify-content: flex-start !important; min-height: 0; }
  .sidebar-logo-img { width: 58px !important; height: 58px !important; max-width: 58px !important; max-height: 58px !important; padding: 6px !important; box-shadow: 0 12px 24px rgba(0,0,0,0.22); }
  .sidebar-toggle { display: inline-flex !important; width: calc(100% - 2rem); }
  .sidebar-user { display: none !important; }
  .sidebar-nav { display: grid !important; grid-template-columns: 1fr; gap: 0.4rem; padding: 0 1rem; max-height: 0; opacity: 0; overflow: hidden !important; transition: max-height 0.24s ease, opacity 0.18s ease, padding 0.18s ease; }
  .sidebar.is-open .sidebar-nav { max-height: 520px; opacity: 1; padding: 0 1rem 1rem; overflow-y: auto !important; }
  .sidebar-section-label { display: block !important; padding: 0.7rem 0.35rem 0.15rem; }
  .sidebar-item { width: 100%; flex: initial !important; white-space: normal !important; border-radius: 14px; }
  .dash-header { position: relative; z-index: 1; }
}

@media (max-width: 640px) {
  .navbar-inner { align-items: center; gap: 0.75rem; }
  .brand-logo-stack { width: 46px !important; height: 46px !important; max-width: 46px !important; padding: 5px !important; }
  .nav-actions { gap: 0.45rem; }
  .nav-actions .btn-sm { padding: 0.46rem 0.68rem; }
  .cookie-banner { padding: 0.85rem; }
  .cookie-banner-inner { display: grid; grid-template-columns: 1fr; gap: 0.85rem; }
  .cookie-banner-actions { display: grid; grid-template-columns: 1fr 1fr; width: 100%; gap: 0.55rem; }
  .cookie-banner-actions .btn { width: 100%; white-space: nowrap; padding-left: 0.7rem; padding-right: 0.7rem; }
  .cookie-banner-actions .btn:first-child { grid-column: 1 / -1; }
  .tool-notice-actions { width: 100%; display: grid; grid-template-columns: 1fr; }
  .hero-stats, .features-grid { grid-template-columns: 1fr; }
  .hero-card { padding: 1.1rem; }
  .inv-sheet { max-width: 100%; }
  .inv-table { display: block; overflow-x: auto; white-space: nowrap; }
}

/* ── v6 brand cleanup: solid navbar/footer, text wordmark, mobile-only sidebar menu ── */
.navbar {
  position: sticky !important;
  top: 0 !important;
  z-index: 100 !important;
  background: #1E2A38 !important;
  background-image: none !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  border-bottom: 1px solid rgba(181,154,106,0.22) !important;
  box-shadow: 0 8px 24px rgba(0,0,0,0.12) !important;
}
.navbar-inner { height: 72px; align-items: center !important; }
.brand-wordmark { display: inline-flex !important; align-items: center !important; min-height: 44px; }
.brand-name-orange,
.footer-brand-orange,
.sidebar-wordmark-text {
  font-family: var(--ff-head);
  font-weight: 900;
  letter-spacing: -0.04em;
  color: #ff8200 !important;
  text-shadow: none !important;
}
.brand-name-orange { font-size: 1.45rem !important; line-height: 1; }
.brand-logo-stack,
.brand-logo-img,
.brand-logo-frame,
.sidebar-logo-img,
.footer-logo { display: none !important; }

.footer-inner {
  background: #1E2A38 !important;
  background-image: none !important;
  border: 1px solid rgba(181,154,106,0.16);
}
.footer-logo-row { display: flex !important; align-items: center !important; margin-bottom: 0.65rem !important; }
.footer-brand { display: block !important; }
.footer-brand-orange { font-size: 1.35rem !important; margin: 0 !important; }

.sidebar {
  background: #1E2A38 !important;
  background-image: none !important;
}
.sidebar-logo {
  display: flex !important;
  justify-content: flex-start !important;
  align-items: center !important;
  padding: 1.15rem 1.15rem 0.85rem !important;
}
.sidebar-brand,
.sidebar-wordmark {
  width: auto !important;
  min-height: 0 !important;
  justify-content: flex-start !important;
  pointer-events: none !important;
  cursor: default !important;
}
.sidebar-wordmark-text { font-size: 1.35rem !important; line-height: 1; }
.sidebar-toggle { display: none !important; }

@media (min-width: 901px) {
  .sidebar-toggle { display: none !important; visibility: hidden !important; height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; overflow: hidden !important; }
  .sidebar-nav { max-height: none !important; opacity: 1 !important; overflow: visible !important; padding: 1rem 0.75rem !important; }
}

@media (max-width: 900px) {
  .navbar-inner { height: auto !important; min-height: 64px !important; padding: 0.65rem 0 !important; }
  .brand-name-orange { font-size: 1.3rem !important; }
  .sidebar { position: sticky !important; top: 0 !important; z-index: 70 !important; }
  .sidebar-logo { padding: 0.9rem 1rem 0.65rem !important; }
  .sidebar-wordmark-text { font-size: 1.25rem !important; }
  .sidebar-toggle {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: calc(100% - 2rem) !important;
    margin: 0 1rem 0.85rem !important;
    padding: 0.8rem 1rem !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255,130,0,0.32) !important;
    background: rgba(255,130,0,0.12) !important;
    color: #ffffff !important;
    font-family: var(--ff-head) !important;
    font-weight: 800 !important;
    box-shadow: none !important;
  }
  .sidebar-toggle i,
  .sidebar-toggle span { color: #ffffff !important; }
  .sidebar-toggle span { font-size: 0.82rem !important; text-transform: uppercase; letter-spacing: 0.08em; }
  .sidebar-toggle::after { color: rgba(255,255,255,0.68) !important; }
  .sidebar-nav { max-height: 0; opacity: 0; overflow: hidden !important; }
  .sidebar.is-open .sidebar-nav { max-height: 520px; opacity: 1; padding: 0 1rem 1rem !important; }
}
