﻿/* =========================================================
   BINSIPA TRADERS – PRODUCTION CSS
   Clean • Optimized • Responsive • Structured
========================================================= */

/* ==============================
   1. ROOT VARIABLES
============================== */
:root {
  --bg-main: #f4f6f8;
  --white: #ffffff;

  --primary: #0b3d91;
  --blue: #2563eb;
  --green: #16a34a;
  --red: #dc2626;
  --orange: #f59e0b;

  --gray-100: #f3f4f6;
  --gray-300: #d1d5db;
  --gray-600: #4b5563;

  --radius-sm: 6px;
  --radius-md: 8px;
  --radius-lg: 12px;

  --shadow-sm: 0 2px 6px rgba(0,0,0,.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,.1);
  --shadow-lg: 0 14px 40px rgba(0,0,0,.35);

  --transition: 0.25s ease;
}

/* ==============================
   2. RESET
============================== */
*,
*::before,
*::after {
  box-sizing: border-box;
}

body, h1, h2, h3, p {
  margin: 0;
}

button, input, select {
  font-family: inherit;
  outline: none;
}

/* ==============================
   3. BASE
============================== */
body {
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--bg-main);
  color: #111;
  min-height: 100vh;
}

h1 {
  margin-bottom: 18px;
}

/* ==============================
   4. LAYOUT
============================== */
.layout {
  display: flex;
  min-height: 100vh;
}

.main {
  flex: 1;
  padding: 20px;
  overflow-y: auto;
}

.container {
  max-width: 1100px;
  margin: auto;
  padding: 20px;
}

/* =========================================
   PRO SIDEBAR SYSTEM
========================================= */

.sidebar {
  width: 220px;
  background: #111827;
  color: white;
  padding: 20px 15px;
  display: flex;
  flex-direction: column;
  transition: all .3s ease;
}

/* Logo */
.logo {
  font-size: 18px;
  font-weight: bold;
  text-align: center;
  color: #22c55e;
  margin-bottom: 20px;
}

/* Nav Items */
.nav-item {
  padding: 10px 12px;
  border-radius: 6px;
  color: white;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
  transition: background .2s ease;
}

.nav-item:hover,
.nav-item.active {
  background: #1f2933;
}

.nav-item.active {
  border-left: 4px solid #22c55e;
}

.nav-item i {
  min-width: 22px;
  text-align: center;
  font-size: 16px;
}

/* ================= DESKTOP COLLAPSE ================= */
@media (min-width: 769px) {

  .sidebar.collapsed {
    width: 70px;
    padding: 20px 8px;
  }

  .sidebar.collapsed .nav-item span,
  .sidebar.collapsed .logo {
    display: none;
  }

  .sidebar.collapsed .nav-item {
    justify-content: center;
  }
}

/* ================= MOBILE DRAWER ================= */
@media (max-width: 768px) {

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100%;
    transform: translateX(-100%);
    z-index: 1500;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    display: none;
    z-index: 1400;
  }

  .overlay.show {
    display: block;
  }
}


/* ==============================
   6. TOPBAR
============================== */
.topbar {
  position: sticky;
  top: 0;
  z-index: 1200;
  height: 52px;
  background: var(--primary);
  color: white;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  padding: 0 12px;
  box-shadow: var(--shadow-md);
}

.icon-btn {
  background: transparent;
  border: none;
  color: white;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--transition);
}

.icon-btn:hover {
  background: rgba(255,255,255,.15);
}

/* ==============================
   7. CARDS
============================== */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.card {
  background: var(--white);
  padding: 18px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  display: flex;
  gap: 15px;
  align-items: center;
  transition: transform var(--transition), box-shadow var(--transition);
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

.card.sales { border-left: 5px solid var(--green); }
.card.purchase { border-left: 5px solid var(--red); }
.card.profit { border-left: 5px solid var(--blue); }
.card.stock { border-left: 5px solid var(--orange); }

/* ==============================
   8. TABLE
============================== */
.table-wrap {
  margin-top: 10px;
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--white);
}

th {
  background: var(--primary);
  color: white;
  position: sticky;
  top: 0;
}

