*{box-sizing:border-box}

:root{
  --bg:#eef2f7;
  --bg-soft:#f7f9fc;
  --panel:#ffffff;
  --panel-2:#f9fbff;
  --text:#1f2937;
  --muted:#6b7280;
  --line:#e5e7eb;
  --shadow:0 16px 40px rgba(15,23,42,.08);
  --shadow-soft:0 8px 24px rgba(15,23,42,.06);
  --radius:22px;
  --radius-sm:14px;
  --accent:#4361ee;
  --accent-2:#5a73ff;
  --accent-rgb:67,97,238;
  --sidebar-bg:#ffffff;
  --sidebar-text:#1f2937;
  --sidebar-muted:#6b7280;
  --sidebar-active-text:#ffffff;
  --sidebar-active-bg:linear-gradient(135deg,var(--accent),var(--accent-2));
  --input-bg:#ffffff;
  --input-border:#dbe3ee;
  --badge-bg:rgba(var(--accent-rgb),.12);
  --badge-text:var(--accent);
  --danger:#ef4444;
  --success:#10b981;
  --warning:#f59e0b;
  --info:#0ea5e9;
  --topbar-bg:rgba(255,255,255,.75);
  --glass-border:rgba(255,255,255,.55);
}

body.theme-light.theme-blue{
  --accent:#4361ee;
  --accent-2:#5a73ff;
  --accent-rgb:67,97,238;
}
body.theme-light.theme-orange{
  --accent:#ff9800;
  --accent-2:#ffb547;
  --accent-rgb:255,152,0;
}
body.theme-light.theme-violet{
  --accent:#7c3aed;
  --accent-2:#9b5cff;
  --accent-rgb:124,58,237;
}
body.theme-light.theme-green{
  --accent:#10b981;
  --accent-2:#34d399;
  --accent-rgb:16,185,129;
}
body.theme-light.theme-red{
  --accent:#ef4444;
  --accent-2:#f87171;
  --accent-rgb:239,68,68;
}
body.theme-light.theme-teal{
  --accent:#0f766e;
  --accent-2:#14b8a6;
  --accent-rgb:15,118,110;
}
body.theme-light.theme-rose{
  --accent:#e11d48;
  --accent-2:#fb7185;
  --accent-rgb:225,29,72;
}

body.theme-dark{
  --bg:#0f172a;
  --bg-soft:#111827;
  --panel:#1b2434;
  --panel-2:#202b3f;
  --text:#f3f4f6;
  --muted:#94a3b8;
  --line:rgba(255,255,255,.08);
  --shadow:0 18px 50px rgba(0,0,0,.38);
  --shadow-soft:0 10px 30px rgba(0,0,0,.28);
  --sidebar-bg:#111827;
  --sidebar-text:#f3f4f6;
  --sidebar-muted:#94a3b8;
  --sidebar-active-text:#ffffff;
  --input-bg:#0f172a;
  --input-border:#334155;
  --badge-bg:rgba(var(--accent-rgb),.18);
  --badge-text:#dbeafe;
  --topbar-bg:rgba(17,24,39,.72);
  --glass-border:rgba(255,255,255,.06);
}

body.theme-dark.theme-blue{
  --accent:#4f6bff;
  --accent-2:#617cff;
  --accent-rgb:79,107,255;
}
body.theme-dark.theme-orange{
  --accent:#ff9d2f;
  --accent-2:#ffb75e;
  --accent-rgb:255,157,47;
}
body.theme-dark.theme-violet{
  --accent:#8b5cf6;
  --accent-2:#a78bfa;
  --accent-rgb:139,92,246;
}
body.theme-dark.theme-green{
  --accent:#22c55e;
  --accent-2:#4ade80;
  --accent-rgb:34,197,94;
}
body.theme-dark.theme-red{
  --accent:#f87171;
  --accent-2:#fb7185;
  --accent-rgb:248,113,113;
}
body.theme-dark.theme-teal{
  --accent:#14b8a6;
  --accent-2:#2dd4bf;
  --accent-rgb:20,184,166;
}
body.theme-dark.theme-rose{
  --accent:#f472b6;
  --accent-2:#fb7185;
  --accent-rgb:244,114,182;
}

html,body{min-height:100%}
body{
  margin:0;
  font-family:Arial,Helvetica,sans-serif;
  background:
    radial-gradient(circle at top left, rgba(var(--accent-rgb),.08), transparent 24%),
    radial-gradient(circle at bottom right, rgba(var(--accent-rgb),.05), transparent 22%),
    var(--bg);
  color:var(--text);
}

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

.layout{
  display:flex;
  min-height:100vh;
}

.sidebar{
  width:280px;
  background:var(--sidebar-bg);
  color:var(--sidebar-text);
  padding:26px 18px;
  position:sticky;
  top:0;
  height:100vh;
  border-right:1px solid var(--line);
  box-shadow:var(--shadow-soft);
  z-index:20;
  display:flex;
  flex-direction:column;
}

.sidebar .brand{
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:28px;
  font-weight:700;
  margin:4px 8px 24px;
  letter-spacing:-.02em;
}

.brand-logo-wrap{
  min-height:92px;
  padding:10px 8px 18px;
  border-bottom:1px solid var(--line);
  margin-bottom:16px !important;
}

.brand-logo-wrap.is-default-logo{
  background:transparent;
}

.brand-logo-wrap.is-company-logo{
  background:rgba(255,255,255,.96);
  border-radius:18px;
  padding:14px 12px;
  box-shadow:0 6px 18px rgba(15,23,42,.08);
}

body.theme-dark .brand-logo-wrap.is-company-logo{
  background:#ffffff;
  border:1px solid rgba(255,255,255,.06);
}

.brand-logo{
  display:block;
  max-width:180px;
  max-height:64px;
  width:auto;
  height:auto;
  object-fit:contain;
  margin:0 auto;
}

.sidebar-nav{
  display:flex;
  flex-direction:column;
  flex:1;
  min-height:0;
}

.sidebar-nav-main{
  display:flex;
  flex-direction:column;
  gap:8px;
}

.sidebar-nav-bottom{
  margin-top:auto;
  display:flex;
  flex-direction:column;
  gap:8px;
  padding-top:12px;
}

.sidebar nav a{
  display:flex;
  align-items:center;
  gap:12px;
  color:var(--sidebar-muted);
  padding:13px 14px;
  border-radius:16px;
  transition:.2s ease;
  font-weight:600;
}

.sidebar nav a:hover{
  background:rgba(var(--accent-rgb),.08);
  color:var(--sidebar-text);
}

.sidebar nav a.active{
  color:var(--sidebar-active-text);
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  box-shadow:0 10px 24px rgba(var(--accent-rgb),.28);
}

.sidebar nav .nav-spacer{
  height:10px;
}

.sidebar-footer-line{
  width:100%;
  height:1px;
  background:linear-gradient(90deg, transparent 0%, var(--accent) 20%, var(--accent-2) 80%, transparent 100%);
  opacity:.95;
  margin:6px 0 8px;
}

.sidebar-version{
  font-size:12px;
  color:var(--muted);
  text-align:left;
  padding:8px 14px 0;
}

.main{
  flex:1;
  padding:22px 24px 34px;
  display:flex;
  flex-direction:column;
}

