/* ── HLS Partner Portal — shared styles ──────────────────────── */
:root {
  --primary:   #0a0f1e;
  --surface:   #0d1428;
  --card:      #111827;
  --border:    rgba(255,255,255,0.07);
  --accent:    #00aaff;
  --accent-alt:#00e5ff;
  --danger:    #ef4444;
  --success:   #22c55e;
  --warning:   #f59e0b;
  --text:      rgba(255,255,255,0.88);
  --muted:     rgba(255,255,255,0.45);
  --white:     #ffffff;
  --radius:    12px;
  --radius-sm: 8px;
  --font:      'Inter', system-ui, -apple-system, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { font-size: 15px; }
body {
  font-family: var(--font);
  background: var(--primary);
  color: var(--text);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-alt); }

/* ── Layout ──────────────────────────────────────────────────── */
.portal-wrap     { display: flex; min-height: 100vh; }
.sidebar         { width: 240px; flex-shrink: 0; background: var(--surface); border-right: 1px solid var(--border); display: flex; flex-direction: column; position: fixed; top: 0; left: 0; height: 100vh; overflow-y: auto; z-index: 100; }
.main            { flex: 1; margin-left: 240px; min-height: 100vh; display: flex; flex-direction: column; }
.main-body       { flex: 1; padding: 2rem 2.5rem; max-width: 1200px; width: 100%; }
.topbar          { height: 60px; background: var(--surface); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 2.5rem; position: sticky; top: 0; z-index: 50; }

/* ── Sidebar ─────────────────────────────────────────────────── */
.sidebar-logo    { padding: 1.5rem 1.25rem 1.25rem; border-bottom: 1px solid var(--border); }
.sidebar-logo img{ height: 28px; }
.sidebar-logo small { display: block; font-size: 0.65rem; color: var(--muted); letter-spacing: 0.1em; text-transform: uppercase; margin-top: 0.3rem; }

.sidebar-nav     { padding: 1rem 0; flex: 1; }
.nav-section     { font-size: 0.65rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); padding: 0.75rem 1.25rem 0.4rem; }
.nav-link        { display: flex; align-items: center; gap: 0.65rem; padding: 0.6rem 1.25rem; font-size: 0.88rem; color: rgba(255,255,255,0.65); cursor: pointer; border-left: 2px solid transparent; transition: all 0.15s; text-decoration: none; }
.nav-link:hover  { color: var(--white); background: rgba(255,255,255,0.04); }
.nav-link.active { color: var(--accent); border-left-color: var(--accent); background: rgba(0,170,255,0.06); }
.nav-link svg    { width: 16px; height: 16px; opacity: 0.75; flex-shrink: 0; }
.nav-link.active svg { opacity: 1; }

.sidebar-foot    { padding: 1rem 1.25rem 1.5rem; border-top: 1px solid var(--border); }
.user-chip       { display: flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; }
.user-avatar     { width: 32px; height: 32px; border-radius: 50%; background: linear-gradient(135deg, var(--accent), var(--accent-alt)); display: flex; align-items: center; justify-content: center; font-size: 0.7rem; font-weight: 700; color: var(--primary); flex-shrink: 0; }
.user-info       { min-width: 0; }
.user-name       { font-weight: 600; color: var(--white); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: 0.82rem; }
.user-role       { font-size: 0.7rem; color: var(--muted); }
.logout-btn      { margin-top: 0.75rem; width: 100%; display: flex; align-items: center; gap: 0.5rem; padding: 0.55rem 0.75rem; background: rgba(255,255,255,0.04); border: 1px solid var(--border); border-radius: var(--radius-sm); color: var(--muted); font-size: 0.8rem; cursor: pointer; transition: all 0.15s; }
.logout-btn:hover { color: var(--danger); border-color: rgba(239,68,68,0.3); }