th, td {
  border: 1px solid var(--gray-300);
  padding: 10px;
  text-align: center;
}

/* ==============================
   9. BUTTONS
============================== */
.btn {
  padding: 8px 14px;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  font-weight: 600;
  transition: opacity var(--transition);
}

.btn:hover { opacity: .9; }

.btn.primary { background: var(--blue); color: white; }
.btn.success { background: var(--green); color: white; }
.btn.danger { background: var(--red); color: white; }
.btn.print { background: var(--primary); color: white; }
.btn.big { width: 100%; font-size: 16px; }

/* ==============================
   10. MODAL
============================== */
.modal-wrap {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  z-index: 2000;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,.5);
  backdrop-filter: blur(3px);
}

.modal {
  position: relative;
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 90%;
  box-shadow: var(--shadow-lg);
  animation: fadeIn .25s ease;
}

@keyframes fadeIn {
  from { transform: scale(.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

/* ==============================
   11. FORM ELEMENTS
============================== */
.field {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.field input,
.field select {
  flex: 1;
  padding: 8px;
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-sm);
}

/* ==============================
   12. BOX
============================== */
.box {
  background: var(--white);
  padding: 16px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  margin-bottom: 18px;
}

/* ==============================
   13. UTILITIES
============================== */
.text-center { text-align: center; }
.mt-10 { margin-top: 10px; }
.mt-20 { margin-top: 20px; }
.hidden { display: none !important; }

/* ==============================
   14. MOBILE RESPONSIVE
============================== */
@media (max-width: 768px) {

  .sidebar {
    position: fixed;
    height: 100%;
    transform: translateX(-100%);
    z-index: 1500;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.45);
    z-index: 1400;
    display: none;
  }

  .overlay.show {
    display: block;
  }

  .main {
    padding: 15px;
  }
}

/* ==============================
   15. PRINT
============================== */
@media print {
  thead { display: table-header-group; }
  tfoot { display: table-footer-group; }
  .table-wrap { max-height: none; }
}
.sidebar {
  width: 220px;
  background: #111827;
  color: white;
  transition: transform .3s ease;
}

/* Mobile only */
@media (max-width: 768px) {

  .sidebar {
    position: fixed;
    height: 100%;
    transform: translateX(-100%);
    z-index: 1500;
  }

  .sidebar.open {
    transform: translateX(0);
  }

  .overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.4);
    display: none;
    z-index: 1400;
  }

  .overlay.show {
    display: block;
  }
}
/* ==============================
   SIDEBAR MINI TOOLTIP
============================== */

.sidebar.collapsed .nav-item {
  position: relative;
}

/* Tooltip bubble */
.sidebar.collapsed .nav-item::after {
  content: attr(data-tooltip);
  position: absolute;
  left: 60px;
  top: 50%;
  transform: translateY(-50%);
  background: #111827;
  color: #fff;
  padding: 6px 10px;
  border-radius: 6px;
  white-space: nowrap;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 6px 16px rgba(0,0,0,.35);
  transition: opacity .15s ease, transform .15s ease;
}

/* Tooltip arrow */
.sidebar.collapsed .nav-item::before {
  content: "";
  position: absolute;
  left: 52px;
  top: 50%;
  transform: translateY(-50%);
  border: 6px solid transparent;
  border-right-color: #111827;
  opacity: 0;
  transition: opacity .15s ease;
}

/* Show on hover */
.sidebar.collapsed .nav-item:hover::after,
.sidebar.collapsed .nav-item:hover::before {
  opacity: 1;
}
.pos-layout{
  display:grid;
  grid-template-columns: 1.2fr 1fr;
  gap:16px;
}

.pos-left{
  min-width: 0;
}

.pos-right{
  min-width: 0;
}

@media (max-width: 900px){
  .pos-layout{
    grid-template-columns: 1fr;
  }
}
/* =========================
   POS PAGE POLISH
========================= */

/* Page title */
.page h1{
  font-size: 24px;
  margin: 10px 0 16px;
  display:flex;
  align-items:center;
  gap:10px;
}

