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

:root {
  --bg: #051018;
  --surface: #0c1a2e;
  --surface2: #152337;
  --border: #1e3352;
  --text: #e0e8f0;
  --muted: #8a96a8;
  --accent: #5DD3FF;
  --accent-hover: #3bb8f5;
  --green: #3de07a;
  --yellow: #f0a500;
  --red: #f87171;
  --blue: #5DD3FF;
  --pink: #ec4899;
  --sidebar-w: 210px;
  --sidebar-bg: #030d18;
}

body { font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; display: flex; font-size: 14px; }

/* SIDEBAR */
.sidebar { width: var(--sidebar-w); background: var(--sidebar-bg); border-right: none; display: flex; flex-direction: column; padding: 20px 0; position: fixed; top: 0; left: 0; height: 100vh; }
.logo { font-size: 16px; font-weight: 700; color: #fff; padding: 0 20px 24px; letter-spacing: .5px; }
.nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 20px; color: rgba(255,255,255,.6); text-decoration: none; transition: all .15s; }
.nav-link:hover { color: #fff; background: rgba(255,255,255,.08); }
.nav-link.active { color: #5DD3FF; background: rgba(93,211,255,.1); border-right: 2px solid #5DD3FF; }
.nav-link .icon { font-size: 10px; }

/* CONTENT */
.content { margin-left: var(--sidebar-w); flex: 1; padding: 32px; max-width: 1200px; }

/* PAGE HEADER */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 28px; gap: 16px; }
.page-header h1 { font-size: 22px; font-weight: 600; }
.date-badge { background: var(--surface2); padding: 4px 12px; border-radius: 20px; font-size: 12px; color: var(--muted); }
.back-link { display: block; color: var(--muted); text-decoration: none; font-size: 13px; margin-bottom: 4px; }
.back-link:hover { color: var(--text); }
.header-actions { display: flex; gap: 8px; }

/* BUTTONS */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 8px; border: none; font-size: 13px; font-weight: 500; cursor: pointer; text-decoration: none; transition: all .15s; }
.btn-primary { background: var(--accent); color: #051018; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-ok { background: rgba(34,197,94,.15); color: var(--green); border: 1px solid rgba(34,197,94,.3); }
.btn-ok:hover { background: rgba(34,197,94,.25); }
.btn-sm { padding: 4px 10px; font-size: 12px; }
.btn-del { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 12px; padding: 2px 6px; border-radius: 4px; }
.btn-del:hover { color: var(--red); background: rgba(239,68,68,.1); }

/* STAT GRID */
.stat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-bottom: 32px; }
.stat-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.stat-card.warn { border-color: rgba(245,158,11,.3); }
.stat-card.ok { border-color: rgba(34,197,94,.3); }
.stat-card.alert { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.05); }
.stat-card.green { border-color: rgba(34,197,94,.3); background: rgba(34,197,94,.05); }
.stat-num { font-size: 28px; font-weight: 700; color: var(--text); }
.stat-label { font-size: 12px; color: var(--muted); margin-top: 4px; }

/* LAYOUT */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.detail-grid { display: grid; grid-template-columns: 1fr 380px; gap: 24px; align-items: start; }
.right-col { display: flex; flex-direction: column; gap: 24px; }

/* PANEL */
.panel { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 20px; }
.panel-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.panel-header h2 { font-size: 15px; font-weight: 600; }
.mt { margin-top: 16px; }

/* CONTACT BAR */
.contact-bar { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px 20px; margin-bottom: 24px; display: flex; flex-direction: column; gap: 10px; }
.contact-handles-row { display: flex; flex-wrap: wrap; gap: 10px; }
.handle-pill { display: flex; align-items: center; gap: 8px; background: var(--surface2); padding: 6px 12px; border-radius: 20px; font-size: 13px; }
.contact-stats-row { display: flex; gap: 16px; font-size: 13px; }
.contact-stat { color: var(--muted); }
.contact-stat.ok { color: var(--green); }
.contact-stat.green { color: var(--green); font-weight: 600; }
.contact-stat.muted { color: var(--muted); }
.contact-notes-bar { font-size: 13px; color: var(--muted); border-top: 1px solid var(--border); padding-top: 10px; }

/* PLATFORM BADGES */
.platform-badge { font-size: 10px; font-weight: 600; padding: 2px 7px; border-radius: 10px; text-transform: uppercase; letter-spacing: .5px; }
.platform-whatsapp { background: rgba(34,197,94,.15); color: #4ade80; }
.platform-imessage { background: rgba(59,130,246,.15); color: #60a5fa; }
.platform-instagram { background: rgba(236,72,153,.15); color: #f472b6; }

/* MESSAGE FEED */
.message-feed { display: flex; flex-direction: column; gap: 10px; max-height: 500px; overflow-y: auto; }
.feed-item { background: var(--surface2); border-radius: 8px; padding: 12px; border-left: 3px solid var(--border); }
.feed-item.outbound { border-left-color: var(--accent); }
.feed-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; flex-wrap: wrap; }
.feed-name { color: var(--accent); text-decoration: none; font-weight: 500; font-size: 13px; }
.feed-name:hover { color: var(--accent-hover); }
.feed-dir { font-size: 11px; color: var(--muted); }
.dir-in { color: var(--blue); }
.dir-out { color: var(--accent); }
.feed-content { font-size: 13px; color: var(--text); line-height: 1.5; white-space: pre-wrap; }
.feed-time { font-size: 11px; color: var(--muted); margin-left: auto; }

/* LOG FORM */
.log-form { display: flex; flex-direction: column; gap: 8px; padding-bottom: 16px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.log-form-row { display: flex; gap: 8px; flex-wrap: wrap; }

/* INPUTS */
.input { background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; color: var(--text); padding: 8px 12px; font-size: 13px; width: 100%; transition: border-color .15s; }
.input:focus { outline: none; border-color: var(--accent); }
.input-sm { width: auto; flex: 1; min-width: 100px; }
.input-xs { width: auto; font-size: 12px; padding: 3px 6px; }
.textarea { resize: vertical; min-height: 72px; font-family: inherit; line-height: 1.5; }
.input-prefix-wrap { display: flex; align-items: center; }
.input-prefix { background: var(--surface2); border: 1px solid var(--border); border-right: none; padding: 8px 10px; border-radius: 8px 0 0 8px; color: var(--muted); }
.input-prefixed { border-radius: 0 8px 8px 0; }
.inline-form { display: inline; }

/* FORM CARD */
.form-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 24px; display: flex; flex-direction: column; gap: 0; max-width: 600px; }
.form-section { margin-bottom: 24px; }
.form-section h3 { font-size: 13px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .8px; margin-bottom: 14px; }
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 5px; }
.form-actions { border-top: 1px solid var(--border); padding-top: 16px; }
.label-sm { font-size: 12px; color: var(--muted); align-self: center; white-space: nowrap; }

/* CONTACT GRID */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; }
.contact-card { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 16px; display: flex; align-items: center; gap: 14px; text-decoration: none; color: var(--text); transition: border-color .15s, background .15s; }
.contact-card:hover { border-color: var(--accent); background: var(--surface2); }
.contact-avatar { width: 40px; height: 40px; border-radius: 50%; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 16px; flex-shrink: 0; }
.contact-name { font-weight: 600; margin-bottom: 4px; }
.contact-handles { display: flex; flex-direction: column; gap: 2px; }
.handle { font-size: 12px; color: var(--muted); }
.contact-meta { margin-left: auto; display: flex; flex-direction: column; gap: 4px; align-items: flex-end; }