/* ── Topbar ──────────────────────────────────────────────────── */
.topbar-title    { font-size: 1rem; font-weight: 700; color: var(--white); }
.topbar-right    { display: flex; align-items: center; gap: 1rem; font-size: 0.82rem; color: var(--muted); }
.badge-pending   { background: rgba(245,158,11,0.15); color: var(--warning); border: 1px solid rgba(245,158,11,0.3); padding: 0.2rem 0.65rem; border-radius: 50px; font-size: 0.72rem; font-weight: 700; }

/* ── Cards / surfaces ────────────────────────────────────────── */
.card            { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); }
.card-pad        { padding: 1.5rem; }
.card-head       { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-head h3    { font-size: 0.95rem; font-weight: 700; color: var(--white); }
.card-body       { padding: 1.5rem; }

/* ── Stat cards ──────────────────────────────────────────────── */
.stats-grid      { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stat-card       { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; }
.stat-label      { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.5rem; }
.stat-value      { font-size: 2rem; font-weight: 800; color: var(--white); letter-spacing: -0.02em; line-height: 1; }
.stat-value.accent { color: var(--accent); }
.stat-value.success { color: var(--success); }
.stat-value.warning { color: var(--warning); }
.stat-sub        { font-size: 0.72rem; color: var(--muted); margin-top: 0.35rem; }

/* ── Buttons ─────────────────────────────────────────────────── */
.btn             { display: inline-flex; align-items: center; gap: 0.45rem; padding: 0.6rem 1.25rem; border-radius: var(--radius-sm); font-size: 0.85rem; font-weight: 600; cursor: pointer; border: none; transition: all 0.15s; text-decoration: none; white-space: nowrap; }
.btn-primary     { background: var(--accent); color: var(--primary); }
.btn-primary:hover { background: var(--accent-alt); color: var(--primary); }
.btn-ghost       { background: rgba(255,255,255,0.05); color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { background: rgba(255,255,255,0.09); color: var(--white); }
.btn-danger      { background: rgba(239,68,68,0.15); color: var(--danger); border: 1px solid rgba(239,68,68,0.3); }
.btn-danger:hover { background: rgba(239,68,68,0.25); }
.btn-success     { background: rgba(34,197,94,0.15); color: var(--success); border: 1px solid rgba(34,197,94,0.3); }
.btn-success:hover { background: rgba(34,197,94,0.25); }
.btn-sm          { padding: 0.38rem 0.85rem; font-size: 0.78rem; }
.btn[disabled]   { opacity: 0.45; pointer-events: none; }

/* ── Tables ──────────────────────────────────────────────────── */
.table-wrap      { overflow-x: auto; }
table            { width: 100%; border-collapse: collapse; font-size: 0.875rem; }
thead th         { padding: 0.75rem 1rem; text-align: left; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); border-bottom: 1px solid var(--border); background: rgba(255,255,255,0.02); }
tbody td         { padding: 0.85rem 1rem; border-bottom: 1px solid var(--border); color: var(--text); vertical-align: middle; }
tbody tr:last-child td { border-bottom: none; }
tbody tr:hover td { background: rgba(255,255,255,0.02); }

/* ── Status badges ───────────────────────────────────────────── */
.status          { display: inline-flex; align-items: center; gap: 0.35rem; padding: 0.2rem 0.65rem; border-radius: 50px; font-size: 0.72rem; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; }
.status::before  { content: ''; width: 5px; height: 5px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.s-pending       { color: var(--warning); background: rgba(245,158,11,0.12); }
.s-approved      { color: var(--success); background: rgba(34,197,94,0.12); }
.s-rejected      { color: var(--danger);  background: rgba(239,68,68,0.12); }
.s-won           { color: #a78bfa; background: rgba(167,139,250,0.12); }
.s-lost          { color: var(--muted);   background: rgba(255,255,255,0.06); }
.s-processing    { color: var(--accent);  background: rgba(0,170,255,0.12); }
.s-shipped       { color: #34d399;        background: rgba(52,211,153,0.12); }
.s-delivered     { color: var(--success); background: rgba(34,197,94,0.12); }
.s-suspended     { color: var(--danger);  background: rgba(239,68,68,0.12); }
.tier-silver     { color: #94a3b8; background: rgba(148,163,184,0.12); }
.tier-gold       { color: #f59e0b; background: rgba(245,158,11,0.12); }
.tier-platinum   { color: #a78bfa; background: rgba(167,139,250,0.12); }

/* ── Forms ───────────────────────────────────────────────────── */
.form-grid       { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.form-grid.cols-3 { grid-template-columns: 1fr 1fr 1fr; }
.form-full       { grid-column: 1 / -1; }
.form-group      { display: flex; flex-direction: column; gap: 0.4rem; }
.form-group label { font-size: 0.8rem; font-weight: 600; color: rgba(255,255,255,0.65); }
.form-group label span.req { color: var(--accent); margin-left: 0.2rem; }
input, select, textarea {
  background: rgba(255,255,255,0.04);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 0.6rem 0.85rem;
  font-size: 0.88rem;
  font-family: var(--font);
  width: 100%;
  transition: border-color 0.15s;
  outline: none;
}
input:focus, select:focus, textarea:focus { border-color: rgba(0,170,255,0.5); }
select option  { background: var(--card); }
textarea       { resize: vertical; min-height: 90px; }
.form-hint     { font-size: 0.73rem; color: var(--muted); }

/* ── Page headers ─────────────────────────────────────────────── */
.page-head       { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.75rem; flex-wrap: wrap; gap: 1rem; }
.page-head h1    { font-size: 1.5rem; font-weight: 800; color: var(--white); }
.page-head p     { font-size: 0.85rem; color: var(--muted); margin-top: 0.25rem; }
.breadcrumb      { font-size: 0.78rem; color: var(--muted); margin-bottom: 0.5rem; }
.breadcrumb a    { color: var(--muted); }
.breadcrumb a:hover { color: var(--accent); }

/* ── Empty state ─────────────────────────────────────────────── */
.empty           { text-align: center; padding: 4rem 2rem; color: var(--muted); }
.empty svg       { width: 40px; height: 40px; margin-bottom: 1rem; opacity: 0.3; }
.empty h3        { color: var(--white); font-size: 1rem; margin-bottom: 0.35rem; }

/* ── Alert ───────────────────────────────────────────────────── */
.alert           { padding: 0.85rem 1.1rem; border-radius: var(--radius-sm); font-size: 0.875rem; margin-bottom: 1.25rem; display: none; }
.alert.show      { display: block; }
.alert-error     { background: rgba(239,68,68,0.1); border: 1px solid rgba(239,68,68,0.3); color: #fca5a5; }
.alert-success   { background: rgba(34,197,94,0.1); border: 1px solid rgba(34,197,94,0.3); color: #86efac; }
.alert-info      { background: rgba(0,170,255,0.1); border: 1px solid rgba(0,170,255,0.3); color: #7dd3fc; }

/* ── Pricing table ────────────────────────────────────────────── */
.pricing-grid    { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; }
.price-card      { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 1.25rem 1.5rem; display: flex; flex-direction: column; gap: 0.5rem; }
.price-sku       { font-size: 0.72rem; color: var(--muted); font-family: monospace; letter-spacing: 0.05em; }
.price-name      { font-size: 0.92rem; font-weight: 700; color: var(--white); }
.price-desc      { font-size: 0.8rem; color: var(--muted); flex: 1; }
.price-amount    { font-size: 1.5rem; font-weight: 800; color: var(--accent); letter-spacing: -0.02em; margin-top: 0.25rem; }
.price-amount small { font-size: 0.8rem; color: var(--muted); font-weight: 400; }
.price-soon      { font-size: 0.78rem; color: var(--muted); font-style: italic; }

/* ── PO line items ────────────────────────────────────────────── */
.lines-table     { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.lines-table th  { padding: 0.6rem 0.75rem; text-align: left; font-size: 0.72rem; color: var(--muted); border-bottom: 1px solid var(--border); }
.lines-table td  { padding: 0.65rem 0.75rem; border-bottom: 1px solid var(--border); }
.lines-table tfoot td { border-top: 2px solid var(--border); border-bottom: none; font-weight: 700; color: var(--white); }
.remove-line     { background: none; border: none; color: var(--danger); cursor: pointer; padding: 0.2rem 0.4rem; border-radius: 4px; font-size: 0.85rem; }
.remove-line:hover { background: rgba(239,68,68,0.1); }

/* ── Filter bar ───────────────────────────────────────────────── */
.filter-bar      { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.filter-btn      { padding: 0.4rem 1rem; border-radius: 50px; font-size: 0.78rem; font-weight: 600; cursor: pointer; border: 1px solid var(--border); background: transparent; color: var(--muted); transition: all 0.15s; }
.filter-btn:hover { border-color: var(--accent); color: var(--accent); }
.filter-btn.active { background: rgba(0,170,255,0.12); border-color: var(--accent); color: var(--accent); }

/* ── Modal ────────────────────────────────────────────────────── */
.modal-bg        { position: fixed; inset: 0; background: rgba(0,0,0,0.7); z-index: 1000; display: none; align-items: center; justify-content: center; padding: 1rem; }
.modal-bg.open   { display: flex; }
.modal           { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; }
.modal-head      { padding: 1.25rem 1.5rem; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.modal-head h3   { font-size: 1rem; font-weight: 700; color: var(--white); }
.modal-close     { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 1.25rem; line-height: 1; padding: 0.2rem; }
.modal-close:hover { color: var(--white); }
.modal-body      { padding: 1.5rem; }
.modal-foot      { padding: 1rem 1.5rem; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 0.75rem; }

/* ── Auth pages ───────────────────────────────────────────────── */
.auth-page       { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 2rem; background: var(--primary); }
.auth-box        { width: 100%; max-width: 440px; }
.auth-logo       { text-align: center; margin-bottom: 2rem; }
.auth-logo img   { height: 32px; }
.auth-logo p     { font-size: 0.78rem; color: var(--muted); margin-top: 0.5rem; }
.auth-card       { background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 2rem; }
.auth-card h2    { font-size: 1.3rem; font-weight: 800; color: var(--white); margin-bottom: 0.35rem; }
.auth-card .sub  { font-size: 0.83rem; color: var(--muted); margin-bottom: 1.75rem; }
.auth-foot       { text-align: center; font-size: 0.82rem; color: var(--muted); margin-top: 1.25rem; }

/* ── Pill/chip ────────────────────────────────────────────────── */
.chip            { display: inline-block; padding: 0.2rem 0.65rem; border-radius: 50px; font-size: 0.72rem; font-weight: 600; }
.chip-blue       { background: rgba(0,170,255,0.12); color: var(--accent); }

/* ── Detail page ─────────────────────────────────────────────── */
.detail-grid     { display: grid; grid-template-columns: 1fr 320px; gap: 1.5rem; align-items: start; }
.dl              { display: grid; grid-template-columns: max-content 1fr; gap: 0.65rem 1.25rem; font-size: 0.875rem; }
.dl dt           { color: var(--muted); font-weight: 500; }
.dl dd           { color: var(--text); }

/* ── Scrollbar ────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 3px; }

/* ── Responsive ───────────────────────────────────────────────── */
@media (max-width: 900px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s; }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid.cols-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .hamburger-toggle { display: flex; }
}
@media (min-width: 901px) { .hamburger-toggle { display: none; } }
.hamburger-toggle { background: none; border: none; color: var(--text); cursor: pointer; padding: 0.4rem; }