/* Barcode + Product Row */
.box .field{
  background:#fff;
  border:1px solid #e5e7eb;
  border-radius:10px;
  padding:10px 12px;
}

.field i{ color:#2563eb; }

/* Inputs */
.field input, .field select{
  border:none;
  background:transparent;
  padding:8px 6px;
  font-size:14px;
}

/* Add Button */
.btn.primary{
  height:44px;
  border-radius:10px;
  font-size:15px;
  box-shadow:0 6px 16px rgba(37,99,235,.25);
}

/* Cart Table */
.box h3{
  display:flex;
  align-items:center;
  gap:8px;
}

table{
  background:#fff;
  border-radius:12px;
  overflow:hidden;
}

th{
  background:linear-gradient(135deg,#0b3d91,#2563eb);
  color:#fff;
  font-size:13px;
  letter-spacing:.2px;
}

td{
  font-size:14px;
}

tbody tr:nth-child(even){
  background:#f9fafb;
}

/* Totals card */
.total, .box h4{
  background:#f8fafc;
  border:1px dashed #e5e7eb;
  border-radius:10px;
  padding:10px 12px;
  margin-top:10px;
}

/* Payment box */
.box .field + .field{
  margin-top:8px;
}

/* Recent Sales */
.pos-right .box{
  position:sticky;
  top:64px;
}

#saleSearch{
  width:100%;
  padding:10px 12px;
  border:1px solid #e5e7eb;
  border-radius:10px;
  margin-bottom:8px;
  font-size:14px;
}

/* Action buttons */
.btn.print{
  background:#0b3d91;
  box-shadow:0 6px 14px rgba(11,61,145,.25);
}
.btn.primary{
  background:#2563eb;
}
.btn.danger{
  background:#dc2626;
}

/* Icon buttons */
.icon-btn{
  border-radius:10px;
}

/* POS layout spacing */
.pos-layout{
  margin-top:8px;
}

/* Mobile polish */
@media (max-width: 900px){
  .page h1{ font-size:20px; }
  .btn.primary{ height:42px; }
}
#salesRows tr:hover{
  background:#eef2ff;
}
.badge-paid{ background:#dcfce7; color:#166534; padding:4px 8px; border-radius:999px; font-weight:600; }
.badge-due{ background:#fee2e2; color:#991b1b; padding:4px 8px; border-radius:999px; font-weight:600; }
/* ===== ICON ACTION BUTTONS ===== */
.icon-btn{
  position:relative;
  border:none;
  background:#f1f5f9;
  color:#0f172a;
  padding:10px 12px;
  border-radius:10px;
  cursor:pointer;
  margin-right:6px;
  box-shadow:0 1px 2px rgba(0,0,0,.12);
  transition:.15s ease;
}

.icon-btn i{ font-size:18px; }

.icon-btn:hover{ transform:translateY(-1px); }

.icon-btn.edit{ background:#eef2ff; color:#3730a3; }
.icon-btn.delete{ background:#fee2e2; color:#b91c1c; }
.icon-btn.ledger{ background:#e0f2fe; color:#075985; }

/* ===== TOOLTIP ===== */
.icon-btn::after{
  content: attr(data-tip);
  position:absolute;
  bottom:120%;
  left:50%;
  transform:translateX(-50%);
  background:#020617;
  color:#fff;
  padding:6px 8px;
  border-radius:6px;
  font-size:12px;
  white-space:nowrap;
  opacity:0;
  pointer-events:none;
  transition:.15s;
}

.icon-btn:hover::after{ opacity:1; }

/* ===== MOBILE: no hover, show text on long press hint ===== */
@media (max-width: 640px){
  .icon-btn::after{ display:none; }
}

/* ===== MODAL ===== */
.modal.hidden{ display:none; }
.modal{
  position:fixed; inset:0; z-index:9999;
  display:flex; align-items:center; justify-content:center;
}
.modal-backdrop{
  position:absolute; inset:0; background:rgba(0,0,0,.5);
}
.modal-box{
  position:relative;
  background:#fff;
  padding:20px;
  border-radius:12px;
  max-width:320px;
  width:90%;
  box-shadow:0 10px 25px rgba(0,0,0,.25);
  animation: pop .15s ease;
}
@keyframes pop{ from{transform:scale(.95);opacity:.5} }

.modal-actions{
  display:flex; justify-content:flex-end; gap:10px; margin-top:15px;
}
.btn{
  padding:8px 14px; border:none; border-radius:8px; cursor:pointer;
  background:#e5e7eb;
}
.btn.danger{ background:#ef4444; color:#fff; }
.input-error{
  border:2px solid #ef4444 !important;
  animation: shake .2s linear 2;
}
@keyframes shake{
  0%{transform:translateX(0)}
  25%{transform:translateX(-3px)}
  50%{transform:translateX(3px)}
  75%{transform:translateX(-3px)}
}
/* ==============================
   SECURE LOGIN
============================== */
.auth-body {
  min-height: 100vh;
  background: #eef2f7;
  color: #0f172a;
}

.auth-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

.auth-panel {
  width: min(420px, 100%);
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  box-shadow: 0 18px 45px rgba(15, 23, 42, .18);
  padding: 28px;
}

.auth-brand {
  display: flex;
  gap: 14px;
  align-items: center;
  margin-bottom: 24px;
}

.auth-mark {
  width: 46px;
  height: 46px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #0b3d91;
  color: #fff;
  font-weight: 800;
  font-size: 22px;
}

.auth-brand h1 {
  margin: 0 0 4px;
  font-size: 24px;
}

.auth-brand p,
.auth-hint {
  color: #64748b;
  font-size: 14px;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form label {
  display: grid;
  gap: 7px;
  font-weight: 700;
  font-size: 14px;
}

.auth-form input {
  height: 44px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  padding: 0 12px;
  font-size: 15px;
  background: #fff;
}

.auth-form input:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .15);
}

.auth-submit {
  height: 44px;
  border: none;
  border-radius: 6px;
  background: #0b3d91;
  color: #fff;
  font-weight: 800;
  cursor: pointer;
}

.auth-submit:disabled {
  opacity: .7;
  cursor: wait;
}

.auth-message {
  min-height: 18px;
  color: #b91c1c;
  font-size: 14px;
}

.auth-message.success {
  color: #166534;
}

.hidden {
  display: none !important;
}

.auth-logout-btn {
  margin-left: 6px;
  background: rgba(255,255,255,.14) !important;
  color: #ffffff !important;
  font-weight: 700;
}

.auth-logout-btn:hover {
  background: rgba(255,255,255,.24) !important;
}

/* Sales item search */
#itemSearch {
  width: 100%;
}

/* Purchase entry polish */
.purchase-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
  gap: 10px;
  align-items: center;
}

.totals-panel {
  position: sticky;
  top: 64px;
}

.total-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid #e5e7eb;
}

.total-line.grand {
  font-size: 16px;
  color: #0b3d91;
}

.total-line.paid {
  color: #166534;
}

.total-line.due {
  color: #991b1b;
}

.purchase-save-btn {
  width: 100%;
  margin-top: 14px;
  height: 44px;
}

/* Compact purchase product picker */
.product-picker-field {
  position: relative;
  overflow: visible;
}

.product-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 1300;
  max-height: 260px;
  overflow-y: auto;
  background: #ffffff;
  border: 1px solid #dbe3ee;
  border-radius: 8px;
  box-shadow: 0 14px 32px rgba(15, 23, 42, .18);
  padding: 6px;
}

.product-result {
  width: 100%;
  border: 0;
  background: transparent;
  color: #0f172a;
  padding: 9px 10px;
  border-radius: 6px;
  text-align: left;
  display: grid;
  gap: 4px;
  cursor: pointer;
}

.product-result:hover,
.product-result:focus {
  background: #eef2ff;
}

.product-result-main {
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.product-result-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: #64748b;
  font-size: 12px;
}

.product-result-empty {
  padding: 10px;
  color: #64748b;
  font-size: 13px;
}

.selected-product-field {
  min-width: 0;
}

.selected-product-preview {
  min-width: 0;
  width: 100%;
  color: #64748b;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.selected-product-preview.has-selection {
  color: #0f172a;
  font-weight: 700;
}

.purchase-item-name {
  max-width: 260px;
}

.purchase-item-name b {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.purchase-item-name small {
  display: inline-block;
  margin-top: 3px;
  color: #166534;
  font-size: 12px;
}

.purchase-mini-input {
  width: 92px;
  min-width: 82px;
  padding: 7px 8px;
  border: 1px solid #d1d5db;
  border-radius: 6px;
}

/* Sales search result list */
.sales-search-wrap {
  display: grid;
  gap: 6px;
  min-width: min(100%, 360px);
}

.sales-search-wrap .product-results {
  position: static;
  max-height: 220px;
  margin-top: 0;
}

.auth-link-btn {
  border: 0;
  background: transparent;
  color: #0b3d91;
  font-weight: 700;
  cursor: pointer;
  padding: 4px 0;
  text-align: center;
}

.recovery-result {
  border: 1px solid #bbf7d0;
  background: #f0fdf4;
  color: #14532d;
  border-radius: 6px;
  padding: 10px;
  display: grid;
  gap: 5px;
  font-size: 14px;
}

.recovery-result span {
  font-family: Consolas, monospace;
  font-size: 18px;
  letter-spacing: 1px;
}

.recovery-result small {
  color: #166534;
}

/* Compact clean login screen */
.auth-body{
  min-height:100vh;
  margin:0;
  background:#ffffff;
  color:#111827;
  font-family:Arial, Helvetica, sans-serif;
}
.auth-shell{
  min-height:100vh;
  display:grid;
  place-items:center;
  padding:20px;
}
.auth-panel{
  width:276px;
  max-width:calc(100vw - 40px);
  background:#fff;
  border:0;
  border-radius:0;
  box-shadow:none;
  padding:0;
}
.auth-brand{
  display:block;
  margin:0 0 14px;
}
.auth-mark{display:none;}
.auth-brand h1{
  margin:0 0 6px;
  font-size:14px;
  line-height:1.2;
  font-weight:700;
  color:#0057a8;
}
.auth-brand p,
.auth-hint{
  margin:0;
  color:#5f6b7a;
  font-size:11px;
  line-height:1.35;
  font-weight:400;
}
.auth-form{
  display:grid;
  gap:12px;
}
.auth-form label{
  display:grid;
  gap:6px;
  font-size:11px;
  line-height:1.2;
  font-weight:400;
  color:#111827;
}
.auth-form input{
  width:100%;
  height:28px;
  box-sizing:border-box;
  border:1px solid #cbd4df;
  border-radius:2px;
  padding:0 8px;
  background:#eaf2ff;
  color:#111827;
  font-size:12px;
  outline:none;
}
.auth-form input:focus{
  border-color:#8eb6df;
  box-shadow:0 0 0 2px rgba(22,105,178,.12);
}
.password-field{
  position:relative;
  display:block;
}
.password-field input{
  padding-right:32px;
}
.password-field button{
  position:absolute;
  top:1px;
  right:1px;
  width:29px;
  height:26px;
  border:0;
  border-left:1px solid transparent;
  background:transparent;
  color:#657487;
  cursor:pointer;
  font-size:13px;
  line-height:1;
}
.auth-submit{
  height:33px;
  margin-top:6px;
  border:0;
  border-radius:3px;
  background:#176cae;
  color:#fff;
  font-size:12px;
  font-weight:700;
  cursor:pointer;
}
.auth-submit:hover{background:#075f9f;}
.auth-submit:disabled{opacity:.7;cursor:wait;}
.auth-link-btn{
  border:0;
  background:transparent;
  color:#176cae;
  font-size:11px;
  font-weight:400;
  cursor:pointer;
  padding:0;
  text-align:right;
}
#adminResetButton{
  color:#176cae;
  text-align:center;
  margin-top:2px;
}
.auth-message{
  min-height:14px;
  margin:0;
  color:#b91c1c;
  font-size:11px;
  line-height:1.35;
}
.auth-message.success{color:#166534;}
.recovery-result{
  border:1px solid #bbf7d0;
  background:#f0fdf4;
  color:#14532d;
  border-radius:4px;
  padding:8px;
  display:grid;
  gap:4px;
  font-size:11px;
}
.recovery-result span{
  font-family:Consolas, monospace;
  font-size:14px;
  letter-spacing:1px;
}
.recovery-result small{color:#166534;}
@media(max-width:420px){
  .auth-shell{place-items:start center;padding-top:48px;}
  .auth-panel{width:100%;max-width:276px;}
}
body.shop-request-mode .auth-panel{width:360px;}
body.shop-request-mode #shopRequestWrap{display:grid;gap:12px;}
body.shop-request-mode .auth-form{gap:11px;}
@media(max-width:420px){body.shop-request-mode .auth-panel{width:100%;max-width:340px;}}
/* ==============================
   Company brand + user dropdown
============================== */
.company-brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 0;
  font-weight: 800;
  line-height: 1;
}

.company-brand-logo,
.sidebar-logo-img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  border-radius: 7px;
  background: #fff;
  padding: 3px;
  box-shadow: 0 1px 4px rgba(0,0,0,.16);
}

.company-brand-name {
  max-width: min(44vw, 360px);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar .logo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: #fff;
}

.topbar-user-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  margin-left: 8px;
}

.profile-menu-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 38px;
  max-width: 190px;
  padding: 6px 9px;
  background: rgba(255,255,255,.12);
}