/* CONTACTS FILTER BAR */
.contacts-filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 16px; }
.contacts-search { flex: 1; min-width: 200px; }
.cf-field { display: flex; flex-direction: column; gap: 3px; }
.cf-label { font-size: 10px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.cf-date { width: 140px; font-size: 12px; padding: 7px 10px; color-scheme: dark; }
.cf-sort-wrap select { font-size: 12px; padding: 7px 10px; width: 130px; }
.cf-active-filter { display: flex; align-items: center; gap: 7px; font-size: 12px; color: var(--muted); background: rgba(99,102,241,.08); border: 1px solid rgba(99,102,241,.2); border-radius: 8px; padding: 7px 12px; margin-bottom: 14px; }
.cf-active-filter strong { color: var(--accent-hover); }

/* BADGES */
.badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; white-space: nowrap; }
.badge-orders { background: rgba(99,102,241,.15); color: var(--accent-hover); }
.badge-followup { background: rgba(245,158,11,.15); color: var(--yellow); }
.badge-date { display: flex; align-items: center; gap: 4px; background: rgba(107,114,128,.12); color: var(--muted); }

/* ORDERS */
.orders-list { display: flex; flex-direction: column; gap: 8px; }
.order-total-label { font-size: 12px; color: var(--green); font-weight: 600; }
.order-card { background: var(--surface2); border-radius: 10px; padding: 12px 14px; border-left: 3px solid var(--border); }
.order-card[data-status="pending"]  { border-left-color: var(--yellow); }
.order-card[data-status="paid"]     { border-left-color: var(--green); }
.order-card[data-status="shipped"]  { border-left-color: var(--accent-hover); }
.order-card[data-status="delivered"]{ border-left-color: #86efac; }
.order-card-top  { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 5px; }
.order-product   { font-weight: 600; font-size: 14px; line-height: 1.3; }
.order-price     { font-weight: 700; color: var(--green); font-size: 14px; white-space: nowrap; flex-shrink: 0; }
.order-card-meta { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; flex-wrap: wrap; }
.order-qty       { font-size: 12px; color: var(--muted); }
.order-date      { font-size: 12px; color: var(--muted); }
.order-note-text { font-size: 12px; color: var(--muted); font-style: italic; margin-bottom: 8px; }
.order-card-actions { display: flex; align-items: center; gap: 6px; }
.order-status-select { width: auto !important; font-size: 11px; padding: 3px 7px; cursor: pointer; }
.status-badge { font-size: 11px; padding: 2px 8px; border-radius: 10px; font-weight: 600; }
.status-pending  { background: rgba(245,158,11,.15); color: var(--yellow); }
.status-paid     { background: rgba(34,197,94,.15);  color: var(--green); }
.status-shipped  { background: rgba(99,102,241,.15); color: var(--accent-hover); }
.status-delivered{ background: rgba(34,197,94,.25);  color: #86efac; }
.order-form { display: flex; flex-direction: column; gap: 7px; padding-bottom: 14px; border-bottom: 1px solid var(--border); margin-bottom: 4px; }
.order-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.price { font-weight: 600; color: var(--green); margin-left: auto; }

/* FOLLOW-UPS */
.followup-list { display: flex; flex-direction: column; gap: 10px; }
.followup-item { background: var(--surface2); border-radius: 8px; padding: 12px; border-left: 3px solid var(--border); }
.followup-item.overdue { border-left-color: var(--red); background: rgba(239,68,68,.05); }
.followup-item.completed { opacity: .5; }
.followup-top { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.followup-note { font-size: 13px; color: var(--text); margin-bottom: 8px; }
.due-date { font-size: 12px; color: var(--yellow); font-weight: 500; }
.done-label { font-size: 11px; color: var(--green); margin-left: auto; }

/* SEARCH */
.search-bar { display: flex; gap: 8px; margin-bottom: 16px; }
.search-input { flex: 1; }
.tab-row { display: flex; gap: 4px; margin-bottom: 20px; }
.tab { padding: 6px 16px; border-radius: 20px; text-decoration: none; color: var(--muted); font-size: 13px; }
.tab:hover { color: var(--text); }
.tab-active { background: var(--surface); color: var(--text); border: 1px solid var(--border); }

/* MISC */
.empty { color: var(--muted); font-size: 13px; padding: 12px 0; }
.empty-state { text-align: center; padding: 60px 0; display: flex; flex-direction: column; align-items: center; gap: 16px; color: var(--muted); }
.muted { color: var(--muted); font-size: 12px; }
.green { color: var(--green); }
.ok { color: var(--green); }

/* INVENTORY TOOLBAR */
.inv-toolbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; flex-wrap: wrap; gap: 12px; }
.inv-toolbar .tab-row { margin: 0; }
.inv-toolbar-right { display: flex; align-items: center; gap: 8px; }
.inv-search-wrap { position: relative; }
.inv-search-wrap svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.inv-search { padding-left: 32px; width: 200px; font-size: 13px; }

/* VIEW TOGGLE */
.view-toggle { display: flex; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; overflow: hidden; }
.view-toggle-btn { background: none; border: none; color: var(--muted); padding: 6px 10px; cursor: pointer; display: flex; align-items: center; transition: all .15s; }
.view-toggle-btn:hover { color: var(--text); background: var(--surface); }
.view-toggle-btn.active { background: var(--accent); color: #fff; }

/* LIST VIEW TABLE */
.inv-table-wrap { background: var(--surface); border: 1px solid var(--border); border-radius: 12px; overflow: hidden; margin-bottom: 40px; }
.inv-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.inv-table thead { background: var(--surface2); }
.inv-table th { padding: 10px 14px; text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; }
.th-stock { text-align: center; }
.inv-table tbody tr { border-top: 1px solid var(--border); }
.inv-row { transition: background .12s; }
.inv-row:hover { background: var(--surface2); }
.inv-row td { padding: 9px 14px; vertical-align: middle; }
.inv-row { border-left: 3px solid transparent; }
.inv-row-good { border-left-color: transparent; }
.inv-row-low  { border-left-color: var(--yellow); }
.inv-row-out  { border-left-color: var(--red); }
.inv-row-name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.inv-row-variant { font-size: 11px; color: var(--accent-hover); font-weight: 600; text-transform: uppercase; letter-spacing: .4px; margin-top: 1px; }
.inv-cat-label-sm { font-size: 11px; padding: 2px 9px; white-space: nowrap; }
.td-stock { text-align: center; }
.inv-row-stock { font-size: 18px; font-weight: 800; }
.stock-num-good { color: var(--green); }
.stock-num-low  { color: var(--yellow); }
.stock-num-out  { color: var(--red); }
.td-adjust { white-space: nowrap; }
.inv-row-adjust { display: flex; align-items: center; gap: 4px; }
.btn-adjust-sm { width: 26px !important; height: 26px !important; font-size: 14px !important; }
.adj-input-sm { width: 40px !important; font-size: 11px !important; padding: 3px 4px !important; }
.status-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }
.dot-good { background: var(--green); }
.dot-low  { background: var(--yellow); }
.dot-out  { background: var(--red); }
.inv-status-label { font-size: 12px; font-weight: 600; vertical-align: middle; }
.label-good { color: var(--green); }
.label-low  { color: var(--yellow); }
.label-out  { color: var(--red); }
.td-actions { text-align: right; white-space: nowrap; }

/* INVENTORY SECTIONS */
.inv-section { margin-bottom: 40px; }
.inv-section-header { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.inv-cat-label { font-size: 12px; font-weight: 700; padding: 4px 13px; border-radius: 20px; border: 1px solid; letter-spacing: .2px; }
.inv-section-meta { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.inv-sec-badge { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 10px; }
.inv-sec-out { background: rgba(239,68,68,.12); color: var(--red); }
.inv-sec-low { background: rgba(245,158,11,.12); color: var(--yellow); }
.inv-section-count { font-size: 11px; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 8px; }

/* INVENTORY GRID */
.inv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

/* CARD */
.inv-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; display: flex; flex-direction: column; transition: transform .18s, box-shadow .18s, border-color .18s; }
.inv-card:hover { transform: translateY(-3px); box-shadow: 0 12px 32px rgba(0,0,0,.4); }
.inv-card.inv-out { border-color: rgba(239,68,68,.4); background: rgba(239,68,68,.02); }
.inv-card.inv-low { border-color: rgba(245,158,11,.4); background: rgba(245,158,11,.02); }
.inv-card.inv-good { border-color: var(--border); }
.inv-card-stripe { height: 4px; flex-shrink: 0; }

/* CARD MAIN */
.inv-card-main { padding: 18px 18px 14px; display: flex; flex-direction: column; gap: 14px; flex: 1; }

/* CARD HEADER */
.inv-card-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.inv-card-title { display: flex; flex-direction: column; gap: 7px; flex: 1; min-width: 0; }
.inv-name { font-weight: 700; font-size: 15px; line-height: 1.3; }
.inv-mg-pill { display: inline-flex; align-items: center; font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 20px; border: 1px solid; letter-spacing: .3px; width: fit-content; }
.inv-notes-small { font-size: 11px; color: var(--muted); line-height: 1.4; }
.inv-view-btn { flex-shrink: 0; width: 30px; height: 30px; border-radius: 8px; background: var(--surface2); border: 1px solid var(--border); color: var(--muted); display: flex; align-items: center; justify-content: center; text-decoration: none; transition: all .15s; }
.inv-view-btn:hover { background: var(--accent); border-color: var(--accent); color: #fff; transform: translateX(2px); }

/* STOCK SECTION */
.inv-stock-section { display: flex; flex-direction: column; gap: 8px; }
.inv-stock-row { display: flex; align-items: flex-end; gap: 10px; }
.inv-stock-big { font-size: 44px; font-weight: 900; line-height: 1; letter-spacing: -1px; }
.inv-stock-good { color: var(--green); }
.inv-stock-low  { color: var(--yellow); }
.inv-stock-out  { color: var(--red); }
.inv-stock-aside { display: flex; flex-direction: column; gap: 5px; padding-bottom: 4px; }
.inv-stock-unit-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.inv-status-chip { font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 20px; letter-spacing: .2px; white-space: nowrap; }
.chip-good { background: rgba(34,197,94,.12); color: var(--green); }
.chip-low  { background: rgba(245,158,11,.12); color: var(--yellow); }
.chip-out  { background: rgba(239,68,68,.12); color: var(--red); }

/* STOCK BAR */
.inv-stock-bar-track { height: 5px; background: rgba(255,255,255,.06); border-radius: 99px; overflow: hidden; }
.inv-stock-bar-fill { height: 100%; border-radius: 99px; transition: width .4s ease; }
.bar-good { background: var(--green); }
.bar-low  { background: var(--yellow); }
.bar-out  { background: var(--red); width: 0 !important; }
.inv-stock-hint { font-size: 10px; color: var(--muted); letter-spacing: .1px; }

/* CARD FOOTER */
.inv-card-footer { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: var(--surface2); border-top: 1px solid var(--border); flex-wrap: wrap; }
.btn-adj { width: 38px; height: 38px; border-radius: 10px; font-size: 20px; font-weight: 700; cursor: pointer; border: 1px solid var(--border); background: var(--surface2); color: var(--text); display: flex; align-items: center; justify-content: center; transition: all .15s; flex-shrink: 0; line-height: 1; }
.btn-adj-minus:hover:not(:disabled) { background: rgba(239,68,68,.15); border-color: var(--red); color: var(--red); transform: scale(1.08); }
.btn-adj-plus:hover { background: rgba(34,197,94,.15); border-color: var(--green); color: var(--green); transform: scale(1.08); }
.btn-adj:disabled { opacity: .28; cursor: not-allowed; }
.inv-adj-form { display: flex; align-items: center; gap: 5px; }
.inv-adj-input { width: 58px; text-align: center; padding: 5px 7px; font-size: 13px; }
.inv-card-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

/* Keep old btn-adjust for list view */
.btn-adjust { background: var(--surface2); border: 1px solid var(--border); color: var(--text); width: 32px; height: 32px; border-radius: 8px; font-size: 15px; font-weight: 700; cursor: pointer; transition: all .15s; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.btn-minus:hover:not(:disabled) { background: rgba(239,68,68,.15); border-color: var(--red); color: var(--red); }
.btn-plus:hover { background: rgba(34,197,94,.15); border-color: var(--green); color: var(--green); }
.btn-adjust:disabled { opacity: .3; cursor: not-allowed; }
.adj-form { display: flex; align-items: center; gap: 4px; }
.adj-input { width: 48px; text-align: center; padding: 4px 6px; font-size: 12px; }
.inv-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }

/* SIRI PANEL */
.siri-panel { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 28px; margin-top: 8px; }
.siri-header { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.siri-header h2 { font-size: 16px; font-weight: 600; }
.siri-icon { font-size: 22px; }
.siri-intro { color: var(--muted); font-size: 13px; margin-bottom: 24px; }
.siri-steps { display: flex; flex-direction: column; gap: 16px; margin-bottom: 24px; }
.siri-step { display: flex; gap: 14px; align-items: flex-start; }
.step-num { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 12px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.step-body { font-size: 13px; line-height: 1.6; }
.step-body p { color: var(--muted); margin-top: 4px; }
.step-note { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; }
.ip-code, .url-code { display: inline-block; background: var(--surface2); border: 1px solid var(--border); border-radius: 6px; padding: 4px 10px; font-family: monospace; font-size: 13px; margin: 6px 0; }
.url-highlight { color: var(--accent-hover); }
.siri-examples { background: var(--surface2); border-radius: 10px; padding: 16px; margin-bottom: 16px; }
.siri-ex-label { font-size: 11px; text-transform: uppercase; letter-spacing: .8px; color: var(--muted); margin-bottom: 10px; }
.siri-example { font-size: 13px; color: var(--text); padding: 5px 0; border-bottom: 1px solid var(--border); }
.siri-example:last-child { border-bottom: none; }
.siri-test { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; font-size: 13px; }
.form-hint { font-size: 11px; color: var(--muted); margin-top: 4px; }

/* INVENTORY CARD LINK */
.inv-card-link { display: block; text-decoration: none; color: inherit; flex: 1; min-width: 0; transition: opacity .15s; }
.inv-card-link:hover .inv-name { color: var(--accent-hover); }
.inv-row-link { display: block; text-decoration: none; color: inherit; }
.inv-row-link:hover .inv-row-name { color: var(--accent-hover); }

/* INVENTORY DETAIL PAGE */
.detail-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start; }

/* Variant tabs */
.detail-variant-row { display: flex; align-items: center; gap: 12px; margin-bottom: 24px; flex-wrap: wrap; }
.detail-variant-label { font-size: 12px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .6px; white-space: nowrap; }
.detail-variant-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.detail-variant-tab { padding: 5px 14px; border-radius: 20px; font-size: 13px; font-weight: 600; text-decoration: none; border: 1px solid var(--border); color: var(--muted); background: var(--surface2); transition: all .15s; }
.detail-variant-tab:hover { color: var(--text); border-color: var(--accent); }
.detail-variant-tab.active { font-weight: 700; }
.detail-variant-add { color: var(--accent); border-color: rgba(99,102,241,.3); background: rgba(99,102,241,.08); }
.detail-variant-add:hover { background: rgba(99,102,241,.15); }

/* Stock panel */
.detail-stock-panel { display: flex; flex-direction: column; gap: 20px; }
.detail-stock-header { display: flex; justify-content: space-between; align-items: flex-start; }
.detail-stock-label { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 6px; }
.detail-stock-num { font-size: 64px; font-weight: 900; line-height: 1; letter-spacing: -2px; }
.detail-stock-good { color: var(--green); }
.detail-stock-low  { color: var(--yellow); }
.detail-stock-out  { color: var(--red); }
.detail-stock-unit { font-size: 12px; color: var(--muted); margin-top: 4px; }
.detail-stock-status { text-align: right; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.detail-status-pill { font-size: 12px; font-weight: 700; padding: 4px 12px; border-radius: 20px; }
.pill-good { background: rgba(34,197,94,.12); color: var(--green); border: 1px solid rgba(34,197,94,.25); }
.pill-low  { background: rgba(245,158,11,.12); color: var(--yellow); border: 1px solid rgba(245,158,11,.25); }
.pill-out  { background: rgba(239,68,68,.12); color: var(--red); border: 1px solid rgba(239,68,68,.25); }
.detail-alert-threshold { font-size: 11px; color: var(--muted); }

/* Adjust section */
.detail-adjust-section { border-top: 1px solid var(--border); padding-top: 16px; }
.detail-adjust-label { font-size: 11px; text-transform: uppercase; letter-spacing: .7px; color: var(--muted); margin-bottom: 10px; }
.detail-adjust-row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-adj-btn { width: 40px !important; height: 40px !important; font-size: 18px !important; }
.detail-adj-custom { display: flex; align-items: center; gap: 6px; margin-left: 8px; }
.detail-adj-input { width: 64px; text-align: center; font-size: 14px; }
.detail-adj-note { width: 140px; font-size: 13px; }

/* Notes + meta */
.detail-notes { font-size: 13px; color: var(--muted); background: var(--surface2); border-radius: 8px; padding: 10px 12px; border-left: 3px solid var(--border); }
.detail-meta-row { display: flex; gap: 16px; }
.detail-meta-item { font-size: 11px; color: var(--muted); }

/* Stock log */
.detail-log { display: flex; flex-direction: column; }
.detail-log-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-log-row:last-child { border-bottom: none; }
.detail-log-delta { font-weight: 700; font-size: 14px; min-width: 36px; text-align: right; }
.delta-pos { color: var(--green); }
.delta-neg { color: var(--red); }
.detail-log-note { flex: 1; color: var(--muted); font-size: 12px; }
.detail-log-time { font-size: 11px; color: var(--muted); white-space: nowrap; }

@media (max-width: 700px) {
  .detail-grid-2 { grid-template-columns: 1fr; }
  .detail-variant-row { gap: 8px; }
}

/* DASHBOARD HERO */
.dash-hero { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 32px; flex-wrap: wrap; gap: 12px; }
.dash-greeting { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.dash-title { font-size: 26px; font-weight: 800; letter-spacing: -.5px; }
.dash-date-block { text-align: right; }
.dash-date-day { font-size: 13px; color: var(--muted); }
.dash-date-full { font-size: 15px; font-weight: 600; margin-top: 2px; }

/* KPI STAT CARDS */
.dash-kpi-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 24px; }
.dash-kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 18px 20px; display: flex; align-items: center; gap: 18px; transition: transform .15s, box-shadow .15s; }
.dash-kpi-card:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }

/* Circular badge */
.dash-kpi-badge { width: 78px; height: 78px; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px; flex-shrink: 0; color: #fff; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .5px; }
.kpi-orange { background: #f97316; }
.kpi-teal   { background: #0d9488; }
.kpi-navy   { background: #1e40af; }
.kpi-slate  { background: #475569; }

.dash-kpi-body { flex: 1; min-width: 0; }
.dash-kpi-period { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.dash-kpi-num { font-size: 30px; font-weight: 800; line-height: 1; letter-spacing: -.5px; color: var(--text); }
.dash-kpi-sub { font-size: 12px; color: var(--muted); margin-top: 5px; display: flex; align-items: center; gap: 5px; }
.dash-kpi-link { color: var(--accent); text-decoration: none; font-size: 12px; }
.dash-kpi-link:hover { text-decoration: underline; }
.kpi-overdue-text { color: var(--red); font-weight: 600; }
.kpi-warn-pill { background: rgba(220,38,38,.1); color: var(--red); font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 10px; }

/* MID GRID */
.dash-mid-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-bottom: 20px; }
.dash-total-badge { font-size: 12px; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; }

/* ORDER PIPELINE */
.dash-pipeline { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 4px; }
.dash-pipe-step { flex: 1; min-width: 60px; }
.dash-pipe-num { font-size: 28px; font-weight: 800; line-height: 1; margin-bottom: 4px; }
.pipe-pending  { color: var(--yellow); }
.pipe-paid     { color: var(--green); }
.pipe-shipped  { color: var(--accent-hover); }
.pipe-delivered{ color: #86efac; }
.dash-pipe-label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 6px; }
.dash-pipe-bar { height: 4px; background: rgba(255,255,255,.06); border-radius: 99px; overflow: hidden; }
.dash-pipe-fill { height: 100%; border-radius: 99px; min-width: 3px; }
.fill-pending  { background: var(--yellow); }
.fill-paid     { background: var(--green); }
.fill-shipped  { background: var(--accent-hover); }
.fill-delivered{ background: #86efac; }
.dash-pipe-arrow { color: var(--border); font-size: 16px; flex-shrink: 0; align-self: center; padding-bottom: 16px; }

/* INVENTORY ALERTS PANEL */
.dash-inv-empty { display: flex; align-items: center; gap: 8px; color: var(--green); }
.dash-alert-group { margin-bottom: 14px; }
.dash-alert-group:last-child { margin-bottom: 0; }
.dash-alert-group-label { font-size: 10px; font-weight: 700; text-transform: uppercase; letter-spacing: .7px; margin-bottom: 8px; }
.label-out { color: var(--red); }
.label-low { color: var(--yellow); }
.dash-inv-row { display: flex; align-items: center; gap: 8px; padding: 5px 0; border-bottom: 1px solid var(--border); }
.dash-inv-row:last-child { border-bottom: none; }
.dash-inv-dot { width: 6px; height: 6px; border-radius: 50%; flex-shrink: 0; }
.dot-out { background: var(--red); }
.dot-low { background: var(--yellow); }
.dash-inv-name { flex: 1; font-size: 13px; font-weight: 500; }
.dash-inv-var { font-size: 11px; color: var(--muted); }
.dash-inv-stock { font-size: 13px; font-weight: 700; }
.stock-out { color: var(--red); }
.stock-low { color: var(--yellow); }
.dash-inv-more { font-size: 11px; color: var(--muted); padding-top: 6px; }

/* MESSAGE FEED */
.dash-feed { display: flex; flex-direction: column; gap: 1px; }
.dash-feed-item { display: flex; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.dash-feed-item:last-child { border-bottom: none; }
.dash-feed-avatar { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 13px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; margin-top: 1px; }
.dash-feed-body { flex: 1; min-width: 0; }
.dash-feed-top { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin-bottom: 4px; }
.dash-feed-name { font-weight: 600; font-size: 13px; color: var(--accent-hover); text-decoration: none; }
.dash-feed-name:hover { color: var(--text); }
.dash-feed-dir { font-size: 11px; }
.dir-in { color: var(--blue); }
.dir-out { color: var(--accent); }
.dash-feed-time { font-size: 11px; color: var(--muted); margin-left: auto; }
.dash-feed-content { font-size: 12px; color: var(--muted); line-height: 1.5; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* FOLLOW-UPS */
.dash-followup-list { display: flex; flex-direction: column; gap: 1px; }
.dash-followup-item { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--border); }
.dash-followup-item:last-child { border-bottom: none; }
.dash-followup-item.fu-overdue { background: rgba(239,68,68,.04); margin: 0 -4px; padding: 11px 4px; border-radius: 8px; border-bottom-color: transparent; }
.dash-fu-left { flex: 1; min-width: 0; }
.dash-fu-top { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 3px; }
.dash-fu-overdue-tag { font-size: 10px; font-weight: 700; background: rgba(239,68,68,.15); color: var(--red); padding: 1px 7px; border-radius: 10px; }
.dash-fu-date { font-size: 11px; color: var(--muted); margin-left: auto; }
.dash-fu-note { font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dash-overdue-pill { font-size: 11px; font-weight: 700; background: rgba(239,68,68,.15); color: var(--red); padding: 2px 9px; border-radius: 10px; }

@media (max-width: 800px) {
  .dash-mid-grid { grid-template-columns: 1fr; }
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
}

/* CUSTOMER JOURNEY — full-width layout */
.content-wide { max-width: none !important; padding: 24px 28px; }

.journey-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.journey-title { font-size: 22px; font-weight: 800; letter-spacing: -.4px; }
.journey-subtitle { font-size: 13px; color: var(--muted); margin-top: 4px; }
.journey-assign-form { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.journey-assign-select { width: auto; min-width: 160px; font-size: 13px; }

/* PIPELINE STRIP */
.journey-pipeline-strip { display: flex; align-items: center; gap: 0; background: var(--surface); border: 1px solid var(--border); border-radius: 12px; padding: 10px 16px; margin-bottom: 20px; overflow-x: auto; }
.pipeline-node { display: flex; align-items: center; gap: 7px; padding: 4px 10px; border-radius: 8px; transition: background .15s; }
.pipeline-node:hover { background: var(--surface2); }
.pipeline-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.pipeline-label { font-size: 12px; font-weight: 600; color: var(--text); white-space: nowrap; }
.pipeline-n { font-size: 13px; font-weight: 800; }
.pipeline-arrow { font-size: 16px; color: var(--border); padding: 0 2px; flex-shrink: 0; }

/* KANBAN BOARD */
.journey-board { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: flex-start; padding-bottom: 24px; min-height: 70vh; }

.journey-col { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s, background .15s; min-height: 200px; }
.journey-col.drag-over { box-shadow: 0 0 0 2px var(--accent); background: var(--surface2); }

/* Column header */
.jcol-header { padding: 12px 14px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.jcol-header-left { display: flex; align-items: center; gap: 7px; min-width: 0; }
.jcol-dot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; }
.jcol-title { font-size: 12px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jcol-count { font-size: 10px; font-weight: 800; padding: 2px 7px; border-radius: 20px; border: 1px solid; flex-shrink: 0; }

/* Cards list */
.jcol-cards { padding: 0 10px 10px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.jcol-empty { font-size: 11px; color: var(--muted); text-align: center; padding: 20px 8px; border: 1px dashed; border-radius: 8px; margin-top: 4px; }
.jcol-empty-hidden { display: none; }

/* KANBAN CARD */
.jcard { background: var(--surface2); border: 1px solid var(--border); border-radius: 10px; padding: 10px; display: flex; flex-direction: column; gap: 7px; cursor: grab; transition: transform .15s, box-shadow .15s, opacity .15s; }
.jcard:hover { transform: translateY(-2px); box-shadow: 0 6px 20px rgba(0,0,0,.28); }
.jcard.dragging { opacity: .35; transform: scale(.97); cursor: grabbing; }

.jcard-top { display: flex; align-items: center; gap: 8px; }
.jcard-avatar { width: 32px; height: 32px; border-radius: 9px; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.jcard-info { flex: 1; min-width: 0; }
.jcard-name { font-weight: 600; font-size: 12px; color: var(--text); text-decoration: none; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.jcard-name:hover { color: var(--accent-hover); }
.jcard-handle { font-size: 10px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 1px; }
.jcard-remove { background: none; border: none; cursor: pointer; color: var(--muted); font-size: 11px; padding: 3px 5px; border-radius: 4px; transition: color .15s, background .15s; flex-shrink: 0; }
.jcard-remove:hover { color: #ef4444; background: rgba(239,68,68,.1); }

.jcard-days { display: flex; align-items: center; gap: 5px; font-size: 10px; color: var(--muted); background: var(--surface); border: 1px solid var(--border); border-radius: 20px; padding: 3px 8px; width: fit-content; }
.jcard-days.days-stale { color: #f59e0b; border-color: rgba(245,158,11,.3); background: rgba(245,158,11,.07); }
.reactivate-warn { color: #f59e0b; }

/* Move buttons */
.jcard-moves { display: flex; align-items: center; gap: 5px; }
.jcard-move-btn { background: none; border: 1px solid; border-radius: 6px; padding: 3px 7px; font-size: 10px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 3px; transition: background .12s, opacity .12s; white-space: nowrap; }
.jcard-move-btn:hover { opacity: .75; }
.jcard-move-btn span { max-width: 60px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.jcard-move-next { margin-left: auto; }

/* HEADER ASSIGN DROPDOWNS */
.hdr-drop { position: relative; }

.hdr-drop-btn {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--muted);
  font-size: 13px; font-weight: 500;
  cursor: pointer;
  transition: all .18s;
  min-width: 170px;
  white-space: nowrap;
}
.hdr-drop-btn:hover {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface2);
  box-shadow: 0 0 0 1px rgba(99,102,241,.2);
}
.hdr-drop.open .hdr-drop-btn {
  border-color: var(--accent);
  color: var(--text);
  background: var(--surface2);
  box-shadow: 0 0 0 2px rgba(99,102,241,.2);
}
.hdr-drop.selected .hdr-drop-btn { color: var(--text); }
.hdr-drop-label { flex: 1; text-align: left; }
.hdr-drop-chevron { flex-shrink: 0; transition: transform .2s; }
.hdr-drop.open .hdr-drop-chevron { transform: rotate(180deg); }

.hdr-drop-sdot { width: 9px; height: 9px; border-radius: 50%; flex-shrink: 0; display: none; }

.hdr-drop-menu {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  min-width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 6px;
  z-index: 300;
  box-shadow: 0 10px 40px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.04);
  opacity: 0;
  transform: translateY(-6px) scale(.97);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  transform-origin: top center;
}
.hdr-drop.open .hdr-drop-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hdr-drop-search {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 7px;
  padding: 7px 10px;
  color: var(--text);
  font-size: 12px;
  margin-bottom: 5px;
  outline: none;
}
.hdr-drop-search:focus { border-color: var(--accent); }

.hdr-drop-list { display: flex; flex-direction: column; gap: 1px; max-height: 220px; overflow-y: auto; }
.hdr-drop-list::-webkit-scrollbar { width: 4px; }
.hdr-drop-list::-webkit-scrollbar-thumb { background: var(--border); border-radius: 2px; }

.hdr-drop-option {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none; border-radius: 7px;
  color: var(--text);
  font-size: 13px; font-weight: 400;
  cursor: pointer;
  transition: background .12s, padding-left .12s;
  text-align: left; white-space: nowrap;
}
.hdr-drop-option:hover { background: rgba(255,255,255,.07); padding-left: 14px; }

.hdr-drop-initials {
  width: 24px; height: 24px; border-radius: 6px;
  background: rgba(99,102,241,.2);
  color: var(--accent);
  font-size: 10px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

/* TELEPORT DROPDOWN */
.jcard-teleport { position: relative; width: 100%; }

.jcard-teleport-btn {
  width: 100%;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--muted);
  font-size: 11px; font-weight: 600;
  cursor: pointer;
  transition: all .18s;
  letter-spacing: .2px;
}
.jcard-teleport-btn:hover {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 1px rgba(99,102,241,.2);
}
.jcard-teleport.open .jcard-teleport-btn {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
  box-shadow: 0 0 0 2px rgba(99,102,241,.18);
  border-radius: 8px 8px 6px 6px;
}
.jcard-teleport-chevron {
  margin-left: auto;
  transition: transform .2s;
  flex-shrink: 0;
}
.jcard-teleport.open .jcard-teleport-chevron { transform: rotate(180deg); }

.jcard-teleport-menu {
  position: absolute;
  bottom: calc(100% + 6px);
  left: 0; right: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 5px;
  display: flex; flex-direction: column; gap: 2px;
  z-index: 200;
  box-shadow: 0 10px 40px rgba(0,0,0,.12), 0 0 0 1px rgba(0,0,0,.04);
  opacity: 0;
  transform: translateY(6px) scale(.97);
  pointer-events: none;
  transition: opacity .18s, transform .18s;
  transform-origin: bottom center;
}
.jcard-teleport.open .jcard-teleport-menu {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.jcard-teleport-option {
  display: flex; align-items: center; gap: 9px;
  width: 100%;
  padding: 8px 10px;
  background: transparent;
  border: none; border-radius: 8px;
  color: var(--text);
  font-size: 12px; font-weight: 500;
  cursor: pointer;
  transition: background .13s, padding-left .13s;
  text-align: left;
}
.jcard-teleport-option:hover {
  background: rgba(255,255,255,.06);
  padding-left: 14px;
}
.jcard-teleport-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.jcard-teleport-arrow {
  margin-left: auto;
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity .13s, transform .13s;
  flex-shrink: 0;
}
.jcard-teleport-option:hover .jcard-teleport-arrow {
  opacity: 1;
  transform: translateX(0);
}

/* Journey stage on contact detail */
.contact-journey-select { width: auto; font-size: 12px; padding: 4px 8px; min-width: 160px; }

/* SCROLLBAR */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ── DASHBOARD REDESIGN ──────────────────────────────────────────────────── */

/* Hero */
.dash-hero-actions { display: flex; gap: 8px; align-items: center; flex-shrink: 0; }

/* Main two-column grid */
.dash-main-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 20px; }
.dash-left-col { display: flex; flex-direction: column; }
.dash-right-col { display: flex; flex-direction: column; }
.dash-panel-mb { margin-bottom: 20px; }

/* Panel header extras */
.panel-count { display: inline-flex; align-items: center; justify-content: center; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; }
.panel-period { font-size: 12px; color: var(--muted); background: var(--surface2); border: 1px solid var(--border); border-radius: 20px; padding: 2px 10px; }
.dash-panel-link { font-size: 11px; font-weight: 700; color: var(--muted); text-decoration: none; letter-spacing: .4px; }
.dash-panel-link:hover { color: var(--accent); }

/* Dashboard table */
.dash-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.dash-table thead tr { border-bottom: 1px solid var(--border); }
.dash-table th { text-align: left; font-size: 11px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; padding-bottom: 10px; }
.dash-table td { padding: 10px 0; border-bottom: 1px solid var(--border); vertical-align: middle; }
.dash-table tbody tr:last-child td { border-bottom: none; }
.dash-table td + td { padding-left: 8px; }
.dash-table th + th { padding-left: 8px; }

/* Task row */
.dash-task-cell { display: flex; align-items: center; gap: 8px; }
.dash-checkbox { width: 14px; height: 14px; cursor: pointer; flex-shrink: 0; accent-color: var(--accent); }

/* Links */
.dash-link { color: var(--text); text-decoration: none; font-weight: 500; }
.dash-link:hover { color: var(--accent); }

/* Contact cell with avatar */
.dash-contact-cell { display: flex; align-items: center; gap: 8px; }
.dash-mini-avatar { width: 28px; height: 28px; border-radius: 50%; background: var(--accent); color: #fff; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }

/* Utility */
.text-sm   { font-size: 12px; }
.text-muted { color: var(--muted); font-size: 13px; }
.text-danger { color: var(--red); }

/* Responsive */
@media (max-width: 900px) {
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); }
  .dash-main-grid { grid-template-columns: 1fr; }
  .dash-panel-mb { margin-bottom: 16px; }
}

/* ── RESPONDR ───────────────────────────────────────────────────────────────── */
.respondr-wrap { display: flex; flex-direction: column; gap: 20px; max-width: 780px; }
.respondr-panel { padding: 20px; }
.respondr-textarea { width: 100%; min-height: 140px; resize: vertical; font-size: 14px; margin-bottom: 12px; }
.respondr-actions { display: flex; gap: 10px; align-items: center; }
.respondr-draft { white-space: pre-wrap; font-size: 14px; line-height: 1.7; color: var(--text); padding: 16px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; margin-bottom: 10px; }
.respondr-hint { font-size: 12px; color: var(--muted); }

/* ── RESPONDR HISTORY ────────────────────────────────────────────────────────── */
.respondr-log { display: flex; flex-direction: column; gap: 12px; }
.respondr-log-item { padding: 12px; background: var(--surface2); border: 1px solid var(--border); border-radius: 8px; }
.respondr-log-meta { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.respondr-log-q { font-size: 13px; color: var(--muted); margin-bottom: 6px; white-space: pre-wrap; }
.respondr-log-a { font-size: 13px; color: var(--text); white-space: pre-wrap; line-height: 1.6; }

/* ── ANALYTICS ───────────────────────────────────────────────────────────────── */
.an-connect-panel { padding: 48px; text-align: center; max-width: 480px; margin: 40px auto; }
.an-connect-icon { font-size: 48px; margin-bottom: 16px; }
.an-filter-bar { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 24px; }
.an-range-btn { padding: 6px 14px; border-radius: 20px; border: 1px solid var(--border); background: var(--surface); color: var(--muted); font-size: 13px; cursor: pointer; transition: all .15s; }
.an-range-btn:hover, .an-range-btn.active { background: var(--accent); color: #000; border-color: var(--accent); font-weight: 600; }
.an-custom-wrap { display: flex; align-items: center; gap: 8px; }
.an-date-input { width: 140px; font-size: 13px; }
.an-kpi-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; margin-bottom: 8px; }
.an-kpi-card { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 18px 16px; }
.an-kpi-highlight { border-color: var(--accent); background: var(--surface2); }
.an-kpi-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: 8px; }
.an-kpi-value { font-size: 24px; font-weight: 700; margin-bottom: 4px; }
.an-kpi-sub { font-size: 11px; color: var(--muted); }
.an-green { color: var(--green); }
.an-red { color: var(--red); }
.an-error { background: #2a1010; border: 1px solid var(--red); color: var(--red); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
@media (max-width: 1100px) { .an-kpi-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 700px) { .an-kpi-grid { grid-template-columns: repeat(2, 1fr); } }

/* ── LOGIN ───────────────────────────────────────────────────────────────────── */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: var(--bg); }
.login-card { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 40px 36px; width: 100%; max-width: 380px; }
.login-logo { font-size: 20px; font-weight: 700; color: var(--accent); margin-bottom: 4px; }
.login-sub { font-size: 13px; color: var(--muted); margin-bottom: 28px; }
.login-field { margin-bottom: 16px; }
.login-label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); margin-bottom: 6px; text-transform: uppercase; letter-spacing: .05em; }
.login-form .input { width: 100%; }
.login-btn { width: 100%; margin-top: 8px; padding: 10px; font-size: 15px; }
.login-error { background: #2a1010; border: 1px solid var(--red); color: var(--red); padding: 10px 14px; border-radius: 8px; font-size: 13px; margin-bottom: 16px; }
.nav-logout { margin-top: auto; color: var(--muted) !important; border-top: 1px solid var(--border); padding-top: 12px; }

/* ═══════════════════════════════════════════════════════════
   MOBILE — hamburger nav + responsive layouts
   ═══════════════════════════════════════════════════════════ */

.mobile-topbar {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 52px;
  background: var(--sidebar-bg);
  border-bottom: 1px solid var(--border);
  z-index: 500;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}
.mobile-logo { font-size: 15px; font-weight: 700; color: var(--accent); letter-spacing: .3px; }
.hamburger { background: none; border: none; color: var(--text); cursor: pointer; padding: 8px; border-radius: 6px; display: flex; flex-direction: column; justify-content: center; gap: 5px; width: 36px; height: 36px; }
.hamburger span { display: block; width: 20px; height: 2px; background: var(--text); border-radius: 2px; transition: transform .22s ease, opacity .22s ease; }
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; transform: scaleX(0); }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Close button inside sidebar — mobile only */
.sidebar-close-btn { display: none; }

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 399; }
.sidebar-overlay.visible { display: block; }

/* Prevent background scroll when sidebar open */
body.sb-open { overflow: hidden; }

@media (max-width: 768px) {
  .mobile-topbar { display: flex; }

  /* Sidebar: hidden off-screen, slides in via transform */
  .sidebar { transform: translateX(-100%); transition: transform .25s ease; z-index: 400; max-width: 80vw; }
  .sidebar.open { transform: translateX(0); }

  /* Close button at top of sidebar */
  .sidebar-close-btn {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 12px; right: 12px;
    width: 32px; height: 32px;
    background: rgba(255,255,255,.08); border: 1px solid var(--border);
    border-radius: 8px; color: var(--muted); font-size: 14px;
    cursor: pointer; transition: all .15s;
  }
  .sidebar-close-btn:hover { background: rgba(239,68,68,.15); color: var(--red); border-color: var(--red); }

  /* Content: full width, below topbar */
  .content { margin-left: 0 !important; padding: 16px; padding-top: 68px; max-width: 100%; }
  .content-wide { margin-left: 0 !important; padding: 16px; padding-top: 68px; }

  /* ── Grids → single column ── */
  .two-col         { grid-template-columns: 1fr; }
  .detail-grid     { grid-template-columns: 1fr; }
  .detail-grid-2   { grid-template-columns: 1fr; }
  .order-form-grid { grid-template-columns: 1fr; }

  /* ── Dashboard ── */
  .dash-hero-actions { display: none; }
  .dash-kpi-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; margin-bottom: 16px; }
  .dash-main-grid { grid-template-columns: 1fr; }
  .dash-hero { margin-bottom: 16px; }

  /* ── Page headers ── */
  .page-header { flex-direction: column; align-items: flex-start; gap: 10px; margin-bottom: 16px; }
  .header-actions { width: 100%; flex-wrap: wrap; }

  /* ── Journey kanban — horizontal scroll ── */
  .journey-board { grid-template-columns: none; display: flex; flex-direction: row; overflow-x: auto; -webkit-overflow-scrolling: touch; padding-bottom: 16px; min-height: auto; }
  .journey-col { min-width: 240px; flex-shrink: 0; }
  .journey-pipeline-strip { overflow-x: auto; flex-wrap: nowrap; }
  .journey-header { flex-direction: column; gap: 12px; }
  .journey-assign-form { width: 100%; flex-direction: column; align-items: stretch; }
  .hdr-drop-btn { min-width: 0; width: 100%; justify-content: space-between; }

  /* ── Inventory ── */
  .inv-toolbar { flex-direction: column; align-items: stretch; gap: 10px; margin-bottom: 16px; }
  .inv-toolbar-right { width: 100%; justify-content: space-between; }
  .inv-search-wrap { flex: 1; }
  .inv-search { width: 100%; }
  .inv-grid { grid-template-columns: 1fr; }
  .inv-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }

  /* ── Forms ── */
  .form-card { padding: 16px; max-width: 100%; }
  .log-form-row { flex-direction: column; }
  .detail-adjust-row { flex-wrap: wrap; }

  /* ── Contacts filter bar ── */
  .cf-date { flex: 1; min-width: 110px; }
  .cf-sort-wrap select { width: 100%; }

  /* ── Stat / misc ── */
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .contact-stats-row { flex-wrap: wrap; gap: 8px; }
  .panel-header { flex-wrap: wrap; gap: 8px; }
  .tab-row { overflow-x: auto; flex-wrap: nowrap; -webkit-overflow-scrolling: touch; padding-bottom: 4px; }
  .tab { white-space: nowrap; }

  /* ── Analytics ── */
  .an-kpi-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .an-filter-bar { flex-direction: column; align-items: flex-start; }
  .an-custom-wrap { flex-wrap: wrap; width: 100%; }
  .an-date-input { flex: 1; width: auto; }
  .an-connect-panel { padding: 24px 16px; }

  /* ── RESPONDR ── */
  .respondr-wrap { max-width: 100%; }
  .respondr-actions { flex-wrap: wrap; }

  /* ── Login ── */
  .login-card { margin: 16px; padding: 28px 20px; }
}

@media (max-width: 480px) {
  .content, .content-wide { padding: 10px; padding-top: 68px; }
  .panel { padding: 14px; }
  .dash-kpi-card { padding: 12px; gap: 10px; }
  .dash-kpi-badge { width: 50px; height: 50px; font-size: 8px; }
  .dash-kpi-badge svg { width: 16px; height: 16px; }
  .dash-kpi-num { font-size: 22px; }
  .dash-title { font-size: 20px; }
  .an-kpi-value { font-size: 18px; }
  .an-kpi-card { padding: 12px; }
  .stat-num { font-size: 22px; }
  .journey-col { min-width: 210px; }
  .inv-card-main { padding: 14px; }
  .detail-stock-num { font-size: 48px; }
}