.topbar{
  position:sticky;
  top:14px;
  z-index:15;
  backdrop-filter:blur(14px);
  background:var(--topbar-bg);
  border:1px solid var(--glass-border);
  padding:14px 18px;
  margin:0 0 22px;
  border-radius:22px;
  box-shadow:var(--shadow-soft);
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:16px;
}

.topbar-user{
  display:flex;
  align-items:center;
  gap:14px;
  min-width:0;
}

.topbar-avatar-wrap{
  flex:0 0 auto;
}

.topbar-avatar{
  width:52px;
  height:52px;
  border-radius:50%;
  object-fit:cover;
  display:block;
  border:2px solid rgba(var(--accent-rgb),.16);
  box-shadow:var(--shadow-soft);
}

.topbar-avatar-fallback{
  width:52px;
  height:52px;
  border-radius:50%;
  display:flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:20px;
  color:#fff;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  box-shadow:var(--shadow-soft);
}

.topbar-user-meta{
  display:flex;
  flex-direction:column;
  gap:4px;
  min-width:0;
}

.topbar-user-name{
  font-weight:700;
  font-size:17px;
  line-height:1.1;
}

.topbar-user-role{
  color:var(--muted);
  font-size:13px;
  line-height:1.2;
}

.topbar-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.topbar-icon-btn{
  width:42px;
  height:42px;
  border-radius:50%;
  border:1px solid var(--input-border);
  background:var(--panel);
  color:var(--text);
  cursor:pointer;
  font-size:16px;
  display:flex;
  align-items:center;
  justify-content:center;
  box-shadow:none;
}

.topbar-icon-btn:hover{
  background:rgba(var(--accent-rgb),.08);
}

.card{
  background:linear-gradient(180deg,var(--panel),var(--panel-2));
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:22px;
  margin-bottom:22px;
  box-shadow:var(--shadow);
}

.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
}

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

.stat{
  font-size:34px;
  font-weight:700;
  letter-spacing:-.03em;
  margin-top:8px;
}

.table-wrap{
  overflow:auto;
  border-radius:18px;
}

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

th,td{
  padding:13px 12px;
  border-bottom:1px solid var(--line);
  text-align:left;
  vertical-align:top;
}

th{
  background:rgba(var(--accent-rgb),.05);
  color:var(--text);
  font-weight:700;
}

tr:hover td{
  background:rgba(var(--accent-rgb),.025);
}

.btn{
  display:inline-flex;
  align-items:center;
  justify-content:center;
  gap:8px;
  min-height:42px;
  padding:10px 16px;
  border-radius:999px;
  background:linear-gradient(135deg,var(--accent),var(--accent-2));
  color:#fff;
  border:0;
  cursor:pointer;
  font-weight:700;
  box-shadow:0 10px 24px rgba(var(--accent-rgb),.24);
  transition:.2s ease;
}

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

.btn.light{
  background:transparent;
  color:var(--text);
  border:1px solid var(--input-border);
  box-shadow:none;
}