.profile-menu-btn:hover,
.profile-menu-btn[aria-expanded="true"] {
  background: rgba(255,255,255,.22);
}

.profile-avatar-sm {
  width: 26px;
  height: 26px;
  flex: 0 0 26px;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  color: var(--primary);
  font-weight: 900;
  font-size: 13px;
}

.profile-menu-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 700;
}

.profile-menu-caret {
  font-size: 11px;
  opacity: .9;
}

.profile-menu-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 9px);
  width: 230px;
  z-index: 2200;
  display: none;
  overflow: hidden;
  border: 1px solid #dbe3ef;
  border-radius: 10px;
  background: #fff;
  color: #0f172a;
  box-shadow: 0 16px 38px rgba(15,23,42,.24);
}

.profile-menu-panel.open {
  display: block;
}

.profile-menu-head {
  padding: 12px 14px;
  border-bottom: 1px solid #e5eaf2;
  background: #f8fafc;
}

.profile-menu-head b,
.profile-menu-head small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-menu-head small {
  margin-top: 3px;
  color: #64748b;
}

.profile-menu-panel a,
.profile-menu-panel button {
  width: 100%;
  display: flex;
  align-items: center;
  min-height: 42px;
  padding: 10px 14px;
  border: 0;
  border-bottom: 1px solid #eef2f7;
  background: #fff;
  color: #0f172a;
  text-align: left;
  text-decoration: none;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.profile-menu-panel a:hover,
.profile-menu-panel button:hover {
  background: #eef5ff;
  color: var(--primary);
}

.profile-menu-panel button:last-child {
  border-bottom: 0;
  color: #b91c1c;
}

@media (max-width: 720px) {
  .topbar {
    grid-template-columns: auto minmax(0,1fr) auto;
    gap: 6px;
  }

  .company-brand-name {
    max-width: 34vw;
  }

  .profile-menu-name {
    display: none;
  }

  .profile-menu-btn {
    max-width: 52px;
    padding: 6px 8px;
  }
}

/* Login cleanup: shop/admin tabs */
.auth-tabs{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:6px;
  margin:0 0 14px;
  padding:3px;
  border:1px solid #d8e3ef;
  border-radius:8px;
  background:#f4f7fb;
}
.auth-tab{
  height:30px;
  border:0;
  border-radius:6px;
  background:transparent;
  color:#475569;
  font-size:12px;
  font-weight:800;
  cursor:pointer;
}
.auth-tab.active{
  background:#176cae;
  color:#fff;
  box-shadow:0 4px 12px rgba(23,108,174,.18);
}
.auth-link-btn.subtle{
  color:#64748b;
  font-size:11px;
  margin-top:-6px;
}
