:root{
  --navy:#0f2f4f;
  --navy-2:#284f7c;
  --accent:#c49a6c;
  --accent-2:#e8cfb3;
  --bg:#f5f6f8;
  --card:#ffffff;
  --text:#132130;
  --muted:#64748b;
  --border:#dbe2ea;
  --ok:#188038;
  --err:#b42318;
  --info:#1d4ed8;
  --shadow:0 10px 30px rgba(15,47,79,.08);
  --radius:18px;
}

*{
  box-sizing:border-box;
}

html,
body{
  margin:0;
  padding:0;
  font-family:Segoe UI,Arial,sans-serif;
  background:var(--bg);
  color:var(--text);
}

a{
  color:inherit;
  text-decoration:none;
}

body.auth-page{
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:100vh;
  padding:24px;
  background:linear-gradient(180deg,#eef2f6,#f8f8f8);
}

/* TOPBAR */
.topbar{
  background:var(--navy);
  color:#fff;
  position:sticky;
  top:0;
  z-index:20;
  box-shadow:0 8px 24px rgba(0,0,0,.16);
}

.topbar .inner{
  max-width:1280px;
  margin:0 auto;
  padding:16px 18px;
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:18px;
}

.brand{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:220px;
}

.logo{
  width:42px;
  height:42px;
  border-radius:12px;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  display:grid;
  place-items:center;
  color:var(--navy);
  font-size:28px;
  font-weight:900;
  flex:0 0 auto;
}

.title{
  font-weight:800;
  line-height:1.05;
}

.title small{
  display:block;
  color:#d2deeb;
  font-weight:600;
  font-size:12px;
  margin-top:4px;
  line-height:1.2;
}

.nav{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
  align-items:center;
}

.nav a{
  padding:10px 14px;
  border-radius:12px;
  color:#eaf1f8;
  font-weight:700;
  transition:background .15s ease, transform .15s ease;
}

.nav a.active,
.nav a:hover{
  background:rgba(255,255,255,.12);
}

.rightbar{
  display:flex;
  align-items:center;
  justify-content:flex-end;
  gap:12px;
  flex-wrap:wrap;
  margin-left:auto;
  min-width:220px;
}

.site-link{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  padding:10px 16px;
  border-radius:999px;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:var(--navy);
  font-weight:900;
  font-size:13px;
  white-space:nowrap;
  border:1px solid rgba(255,255,255,.18);
  box-shadow:0 8px 20px rgba(0,0,0,.18);
  transition:transform .15s ease, box-shadow .15s ease, filter .15s ease;
}

.site-link:hover{
  transform:translateY(-1px);
  box-shadow:0 10px 24px rgba(0,0,0,.22);
  filter:brightness(1.02);
}

.rightbar .pill{
  display:inline-flex;
  align-items:center;
  justify-content:flex-start;
  min-width:220px;
  max-width:340px;
  padding:10px 14px;
  border-radius:999px;
  background:#fff;
  color:var(--text);
  border:1px solid rgba(255,255,255,.18);
  overflow:hidden;
}

#userEmail{
  display:block;
  width:100%;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
  color:var(--text);
  font-weight:700;
  font-size:13px;
}

/* LAYOUT */
.container{
  max-width:1280px;
  margin:0 auto;
  padding:24px 18px;
}

.grid{
  display:grid;
  grid-template-columns:repeat(12,1fr);
  gap:18px;
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  padding:20px;
}

.card h2,
.card h3{
  margin:0 0 10px;
}

.muted{
  color:var(--muted);
}

.small{
  font-size:12px;
  color:var(--muted);
}

.row{
  display:grid;
  grid-template-columns:1fr 1fr;
  gap:14px;
}

.row-3{
  display:grid;
  grid-template-columns:repeat(3,1fr);
  gap:14px;
}

.row-4{
  display:grid;
  grid-template-columns:repeat(4,1fr);
  gap:14px;
}

.split{
  display:grid;
  grid-template-columns:1.05fr .95fr;
  gap:18px;
}