.btn.green{
  background:linear-gradient(135deg,#059669,#10b981);
}

.btn.red{
  background:linear-gradient(135deg,#dc2626,#ef4444);
}

form.inline{display:inline}

input[type=text],
input[type=email],
input[type=password],
input[type=number],
input[type=url],
input[type=date],
input[type=file],
select,
textarea{
  width:100%;
  padding:12px 14px;
  border:1px solid var(--input-border);
  border-radius:16px;
  background:var(--input-bg);
  color:var(--text);
  outline:none;
  transition:.2s ease;
}

input:focus,
select:focus,
textarea:focus{
  border-color:rgba(var(--accent-rgb),.55);
  box-shadow:0 0 0 4px rgba(var(--accent-rgb),.12);
}

label{
  display:block;
  font-weight:700;
  margin-bottom:8px;
  color:var(--text);
}

.row{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(220px,1fr));
  gap:16px;
}

.flash{
  padding:14px 16px;
  border-radius:16px;
  margin:0 0 15px;
  border:1px solid var(--line);
}

.flash.success{
  background:rgba(16,185,129,.10);
  color:#065f46;
}

.flash.error{
  background:rgba(239,68,68,.10);
  color:#991b1b;
}

body.theme-dark .flash.success{color:#a7f3d0}
body.theme-dark .flash.error{color:#fecaca}

.login-wrap{
  max-width:460px;
  margin:70px auto;
}

.login-hero{
  text-align:center;
  margin-bottom:18px;
}

.login-logo-box{
  display:flex;
  align-items:center;
  justify-content:center;
  margin:0 auto 18px;
  padding:14px;
}

.login-logo{
  display:block;
  max-width:240px;
  width:100%;
  height:auto;
  object-fit:contain;
}

.badge{
  display:inline-block;
  padding:5px 10px;
  border-radius:999px;
  background:var(--badge-bg);
  color:var(--badge-text);
  font-size:12px;
  font-weight:700;
  line-height:1.2;
  white-space:nowrap;
}

.badge.success{
  background:rgba(16,185,129,.14);
  color:#047857;
}

.badge.warning{
  background:rgba(245,158,11,.16);
  color:#b45309;
}

.badge.danger{
  background:rgba(239,68,68,.14);
  color:#b91c1c;
}

.badge.info{
  background:rgba(14,165,233,.14);
  color:#0369a1;
}

body.theme-dark .badge.success{color:#a7f3d0}
body.theme-dark .badge.warning{color:#fde68a}
body.theme-dark .badge.danger{color:#fecaca}
body.theme-dark .badge.info{color:#bae6fd}

.note,
.note-item{
  padding:13px 14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(var(--accent-rgb),.04);
  margin-bottom:10px;
}

.print-wrap{
  max-width:210mm;
  margin:20px auto;
  background:#fff;
  padding:20px;
  color:#111;
}

.thermal{
  max-width:80mm;
  font-size:13px;
}

.muted{color:var(--muted)}
.small{font-size:12px}
.actions{display:flex;gap:8px;flex-wrap:wrap;align-items:center}

.ef-section{
  margin-top:18px;
  border:1px solid var(--line);
  border-radius:18px;
  overflow:hidden;
  background:rgba(var(--accent-rgb),.02);
}

.ef-section-title{
  background:rgba(var(--accent-rgb),.07);
  padding:12px 16px;
  font-weight:700;
  font-size:14px;
  border-bottom:1px solid var(--line);
}

.ef-list{
  display:flex;
  flex-direction:column;
}

.ef-row{
  display:flex;
  justify-content:space-between;
  padding:12px 16px;
  border-bottom:1px solid var(--line);
  gap:12px;
}

.ef-row:last-child{
  border-bottom:none;
}

.ef-label{
  font-weight:700;
  color:var(--text);
  min-width:170px;
}

.ef-value{
  text-align:right;
  white-space:pre-wrap;
  word-break:break-word;
  color:var(--text);
  flex:1;
}

.ef-row:hover{
  background:rgba(var(--accent-rgb),.03);
}

.appearance-panel{
  position:fixed;
  top:86px;
  right:24px;
  width:360px;
  max-width:calc(100vw - 24px);
  background:linear-gradient(180deg,var(--panel),var(--panel-2));
  border:1px solid var(--line);
  border-radius:26px;
  box-shadow:var(--shadow);
  padding:20px;
  z-index:50;
  display:none;
}

.appearance-panel.open{
  display:block;
}

.appearance-panel h3{
  margin:0 0 8px;
}

.appearance-grid{
  display:grid;
  grid-template-columns:repeat(2,minmax(0,1fr));
  gap:12px;
  margin-top:12px;
}

.theme-choice{
  border:1px solid var(--input-border);
  border-radius:18px;
  padding:14px;
  cursor:pointer;
  background:var(--input-bg);
}

.theme-choice.active{
  border-color:rgba(var(--accent-rgb),.55);
  box-shadow:0 0 0 3px rgba(var(--accent-rgb),.14);
}

.color-swatches{
  display:flex;
  gap:10px;
  flex-wrap:wrap;
  margin-top:12px;
}

.swatch{
  width:36px;
  height:36px;
  border-radius:50%;
  border:3px solid transparent;
  cursor:pointer;
  box-shadow:var(--shadow-soft);
}

.swatch.active{
  border-color:#fff;
  outline:2px solid rgba(var(--accent-rgb),.55);
}

.swatch.blue{background:linear-gradient(135deg,#4361ee,#5a73ff)}
.swatch.orange{background:linear-gradient(135deg,#ff9800,#ffb547)}
.swatch.violet{background:linear-gradient(135deg,#7c3aed,#9b5cff)}
.swatch.green{background:linear-gradient(135deg,#10b981,#34d399)}
.swatch.red{background:linear-gradient(135deg,#ef4444,#f87171)}
.swatch.teal{background:linear-gradient(135deg,#0f766e,#14b8a6)}
.swatch.rose{background:linear-gradient(135deg,#e11d48,#fb7185)}

.separator{
  height:1px;
  background:var(--line);
  margin:16px 0;
}

.site-footer{
  margin-top:auto;
  padding-top:10px;
}

.site-footer-line{
  width:100%;
  height:1px;
  background:linear-gradient(90deg, transparent 0%, var(--accent) 20%, var(--accent-2) 80%, transparent 100%);
  opacity:.95;
  margin-bottom:10px;
}

.site-footer-text{
  font-size:13px;
  color:var(--muted);
  text-align:center;
  padding:2px 0 0;
}

@media (max-width: 1100px){
  .sidebar{width:230px}
  .brand-logo{max-width:150px;max-height:56px}
}

@media (max-width: 900px){
  .layout{display:block}
  .sidebar{
    position:relative;
    width:auto;
    height:auto;
    border-right:0;
    border-bottom:1px solid var(--line);
  }
  .main{padding:16px}
  .grid-2{grid-template-columns:1fr}
  .topbar{top:0}
  .appearance-panel{
    left:16px;
    right:16px;
    width:auto;
    max-width:none;
  }
  .brand-logo{
    max-width:140px;
    max-height:52px;
  }
  .login-logo{
    max-width:190px;
  }
  .sidebar-version{
    padding-bottom:6px;
  }
}

@media print{
  .no-print{display:none!important}
  body{background:#fff!important}
  .print-wrap{box-shadow:none;margin:0;max-width:none;padding:0}
}

/* UI titles + sidebar icons */
.sidebar nav a{
  gap:14px;
  font-size:15px;
}

.sidebar-menu-icon{
  width:24px;
  min-width:24px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  color:var(--accent);
  font-size:19px;
  line-height:1;
  transition:.2s ease;
}

.sidebar nav a:hover .sidebar-menu-icon{
  color:var(--accent);
  transform:scale(1.04);
}

.sidebar nav a.active .sidebar-menu-icon{
  color:#fff;
}

.page-hero{
  display:flex;
  align-items:center;
  gap:18px;
}

.page-hero-icon{
  width:72px;
  height:72px;
  object-fit:contain;
  flex:0 0 72px;
  display:block;
}

.page-hero-copy{
  min-width:0;
}

.page-hero-copy h1{
  margin:0 0 8px;
  line-height:1.1;
}

.page-hero-copy .muted{
  margin:0;
}

@media (max-width: 900px){
  .page-hero{
    align-items:flex-start;
  }
  .page-hero-icon{
    width:56px;
    height:56px;
    flex-basis:56px;
  }
  .sidebar-menu-icon{
    font-size:18px;
  }
}

/* ===== Order summary cards ===== */
.order-cards{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(220px, 1fr));
  gap:16px;
}

.order-card{
  position:relative;
  border-radius:16px;
  padding:20px;
  color:#fff;
  overflow:hidden;
  box-shadow:0 8px 20px rgba(0,0,0,0.08);
}

.order-card.total{
  background:linear-gradient(135deg, #4f6ef7, #6c8cff);
}

.order-card.status{
  background:linear-gradient(135deg, #6c5ce7, #8e7dff);
}

.order-card.payment{
  background:linear-gradient(135deg, #00b894, #00d1a7);
}

.order-card.shipping{
  background:linear-gradient(135deg, #f39c12, #ffb347);
}

.order-card::after{
  content:attr(data-icon);
  font-family:"Font Awesome 6 Free";
  font-weight:900;
  position:absolute;
  right:16px;
  bottom:10px;
  font-size:48px;
  opacity:0.15;
}

.order-card .label{
  font-size:13px;
  opacity:0.85;
}

.order-card .value{
  font-size:22px;
  font-weight:700;
  margin-top:6px;
}

.order-card .badge{
  margin-top:8px;
  display:inline-block;
  background:rgba(255,255,255,0.2);
  color:#fff;
  padding:4px 10px;
  border-radius:999px;
  font-size:12px;
}

.finance-card{
  border-radius:16px;
  padding:20px;
  color:#fff;
}

.finance-card.blue{
  background:linear-gradient(135deg,#4f6ef7,#6fa3ff);
}

.finance-card.orange{
  background:linear-gradient(135deg,#ff9b3d,#ff6a00);
}

.finance-card.green{
  background:linear-gradient(135deg,#27c093,#2ecc71);
}

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

/* ===== Common status / module pills ===== */
.module-state{
  display:inline-flex;
  align-items:center;
  gap:8px;
  padding:7px 12px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  line-height:1.2;
  border:1px solid transparent;
  white-space:nowrap;
}

.module-state::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:currentColor;
  opacity:.9;
}

.module-state.on{
  color:#047857;
  background:rgba(16,185,129,.14);
  border-color:rgba(16,185,129,.22);
}

.module-state.off{
  color:#b91c1c;
  background:rgba(239,68,68,.12);
  border-color:rgba(239,68,68,.20);
}

.module-state.inherit-on{
  color:#1d4ed8;
  background:rgba(59,130,246,.12);
  border-color:rgba(59,130,246,.18);
}

.module-state.inherit-off{
  color:#6b7280;
  background:rgba(107,114,128,.12);
  border-color:rgba(107,114,128,.18);
}

.module-state.override-on{
  color:#065f46;
  background:linear-gradient(135deg, rgba(16,185,129,.16), rgba(34,197,94,.12));
  border-color:rgba(16,185,129,.24);
}

.module-state.override-off{
  color:#991b1b;
  background:linear-gradient(135deg, rgba(239,68,68,.14), rgba(244,63,94,.10));
  border-color:rgba(239,68,68,.22);
}

body.theme-dark .module-state.on{color:#a7f3d0}
body.theme-dark .module-state.off{color:#fecaca}
body.theme-dark .module-state.inherit-on{color:#bfdbfe}
body.theme-dark .module-state.inherit-off{color:#cbd5e1}
body.theme-dark .module-state.override-on{color:#bbf7d0}
body.theme-dark .module-state.override-off{color:#fecdd3}

/* ===== Connection pills ===== */
.connection-pill{
  display:flex;
  align-items:flex-start;
  gap:10px;
  padding:10px 12px;
  border-radius:16px;
  border:1px solid var(--line);
  background:rgba(var(--accent-rgb),.04);
  min-width:220px;
}

.connection-pill-icon{
  width:28px;
  height:28px;
  min-width:28px;
  border-radius:50%;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-weight:700;
  font-size:14px;
  background:rgba(255,255,255,.75);
  box-shadow:var(--shadow-soft);
}

.connection-pill-title{
  font-size:13px;
  font-weight:700;
  line-height:1.25;
  margin-bottom:3px;
}

.connection-pill-text{
  font-size:12px;
  color:var(--muted);
  line-height:1.35;
}

.connection-pill.conn-ok{
  background:rgba(16,185,129,.08);
  border-color:rgba(16,185,129,.18);
}

.connection-pill.conn-ok .connection-pill-icon{
  color:#047857;
  background:rgba(16,185,129,.14);
}

.connection-pill.conn-stale{
  background:rgba(245,158,11,.08);
  border-color:rgba(245,158,11,.20);
}

.connection-pill.conn-stale .connection-pill-icon{
  color:#b45309;
  background:rgba(245,158,11,.15);
}

.connection-pill.conn-error{
  background:rgba(239,68,68,.08);
  border-color:rgba(239,68,68,.18);
}

.connection-pill.conn-error .connection-pill-icon{
  color:#b91c1c;
  background:rgba(239,68,68,.14);
}

body.theme-dark .connection-pill{
  background:rgba(255,255,255,.02);
}

body.theme-dark .connection-pill.conn-ok .connection-pill-icon{color:#a7f3d0}
body.theme-dark .connection-pill.conn-stale .connection-pill-icon{color:#fde68a}
body.theme-dark .connection-pill.conn-error .connection-pill-icon{color:#fecaca}

/* ===== Warehouse / stock / availability ===== */
.wh-badge,
.stock-chip,
.status-chip{
  display:inline-flex;
  align-items:center;
  gap:7px;
  padding:6px 11px;
  border-radius:999px;
  font-size:12px;
  font-weight:700;
  line-height:1.2;
  border:1px solid transparent;
  white-space:nowrap;
}

.wh-badge::before,
.stock-chip::before,
.status-chip::before{
  content:"";
  width:8px;
  height:8px;
  border-radius:50%;
  background:currentColor;
  opacity:.9;
}

.wh-badge.sell-without-stock{
  color:#b45309;
  background:rgba(245,158,11,.14);
  border-color:rgba(245,158,11,.22);
}

.wh-badge.deleted{
  color:#b91c1c;
  background:rgba(239,68,68,.12);
  border-color:rgba(239,68,68,.20);
}

.wh-badge.excluded{
  color:#6d28d9;
  background:rgba(139,92,246,.14);
  border-color:rgba(139,92,246,.22);
}

.wh-badge.variation{
  color:#1d4ed8;
  background:rgba(59,130,246,.12);
  border-color:rgba(59,130,246,.18);
}

.stock-chip.in-stock{
  color:#047857;
  background:rgba(16,185,129,.14);
  border-color:rgba(16,185,129,.22);
}

.stock-chip.low-stock{
  color:#b45309;
  background:rgba(245,158,11,.14);
  border-color:rgba(245,158,11,.22);
}

.stock-chip.out-of-stock{
  color:#b91c1c;
  background:rgba(239,68,68,.12);
  border-color:rgba(239,68,68,.20);
}

.status-chip.active{
  color:#047857;
  background:rgba(16,185,129,.14);
  border-color:rgba(16,185,129,.22);
}

.status-chip.disabled{
  color:#6b7280;
  background:rgba(107,114,128,.12);
  border-color:rgba(107,114,128,.20);
}

.status-chip.pending{
  color:#b45309;
  background:rgba(245,158,11,.14);
  border-color:rgba(245,158,11,.22);
}

.status-chip.error{
  color:#b91c1c;
  background:rgba(239,68,68,.12);
  border-color:rgba(239,68,68,.20);
}

body.theme-dark .wh-badge.sell-without-stock{color:#fde68a}
body.theme-dark .wh-badge.deleted{color:#fecaca}
body.theme-dark .wh-badge.excluded{color:#ddd6fe}
body.theme-dark .wh-badge.variation{color:#bfdbfe}
body.theme-dark .stock-chip.in-stock{color:#a7f3d0}
body.theme-dark .stock-chip.low-stock{color:#fde68a}
body.theme-dark .stock-chip.out-of-stock{color:#fecaca}
body.theme-dark .status-chip.active{color:#a7f3d0}
body.theme-dark .status-chip.disabled{color:#cbd5e1}
body.theme-dark .status-chip.pending{color:#fde68a}
body.theme-dark .status-chip.error{color:#fecaca}

/* ===== Small warehouse cards / summaries ===== */
.metric-card{
  border:1px solid var(--line);
  background:linear-gradient(180deg, rgba(var(--accent-rgb),.05), rgba(var(--accent-rgb),.02));
  border-radius:18px;
  padding:18px;
}

.metric-card .metric-label{
  font-size:13px;
  color:var(--muted);
  font-weight:700;
}

.metric-card .metric-value{
  margin-top:8px;
  font-size:28px;
  font-weight:700;
  letter-spacing:-.03em;
}

.metric-card .metric-help{
  margin-top:8px;
  font-size:12px;
  color:var(--muted);
}

.kpi-grid{
  display:grid;
  grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:16px;
}

/* ===== Better table helpers ===== */
.td-actions{
  white-space:nowrap;
}

.td-code code,
code.inline-code{
  display:inline-block;
  padding:5px 8px;
  border-radius:10px;
  background:rgba(var(--accent-rgb),.08);
  border:1px solid rgba(var(--accent-rgb),.12);
  font-size:12px;
}

.table-subtext{
  display:block;
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
}

.table-stack{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.table-stack.compact{gap:4px}

/* ===== Timeline / history blocks ===== */
.timeline{
  position:relative;
  margin:0;
  padding:0 0 0 22px;
  list-style:none;
}

.timeline::before{
  content:"";
  position:absolute;
  left:8px;
  top:0;
  bottom:0;
  width:2px;
  background:linear-gradient(180deg, rgba(var(--accent-rgb),.34), rgba(var(--accent-rgb),.08));
}

.timeline li{
  position:relative;
  margin:0 0 14px;
  padding:0 0 0 8px;
}

.timeline li::before{
  content:"";
  position:absolute;
  left:-18px;
  top:5px;
  width:10px;
  height:10px;
  border-radius:50%;
  background:var(--accent);
  box-shadow:0 0 0 4px rgba(var(--accent-rgb),.12);
}

.timeline-title{
  font-size:13px;
  font-weight:700;
}

.timeline-text{
  margin-top:4px;
  font-size:12px;
  color:var(--muted);
  line-height:1.4;
}

/* ===== Responsive helpers ===== */
@media (max-width: 1100px){
  .grid-3{
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width: 900px){
  .grid-3{
    grid-template-columns:1fr;
  }

  .connection-pill{
    min-width:0;
  }

  .table-wrap table{
    min-width:980px;
  }
}

/* ===== Sidebar toggle / responsive drawer ===== */
.sidebar-shell{
  position:relative;
  min-height:100%;
  display:flex;
  flex-direction:column;
}

.sidebar,
.main,
.sidebar nav a,
.sidebar-collapse-toggle,
.sidebar-collapse-left,
.sidebar-menu-icon,
.brand-logo-wrap,
.brand-logo,
.nav-group-title,
.sidebar-subnav,
.sidebar-collapse-caret{
  transition:
    width .30s cubic-bezier(.2,.8,.2,1),
    min-width .30s cubic-bezier(.2,.8,.2,1),
    padding .30s cubic-bezier(.2,.8,.2,1),
    margin .30s cubic-bezier(.2,.8,.2,1),
    transform .26s cubic-bezier(.2,.8,.2,1),
    opacity .18s ease,
    color .22s ease,
    background .22s ease,
    box-shadow .22s ease,
    border-color .22s ease;
}

.sidebar-close-btn{
  display:none;
}

.sidebar-toggle-btn{
  display:inline-flex;
}

.sidebar-overlay{
  position:fixed;
  inset:0;
  background:rgba(15,23,42,.46);
  backdrop-filter:blur(2px);
  opacity:0;
  visibility:hidden;
  pointer-events:none;
  transition:opacity .24s ease, visibility .24s ease;
  z-index:38;
}

body.sidebar-mobile-open .sidebar-overlay{
  opacity:1;
  visibility:visible;
  pointer-events:auto;
}

body.sidebar-collapsed .sidebar{
  width:86px !important;
  min-width:86px !important;
  padding:18px 10px 16px !important;
  overflow:hidden;
  border-right:0 !important;
  box-shadow:0 20px 40px rgba(15,23,42,.16), inset -1px 0 0 rgba(255,255,255,.06) !important;
  background:linear-gradient(180deg, rgba(var(--accent-rgb),.96) 0%, rgba(var(--accent-rgb),.78) 100%) !important;
}

body.theme-dark.sidebar-collapsed .sidebar{
  background:linear-gradient(180deg, rgba(15,23,42,.99) 0%, rgba(var(--accent-rgb),.34) 100%) !important;
  box-shadow:0 18px 42px rgba(0,0,0,.34), inset -1px 0 0 rgba(255,255,255,.08) !important;
}

body.sidebar-collapsed .sidebar .brand-logo-wrap{
  min-height:0;
  margin:0 0 14px !important;
  padding:0 0 14px;
  border-bottom-color:rgba(255,255,255,.16);
  background:transparent !important;
  box-shadow:none !important;
  border-radius:0 !important;
}

body.sidebar-collapsed .sidebar .brand-logo{
  max-width:42px;
  max-height:42px;
}

body.sidebar-collapsed .sidebar-nav-main{
  gap:10px;
  padding-right:0;
  overflow:visible;
}

body.sidebar-collapsed .nav-group{
  margin-bottom:10px;
}

body.sidebar-collapsed .nav-group-title,
body.sidebar-collapsed .sidebar-version,
body.sidebar-collapsed .sidebar nav a > span:last-child,
body.sidebar-collapsed .sidebar-collapse-left > span:last-child,
body.sidebar-collapsed .sidebar-collapse-caret,
body.sidebar-collapsed .sidebar-subnav{
  display:none !important;
}

body.sidebar-collapsed .sidebar nav a,
body.sidebar-collapsed .sidebar-collapse-toggle{
  width:100%;
  min-height:52px;
  padding:0;
  margin:0;
  border-radius:16px;
  justify-content:center;
  gap:0;
  color:rgba(255,255,255,.92) !important;
  background:transparent;
  box-shadow:none;
}

body.sidebar-collapsed .sidebar nav a:hover,
body.sidebar-collapsed .sidebar-collapse-toggle:hover{
  background:rgba(255,255,255,.12) !important;
  color:#fff !important;
  transform:translateY(-1px);
}

body.sidebar-collapsed .sidebar nav a.active,
body.sidebar-collapsed .sidebar-collapse.is-open .sidebar-collapse-toggle,
body.sidebar-collapsed .sidebar-collapse-toggle.is-active{
  background:rgba(255,255,255,.18) !important;
  color:#fff !important;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.14), 0 8px 20px rgba(15,23,42,.16) !important;
}

body.sidebar-collapsed .sidebar-collapse-left{
  width:100%;
  justify-content:center;
  gap:0;
}

body.sidebar-collapsed .sidebar-menu-icon{
  width:100%;
  min-width:0;
  justify-content:center;
  color:#fff !important;
  font-size:20px;
  transform:none !important;
}

body.sidebar-collapsed .sidebar nav a.active .sidebar-menu-icon,
body.sidebar-collapsed .sidebar-collapse.is-open .sidebar-menu-icon,
body.sidebar-collapsed .sidebar-collapse-toggle.is-active .sidebar-menu-icon{
  color:#fff !important;
}

body.sidebar-collapsed .sidebar-footer-line{
  margin:8px auto 10px;
  width:32px;
  background:rgba(255,255,255,.28);
}

body.sidebar-collapsed .sidebar-nav-bottom{
  gap:10px;
  padding-top:8px;
}

body.sidebar-collapsed .main{
  padding-left:22px;
}

@media (max-width: 980px){
  .layout{
    display:block;
  }

  .sidebar{
    position:fixed;
    left:0;
    top:0;
    bottom:0;
    width:min(320px, calc(100vw - 44px));
    min-width:0;
    height:100vh;
    transform:translateX(-106%);
    transition:transform .28s cubic-bezier(.2,.8,.2,1), box-shadow .24s ease;
    z-index:40;
    border-right:1px solid var(--line);
    border-bottom:0;
    padding:22px 16px 18px;
    overflow-y:auto;
  }

  body.sidebar-mobile-open .sidebar{
    transform:translateX(0);
    box-shadow:0 18px 44px rgba(15,23,42,.24);
  }

  .sidebar-close-btn{
    display:inline-flex;
    position:absolute;
    top:12px;
    right:8px;
    width:40px;
    height:40px;
    border-radius:12px;
    border:1px solid var(--input-border);
    background:var(--panel);
    color:var(--text);
    align-items:center;
    justify-content:center;
    cursor:pointer;
    box-shadow:var(--shadow-soft);
    z-index:2;
  }

  .sidebar-close-btn:hover{
    background:rgba(var(--accent-rgb),.08);
  }

  .main{
    padding:16px;
  }

  body.sidebar-collapsed .sidebar{
    width:min(320px, calc(100vw - 44px)) !important;
    min-width:0 !important;
    padding:22px 16px 18px !important;
    border-right:1px solid var(--line) !important;
    box-shadow:var(--shadow-soft) !important;
    background:var(--sidebar-bg) !important;
  }

  body.sidebar-collapsed .sidebar .brand-logo-wrap{
    min-height:92px;
    margin-bottom:16px !important;
    padding:10px 8px 18px;
    border-bottom:1px solid var(--line);
  }

  body.sidebar-collapsed .sidebar .brand-logo{
    max-width:140px;
    max-height:52px;
  }

  body.sidebar-collapsed .nav-group-title,
  body.sidebar-collapsed .sidebar-version,
  body.sidebar-collapsed .sidebar nav a > span:last-child,
  body.sidebar-collapsed .sidebar-collapse-left > span:last-child,
  body.sidebar-collapsed .sidebar-collapse-caret,
  body.sidebar-collapsed .sidebar-subnav{
    display:initial !important;
  }

  body.sidebar-collapsed .sidebar nav a,
  body.sidebar-collapsed .sidebar-collapse-toggle{
    min-height:unset;
    padding:13px 14px;
    justify-content:flex-start;
    gap:12px;
    color:var(--sidebar-muted) !important;
    background:transparent !important;
    box-shadow:none !important;
    transform:none !important;
  }

  body.sidebar-collapsed .sidebar-menu-icon{
    width:24px;
    min-width:24px;
    font-size:19px;
    color:var(--accent) !important;
  }

  body.sidebar-collapsed .sidebar nav a.active .sidebar-menu-icon{
    color:#fff !important;
  }

  body.sidebar-collapsed .sidebar-collapse-left{
    width:auto;
    justify-content:flex-start;
    gap:12px;
  }

  body.sidebar-collapsed .sidebar-nav-bottom{
    gap:8px;
    padding-top:12px;
  }

  body.sidebar-collapsed .sidebar-footer-line{
    width:100%;
    margin:6px 0 8px;
    background:linear-gradient(90deg, transparent 0%, var(--accent) 20%, var(--accent-2) 80%, transparent 100%);
  }

  body.sidebar-collapsed .main{
    padding-left:16px;
  }
}


/* ===== Login theme-aware redesign ===== */
body.login-page{
  --login-screen-bg:
    radial-gradient(circle at 12% 12%, rgba(var(--accent-rgb), .12), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(var(--accent-rgb), .10), transparent 20%),
    linear-gradient(180deg, rgba(255,255,255,.32), rgba(255,255,255,0)),
    var(--bg);
  --login-surface-bg:linear-gradient(180deg, rgba(255,255,255,.58), rgba(255,255,255,.34));
  --login-surface-border:rgba(255,255,255,.56);
  --login-form-bg:linear-gradient(180deg, rgba(255,255,255,.84), rgba(255,255,255,.68));
  --login-form-border:rgba(255,255,255,.62);
  --login-visual-bg:linear-gradient(145deg, rgba(var(--accent-rgb),.18), rgba(15,23,42,.18));
  --login-visual-panel:linear-gradient(180deg, rgba(255,255,255,.18), rgba(255,255,255,.06));
  --login-visual-border:rgba(255,255,255,.26);
  --login-shadow:0 36px 100px rgba(15,23,42,.16);
  --login-floating-shadow:0 22px 50px rgba(15,23,42,.18);
}

body.theme-dark.login-page{
  --login-screen-bg:
    radial-gradient(circle at 12% 12%, rgba(var(--accent-rgb), .16), transparent 24%),
    radial-gradient(circle at 88% 18%, rgba(var(--accent-rgb), .14), transparent 20%),
    linear-gradient(180deg, rgba(15,23,42,.10), rgba(15,23,42,0)),
    var(--bg);
  --login-surface-bg:linear-gradient(180deg, rgba(17,24,39,.76), rgba(17,24,39,.58));
  --login-surface-border:rgba(255,255,255,.08);
  --login-form-bg:linear-gradient(180deg, rgba(17,24,39,.92), rgba(17,24,39,.72));
  --login-form-border:rgba(255,255,255,.08);
  --login-visual-bg:linear-gradient(145deg, rgba(var(--accent-rgb),.30), rgba(15,23,42,.85));
  --login-visual-panel:linear-gradient(180deg, rgba(255,255,255,.10), rgba(255,255,255,.04));
  --login-visual-border:rgba(255,255,255,.12);
  --login-shadow:0 40px 110px rgba(0,0,0,.38);
  --login-floating-shadow:0 24px 60px rgba(0,0,0,.28);
}

body.login-page{
  background:var(--login-screen-bg);
}

body.login-page .layout{
  display:block;
  min-height:100vh;
}

body.login-page .main{
  display:block;
  padding:0;
}

body.login-page .topbar,
body.login-page .sidebar,
/*body.login-page .site-footer,*/
body.login-page .appearance-panel,
body.login-page .sidebar-overlay{
  display:none !important;
}

.login-screen{
  min-height:calc(100vh - 72px);
  display:flex;
  align-items:center;
  justify-content:center;
  padding:24px 24px 12px;
}

.login-surface{
  width:min(1140px, 100%);
  background:var(--login-surface-bg);
  border:1px solid var(--login-surface-border);
  border-radius:32px;
  box-shadow:var(--login-shadow);
  backdrop-filter:blur(14px);
  overflow:hidden;
}

.login-shell.login-shell-split{
  display:grid;
  grid-template-columns:minmax(340px, 430px) minmax(0, 1fr);
  min-height:660px;
}

.login-panel{
  min-width:0;
}

.login-panel-form{
  padding:40px 32px 26px;
  background:var(--login-form-bg);
  border-right:1px solid var(--login-form-border);
  display:flex;
  flex-direction:column;
  justify-content:space-between;
  gap:22px;
}

.login-brand-lockup{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.login-logo-box-split{
  justify-content:flex-start;
  margin:0;
  padding:0;
}

.login-brand-text{
  font-size:14px;
  font-weight:700;
  letter-spacing:.01em;
}

.login-form-copy{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.login-eyebrow{
  display:inline-flex;
  align-items:center;
  gap:8px;
  width:max-content;
  padding:7px 12px;
  border-radius:999px;
  background:rgba(var(--accent-rgb), .12);
  color:var(--accent);
  font-size:12px;
  font-weight:700;
}

.login-form-copy h1{
  margin:0;
  font-size:38px;
  line-height:1.04;
  letter-spacing:-.04em;
}

.login-form-copy p{
  margin:0;
  font-size:15px;
  line-height:1.5;
  max-width:400px;
}

.login-card-form{
  margin:0;
  padding:22px;
  border-radius:24px;
  background:linear-gradient(180deg, rgba(255,255,255,.38), rgba(255,255,255,.12));
  border:1px solid rgba(255,255,255,.34);
  box-shadow:0 18px 42px rgba(15,23,42,.10);
}

body.theme-dark .login-card-form{
  background:linear-gradient(180deg, rgba(255,255,255,.05), rgba(255,255,255,.02));
  border-color:rgba(255,255,255,.08);
  box-shadow:0 18px 42px rgba(0,0,0,.18);
}

.login-form-grid{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.login-field label{
  margin-bottom:10px;
  font-size:14px;
}

.login-field input{
  min-height:54px;
  border-radius:18px;
  font-size:15px;
  padding:13px 15px;
}

.login-actions-row{
  display:flex;
  gap:10px;
  padding-top:2px;
}

.login-submit-btn{
  min-width:160px;
  min-height:48px;
  font-size:15px;
}

.login-bottom-note{
  line-height:1.5;
  font-size:13px;
}

.login-panel-visual{
  position:relative;
  overflow:hidden;
  background:var(--login-visual-bg);
  display:flex;
  align-items:center;
  justify-content:center;
  isolation:isolate;
}

.login-visual-bg,
.login-visual-overlay{
  position:absolute;
  inset:0;
}

.login-visual-bg{
  background:
    radial-gradient(circle at 18% 22%, rgba(255,255,255,.22), transparent 22%),
    radial-gradient(circle at 84% 18%, rgba(255,255,255,.18), transparent 20%),
    radial-gradient(circle at 78% 82%, rgba(255,255,255,.12), transparent 24%),
    linear-gradient(145deg, rgba(var(--accent-rgb),.18), rgba(15,23,42,.10));
  opacity:.95;
}

.login-visual-overlay{
  background:
    linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,255,255,0)),
    radial-gradient(circle at 65% 50%, rgba(255,255,255,.08), transparent 30%);
}

.login-floating-card,
.login-visual-main-card{
  position:absolute;
  z-index:2;
  border:1px solid var(--login-visual-border);
  background:var(--login-visual-panel);
  box-shadow:var(--login-floating-shadow);
  backdrop-filter:blur(16px);
}

.login-floating-card{
  border-radius:22px;
  padding:18px 20px;
  min-width:260px;
}

.login-floating-card-top{
  top:34px;
  left:34px;
}

.login-floating-card-bottom{
  left:38px;
  right:38px;
  bottom:34px;
  display:grid;
  grid-template-columns:repeat(2, minmax(0, 1fr));
  gap:14px;
}

.login-floating-label{
  font-size:12px;
  font-weight:700;
  text-transform:uppercase;
  letter-spacing:.06em;
  color:rgba(255,255,255,.84);
}

.login-floating-value{
  margin-top:8px;
  font-size:22px;
  font-weight:700;
  line-height:1.15;
  color:#fff;
}

.login-floating-sub{
  margin-top:8px;
  color:rgba(255,255,255,.72);
}

.login-visual-center{
  position:relative;
  width:min(560px, calc(100% - 100px));
  height:420px;
  z-index:1;
}

.login-visual-orb{
  position:absolute;
  border-radius:50%;
  filter:blur(2px);
}

.login-visual-orb-a{
  width:260px;
  height:260px;
  top:16px;
  left:24px;
  background:radial-gradient(circle, rgba(var(--accent-rgb),.54) 0%, rgba(var(--accent-rgb),.08) 70%, transparent 100%);
}

.login-visual-orb-b{
  width:190px;
  height:190px;
  right:18px;
  bottom:26px;
  background:radial-gradient(circle, rgba(255,255,255,.28) 0%, rgba(255,255,255,.06) 68%, transparent 100%);
}

.login-visual-main-card{
  inset:80px 56px 76px 56px;
  border-radius:34px;
  display:flex;
  flex-direction:column;
  align-items:flex-start;
  justify-content:center;
  gap:22px;
  padding:34px;
}

.login-visual-main-icon{
  width:88px;
  height:88px;
  border-radius:26px;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:36px;
  color:#fff;
  background:linear-gradient(135deg, rgba(255,255,255,.24), rgba(255,255,255,.10));
  border:1px solid rgba(255,255,255,.24);
}

.login-visual-main-copy{
  display:flex;
  flex-direction:column;
  gap:10px;
  color:#fff;
}

.login-visual-main-copy strong{
  font-size:28px;
  line-height:1.1;
  letter-spacing:-.03em;
}

.login-visual-main-copy span{
  font-size:15px;
  line-height:1.6;
  color:rgba(255,255,255,.82);
}

.login-mini-stat{
  display:flex;
  flex-direction:column;
  gap:6px;
}

.login-mini-stat-label{
  font-size:12px;
  text-transform:uppercase;
  letter-spacing:.05em;
  color:rgba(255,255,255,.72);
}

.login-mini-stat strong{
  font-size:18px;
  color:#fff;
}

@media (max-width: 1200px){
  .login-screen{
    padding:20px 20px 10px;
  }

  .login-shell.login-shell-split{
    grid-template-columns:minmax(320px, 390px) minmax(0, 1fr);
    min-height:600px;
  }

  .login-panel-form{
    padding:34px 28px 24px;
  }

  .login-form-copy h1{
    font-size:34px;
  }

  .login-floating-card-top{
    top:26px;
    left:26px;
  }

  .login-floating-card-bottom{
    left:26px;
    right:26px;
    bottom:26px;
  }

  .login-visual-center{
    width:min(460px, calc(100% - 64px));
    height:340px;
  }
}

@media (max-width: 980px){
  body.login-page .main{
    padding:0;
  }

  .login-screen{
    min-height:auto;
    padding:16px 16px 10px;
    align-items:stretch;
  }

  .login-surface{
    border-radius:26px;
  }

  .login-shell.login-shell-split{
    grid-template-columns:1fr;
    min-height:auto;
  }

  .login-panel-form{
    border-right:0;
    border-bottom:1px solid var(--login-form-border);
    padding:24px 20px 20px;
  }

  .login-form-copy h1{
    font-size:30px;
  }

  .login-panel-visual{
    min-height:320px;
  }

  .login-visual-center{
    width:min(390px, calc(100% - 40px));
    height:250px;
  }

  .login-visual-main-card{
    inset:34px 24px 38px 24px;
    padding:20px;
    border-radius:24px;
  }

  .login-visual-main-icon{
    width:72px;
    height:72px;
    border-radius:22px;
    font-size:28px;
  }

  .login-visual-main-copy strong{
    font-size:22px;
  }

  .login-floating-card{
    min-width:0;
    padding:14px 16px;
  }

  .login-floating-card-top{
    top:18px;
    left:18px;
    right:18px;
  }

  .login-floating-card-bottom{
    left:16px;
    right:16px;
    bottom:16px;
    grid-template-columns:1fr 1fr;
  }
}

@media (max-width: 640px){
  .login-screen{
    min-height:auto;
    padding:8px 8px 6px;
  }

  .login-surface{
    border-radius:20px;
  }

  .login-panel-form{
    padding:20px 14px 16px;
    gap:16px;
  }

  .login-form-copy h1{
    font-size:26px;
  }

  .login-form-copy p{
    font-size:14px;
  }

  .login-card-form{
    padding:16px;
    border-radius:20px;
  }

  .login-field input{
    min-height:50px;
    font-size:15px;
  }

  .login-submit-btn{
    width:100%;
  }

  .login-panel-visual{
    min-height:250px;
  }

  .login-visual-center{
    width:calc(100% - 24px);
    height:200px;
  }

  .login-visual-main-card{
    inset:24px 14px 28px 14px;
    gap:12px;
    padding:16px;
  }

  .login-visual-main-copy strong{
    font-size:18px;
  }

  .login-visual-main-copy span{
    font-size:13px;
    line-height:1.45;
  }

  .login-floating-card-top{
    display:none;
  }

  .login-floating-card-bottom{
    grid-template-columns:1fr;
    gap:10px;
  }
}

/* ===== Order view compact redesign ===== */
.order-view-hero{
  display:flex;
  align-items:flex-start;
  gap:16px;
  min-width:0;
}

.order-view-hero-icon{
  width:64px;
  height:64px;
  object-fit:contain;
  flex:0 0 64px;
  display:block;
}

.order-view-hero-copy{
  min-width:0;
}

.order-view-hero-copy h1{
  margin:0 0 8px;
  line-height:1.1;
}

.order-view-hero-copy .muted{
  margin:0;
}

.order-print-btn{
  width:46px;
  height:46px;
  min-width:46px;
  padding:0;
  border-radius:14px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  font-size:18px;
}

.order-page-head-card{
  padding-bottom:18px;
}

.order-page-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
}

.order-page-actions{
  display:flex;
  align-items:center;
  gap:10px;
  flex-wrap:wrap;
}

.order-inline-summary{
  display:grid;
  grid-template-columns:repeat(4,minmax(0,1fr));
  gap:12px;
  margin-top:18px;
}

.order-inline-summary-item{
  border:1px solid var(--line);
  border-radius:18px;
  padding:14px 16px;
  background:rgba(var(--accent-rgb),.04);
  min-width:0;
}

.order-inline-summary-label{
  display:block;
  font-size:12px;
  font-weight:700;
  color:var(--muted);
  margin-bottom:6px;
  text-transform:uppercase;
  letter-spacing:.03em;
}

.order-inline-summary-value{
  display:block;
  font-size:16px;
  font-weight:700;
  line-height:1.35;
  word-break:break-word;
}

.order-inline-summary-value.status-default{color:#64748b}
.order-inline-summary-value.status-pending{color:#b45309}
.order-inline-summary-value.status-processing{color:#1d4ed8}
.order-inline-summary-value.status-completed{color:#047857}
.order-inline-summary-value.status-cancelled{color:#b91c1c}
.order-inline-summary-value.status-refunded{color:#7c3aed}
.order-inline-summary-value.status-failed{color:#be123c}
.order-inline-summary-value.status-onhold{color:#6d28d9}

body.theme-dark .order-inline-summary-value.status-default{color:#cbd5e1}
body.theme-dark .order-inline-summary-value.status-pending{color:#fde68a}
body.theme-dark .order-inline-summary-value.status-processing{color:#bfdbfe}
body.theme-dark .order-inline-summary-value.status-completed{color:#a7f3d0}
body.theme-dark .order-inline-summary-value.status-cancelled{color:#fecaca}
body.theme-dark .order-inline-summary-value.status-refunded{color:#ddd6fe}
body.theme-dark .order-inline-summary-value.status-failed{color:#fecdd3}
body.theme-dark .order-inline-summary-value.status-onhold{color:#ddd6fe}

.order-main-card{
  padding:20px;
}

.order-section-head{
  display:flex;
  align-items:flex-start;
  justify-content:space-between;
  gap:16px;
  margin-bottom:16px;
}

.order-section-head h2,
.order-delete-head h2{
  margin:0 0 6px;
}

.order-detail-grid{
  display:grid;
  grid-template-columns:repeat(3,minmax(0,1fr));
  gap:14px;
  margin-bottom:14px;
}

.order-detail-grid-secondary{
  grid-template-columns:minmax(260px,.95fr) minmax(320px,1.05fr);
}

.order-detail-box{
  border:1px solid var(--line);
  border-radius:18px;
  padding:16px;
  background:rgba(var(--accent-rgb),.03);
  min-width:0;
}

.order-detail-box-title,
.order-detail-subtitle{
  font-size:14px;
  font-weight:700;
  margin-bottom:12px;
}

.order-detail-list.compact{
  display:flex;
  flex-direction:column;
  gap:10px;
}

.order-detail-item{
  display:grid;
  grid-template-columns:140px minmax(0,1fr);
  gap:10px;
  align-items:start;
  font-size:13px;
  line-height:1.45;
}

.order-detail-item-block{
  grid-template-columns:1fr;
  gap:6px;
}

.order-detail-label{
  color:var(--muted);
  font-weight:700;
}

.order-detail-value{
  color:var(--text);
  word-break:break-word;
}

.order-detail-value.strong{
  font-weight:700;
}

.order-detail-value.multiline{
  white-space:normal;
}

.order-shipping-card{
  margin-bottom:14px;
}

.order-status-inline-box{
  padding-top:12px;
  border-top:1px dashed var(--line);
}

.order-status-inline-form{
  margin:0;
}

.order-status-inline-fields{
  display:grid;
  grid-template-columns:minmax(0,1fr) auto;
  gap:10px;
  align-items:end;
}

.order-status-inline-submit{
  min-width:140px;
}

.order-source-box{
  display:flex;
  flex-direction:column;
  justify-content:center;
}

.order-source-inline{
  display:grid;
  grid-template-columns:minmax(0,1fr) 92px;
  gap:14px;
  align-items:center;
}

.order-source-copy{
  min-width:0;
}

.order-source-name{
  font-size:17px;
  font-weight:800;
  line-height:1.25;
}

.order-source-meta{
  margin-top:6px;
  font-size:12px;
  color:var(--muted);
  word-break:break-word;
}

.order-source-image{
  width:92px;
  max-width:92px;
  max-height:72px;
  object-fit:contain;
  justify-self:end;
}

.order-customer-note{
  margin-bottom:14px;
  padding:12px 14px;
  border:1px solid var(--line);
  border-radius:16px;
  background:rgba(var(--accent-rgb),.04);
}

.order-customer-note-text{
  font-size:13px;
  line-height:1.5;
}

.order-note-form{
  margin-bottom:14px;
}

.order-note-form-actions{
  margin-top:10px;
}

.order-notes-list{
  display:flex;
  flex-direction:column;
  gap:10px;
  max-height:260px;
  overflow:auto;
  padding-right:4px;
}

.order-note-item{
  margin-bottom:0;
  font-size:13px;
  line-height:1.5;
}

.order-products-block{
  margin-top:2px;
  border-top:1px solid var(--line);
  padding-top:16px;
}

.order-products-title{
  margin-bottom:6px;
}

.order-products-help{
  margin-bottom:12px;
}

.order-products-table-wrap table{
  min-width:760px;
}

.order-delete-card{
  border:1px solid rgba(220,38,38,.22);
}

.order-delete-head{
  justify-content:space-between;
  align-items:flex-start;
  gap:16px;
  margin-bottom:16px;
}

.order-delete-badge{
  background:rgba(220,38,38,.10);
  color:#b91c1c;
}

.order-delete-form{
  margin-top:0;
}

.order-delete-grid{
  margin-bottom:16px;
}

.order-delete-option{
  padding:14px;
  cursor:pointer;
  margin-bottom:0;
}

.order-delete-option input{
  width:auto;
  margin:0 0 10px;
}

.order-delete-option strong{
  display:block;
  margin:0 0 6px;
}

.order-delete-submit{
  background:#dc2626;
  border-color:#dc2626;
}

@media (max-width: 1200px){
  .order-inline-summary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }

  .order-detail-grid,
  .order-detail-grid-secondary{
    grid-template-columns:repeat(2,minmax(0,1fr));
  }
}

@media (max-width: 900px){
  .order-page-head{
    flex-direction:column;
    align-items:stretch;
  }

  .order-inline-summary,
  .order-detail-grid,
  .order-detail-grid-secondary{
    grid-template-columns:1fr;
  }

  .order-detail-item{
    grid-template-columns:1fr;
    gap:4px;
  }

  .order-status-inline-fields{
    grid-template-columns:1fr;
  }

  .order-status-inline-submit{
    min-width:0;
  }

  .order-source-inline{
    grid-template-columns:1fr;
  }

  .order-source-image{
    justify-self:start;
  }
}

@media (max-width: 640px){
  .order-main-card,
  .order-detail-box{
    padding:14px;
  }

  .order-inline-summary{
    grid-template-columns:1fr;
  }

  .order-inline-summary-item{
    padding:12px 14px;
  }
}

/*footer login*/
body.login-page .topbar,
body.login-page .sidebar,
body.login-page .appearance-panel,
body.login-page .sidebar-overlay{
  display:none !important;
}

body.login-page .site-footer{
  display:block !important;
  width:min(1140px, calc(100vw - 40px));
  margin:6px auto 0;
  padding:0 20px 10px;
}

body.login-page .site-footer-line{
  margin-bottom:8px;
}

body.login-page .site-footer-text{
  text-align:center;
  font-size:13px;
  color:var(--muted);
}

@media (max-width: 980px){
  body.login-page .site-footer{
    width:min(1280px, calc(100vw - 24px));
    padding:0 12px 10px;
  }
}