/* HERO / DASHBOARD URL */
.dashboard-url{
  margin:12px 0 0;
  color:var(--navy);
  font-size:14px;
  font-weight:700;
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
}

.dashboard-url strong{
  display:inline-flex;
  align-items:center;
  padding:5px 12px;
  border-radius:999px;
  background:rgba(196,154,108,.14);
  border:1px solid rgba(196,154,108,.28);
  color:#6e4f36;
  font-weight:900;
  letter-spacing:.01em;
}

/* FORMS */
label{
  display:block;
  font-size:13px;
  font-weight:700;
  margin-bottom:6px;
  color:#334155;
}

input,
select,
textarea{
  width:100%;
  padding:12px 14px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  font:inherit;
  color:var(--text);
}

input:focus,
select:focus,
textarea:focus{
  outline:2px solid rgba(40,79,124,.16);
  border-color:var(--navy-2);
}

textarea{
  min-height:110px;
  resize:vertical;
}

/* BUTTONS */
.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  padding:12px 16px;
  border-radius:12px;
  border:1px solid var(--border);
  background:#fff;
  color:var(--text);
  font-weight:800;
  cursor:pointer;
  transition:transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.btn:hover{
  transform:translateY(-1px);
}

.btn.primary{
  background:var(--navy);
  color:#fff;
  border-color:var(--navy);
}

.btn.accent{
  background:var(--accent);
  color:#fff;
  border-color:var(--accent);
}

.btn.ghost{
  background:#f8fafc;
}

.btn.danger{
  background:#fff5f5;
  color:var(--err);
  border-color:#fecaca;
}

.btnRow{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
}

/* NOTICES */
.notice{
  padding:12px 14px;
  border-radius:12px;
  font-weight:700;
  margin-bottom:14px;
  display:none;
}

.notice.ok{
  display:block;
  background:#ecfdf3;
  color:#027a48;
  border:1px solid #abefc6;
}

.notice.err{
  display:block;
  background:#fef3f2;
  color:#b42318;
  border:1px solid #fecdca;
}

.notice.info{
  display:block;
  background:#eff6ff;
  color:#1d4ed8;
  border:1px solid #bfdbfe;
}

/* KPI */
.kpi{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.kpi .label{
  font-size:12px;
  color:var(--muted);
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.04em;
}

.kpi .value{
  font-size:30px;
  font-weight:900;
  color:var(--navy);
  line-height:1.1;
  white-space:pre-line;
}

/* TABLES */
.table-wrap{
  overflow:auto;
  border:1px solid var(--border);
  border-radius:14px;
  background:#fff;
}

table{
  width:100%;
  border-collapse:collapse;
}

th,
td{
  padding:12px 14px;
  border-bottom:1px solid #edf2f7;
  text-align:left;
  font-size:14px;
  vertical-align:top;
}

th{
  background:#f8fafc;
  color:#334155;
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.04em;
}

tr:hover td{
  background:#fcfdff;
}

/* BADGES / PILLS */
.badge,
.pill{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:6px 10px;
  border-radius:999px;
  font-weight:800;
  font-size:12px;
  border:1px solid var(--border);
  background:#fff;
}

.pill.ok{
  color:var(--ok);
}

.pill.err{
  color:var(--err);
}

/* AUTH */
.auth-card{
  width:min(520px,100%);
  background:#fff;
  padding:28px;
  border:1px solid var(--border);
  border-radius:24px;
  box-shadow:var(--shadow);
}

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

.auth-logo .logo{
  width:50px;
  height:50px;
}

.hero-title{
  font-size:28px;
  font-weight:900;
  color:var(--navy);
  margin:0 0 6px;
}

.subtle{
  font-size:14px;
  color:var(--muted);
}

/* STICKERS */
.previewWrap{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.sticker-wrap{
  border:1px dashed var(--border);
  border-radius:14px;
  padding:12px;
  background:#fff;
}

.sticker-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom:10px;
}

.sticker-head label{
  display:flex;
  align-items:center;
  gap:10px;
  margin:0;
}

.sticker{
  width:560px;
  height:440px;
  border:2px solid #183554;
  border-radius:14px;
  padding:18px;
  background:#fff;
  color:#132130;
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  overflow:hidden;
}

.st-hdr{
  display:flex;
  justify-content:space-between;
  gap:16px;
}

.st-company{
  font-size:18px;
  font-weight:900;
  line-height:1.08;
  color:#0f2f4f;
}

.st-customer{
  font-size:15px;
  font-weight:800;
  color:#6e4f36;
  margin-top:4px;
}

.st-prod{
  margin-top:18px;
  font-size:24px;
  font-weight:900;
  line-height:1.14;
}

.st-sku{
  margin-top:8px;
  font-size:20px;
  font-weight:900;
  font-family:ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;
  word-break:break-word;
}

.st-notes{
  margin-top:14px;
  font-size:14px;
  font-weight:700;
  color:#475569;
}

.st-badge{
  font-size:12px;
  padding:7px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  font-weight:900;
  color:#0f2f4f;
  background:#f8fafc;
}

.st-codes{
  display:flex;
  justify-content:space-between;
  align-items:flex-end;
  gap:16px;
}

.st-block{
  display:flex;
  flex-direction:column;
  align-items:center;
  gap:6px;
}

.st-small{
  font-size:12px;
  color:#64748b;
  font-weight:800;
}

.st-barcode svg{
  width:340px;
  height:92px;
}

.st-qr canvas{
  width:120px;
  height:120px;
}

/* TABS */
.tabs{
  display:flex;
  gap:8px;
  padding:6px;
  background:#f8fafc;
  border:1px solid var(--border);
  border-radius:14px;
}

.tab{
  flex:1;
  padding:12px;
  border:none;
  border-radius:12px;
  background:transparent;
  font-weight:900;
  cursor:pointer;
  color:var(--text);
}

.tab.active{
  background:var(--navy);
  color:#fff;
}

.hidden{
  display:none !important;
}

/* RESPONSIVE */
@media(max-width:1100px){
  .topbar .inner{
    align-items:flex-start;
    flex-wrap:wrap;
  }

  .nav{
    order:3;
    width:100%;
  }

  .rightbar{
    min-width:unset;
    margin-left:0;
  }
}

@media(max-width:980px){
  .row,
  .row-3,
  .row-4,
  .split{
    grid-template-columns:1fr;
  }

  .grid{
    grid-template-columns:1fr;
  }

  .card[style]{
    grid-column:auto !important;
  }

  .topbar .inner{
    flex-direction:column;
    align-items:flex-start;
  }

  .nav{
    width:100%;
  }

  .rightbar{
    width:100%;
    justify-content:flex-start;
  }

  .rightbar .pill{
    min-width:180px;
    max-width:100%;
  }

  .site-link{
    width:auto;
    max-width:100%;
  }
}

@media(max-width:640px){
  .container{
    padding:16px 12px;
  }

  .topbar .inner{
    padding:14px 12px;
  }

  .brand{
    width:100%;
  }

  .nav{
    display:grid;
    grid-template-columns:1fr 1fr;
    gap:8px;
  }

  .nav a{
    text-align:center;
    width:100%;
  }

  .rightbar{
    flex-direction:column;
    align-items:stretch;
  }

  .rightbar .pill{
    width:100%;
    max-width:100%;
  }

  .site-link{
    width:100%;
    text-align:center;
  }

  .btn{
    width:100%;
  }

  .btnRow .btn{
    width:auto;
  }

  .sticker{
    width:100%;
    height:auto;
    min-height:440px;
  }

  .st-codes{
    flex-direction:column;
    align-items:flex-start;
  }
}

/* PRINT */
@media print{
  .no-print{
    display:none !important;
  }

  body{
    background:#fff;
  }

  .container{
    padding:0;
  }

  .card{
    box-shadow:none;
    border:none;
  }
}
