/* intranet2 - Shopify Admin-style layout (stage 2 skeleton) */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f6f6f7; color: #202223; font-size: 14px; line-height: 1.45;
}
a { color: #006fbb; text-decoration: none; }
a:hover { text-decoration: underline; }

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

/* Sidebar (dark, Shopify-style) */
.sidebar {
  width: 240px; flex: 0 0 240px; background: #1a1a1a; color: #e3e3e3;
  display: flex; flex-direction: column; position: sticky; top: 0; height: 100vh;
}
.brand { padding: 16px 16px 12px; font-weight: 700; font-size: 15px; color: #fff; border-bottom: 1px solid #2c2c2c; }
.sidebar nav { padding: 10px 8px; flex: 1; overflow-y: auto; }
.nav-item {
  display: block; padding: 7px 10px; margin: 1px 0; border-radius: 6px;
  color: #e3e3e3; font-size: 14px;
}
.nav-item:hover { background: #2c2c2c; text-decoration: none; }
.nav-item.active { background: #333; color: #fff; font-weight: 600; box-shadow: inset 3px 0 0 #00a47c; }
.nav-item.sub { padding-left: 24px; font-size: 13.5px; }
.nav-label { padding: 10px 10px 3px; font-size: 13px; font-weight: 600; color: #a3a3a3; }
.side-foot { border-top: 1px solid #2c2c2c; padding: 10px 8px 14px; }
.side-user { padding: 2px 10px 6px; font-size: 13px; color: #cfcfcf; }
.side-user .role { color: #8a8a8a; font-size: 12px; margin-left: 4px; text-transform: capitalize; }

/* Main area */
.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar {
  background: #fff; border-bottom: 1px solid #dfe3e8; padding: 12px 24px;
  position: sticky; top: 0; z-index: 5;
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 600; }
.content { padding: 20px 24px 40px; max-width: 1280px; width: 100%; margin: 0 auto; }

.card {
  background: #fff; border: 1px solid #dfe3e8; border-radius: 10px;
  padding: 16px 20px; margin-bottom: 16px; box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.card h2 { margin: 0 0 12px; font-size: 15px; font-weight: 650; }
.card h3 { margin: 18px 0 8px; font-size: 13px; font-weight: 650; color: #42474c; }
.muted { color: #6d7175; }

.summary-bar { display: flex; gap: 32px; flex-wrap: wrap; }
.sum-label, .stat-label { font-size: 12px; color: #6d7175; font-weight: 600; text-transform: uppercase; letter-spacing: .02em; }
.sum-value { font-size: 24px; font-weight: 700; margin-top: 2px; }
.sum-value.sm { font-size: 18px; padding-top: 4px; }
.sum-sub, .stat-sub { font-size: 12.5px; color: #6d7175; }

.panels { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; align-items: start; }
@media (max-width: 900px) { .panels { grid-template-columns: 1fr; } }
.stat-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; }
.stat-value { font-size: 19px; font-weight: 700; margin-top: 2px; }

.tbl { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.tbl th, .tbl td { padding: 7px 8px; border-top: 1px solid #eceff1; text-align: left; }
.tbl thead th { border-top: none; color: #6d7175; font-weight: 600; font-size: 12.5px; }
.tbl .r { text-align: right; }

/* Login */
.login-body { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: #f6f6f7; }
.login-card {
  background: #fff; border: 1px solid #dfe3e8; border-radius: 12px; padding: 28px;
  width: 340px; box-shadow: 0 4px 16px rgba(0,0,0,0.06); display: flex; flex-direction: column; gap: 12px;
}
.login-brand { font-weight: 700; font-size: 15px; }
.login-card h1 { margin: 0 0 4px; font-size: 20px; }
.login-card label { display: flex; flex-direction: column; gap: 5px; font-size: 13px; font-weight: 550; }
.login-card input {
  padding: 9px 10px; border: 1px solid #aeb4b9; border-radius: 7px; font-size: 14px;
}
.login-card input:focus { outline: 2px solid #005bd3; outline-offset: 0; border-color: transparent; }
.login-card button {
  margin-top: 4px; padding: 10px; border: none; border-radius: 7px; cursor: pointer;
  background: #1a1a1a; color: #fff; font-size: 14px; font-weight: 600;
}
.login-card button:hover { background: #000; }
.login-error {
  background: #fdecea; border: 1px solid #f5c6c0; color: #8e1f11;
  padding: 9px 11px; border-radius: 7px; font-size: 13px;
}

/* Logo (added 2026-11-10) */
.brand { display: flex; align-items: center; gap: 10px; }
.brand-logo { height: 34px; width: auto; background: #fff; border-radius: 6px; padding: 2px; }
.login-brand { text-align: center; }
.login-logo { height: 72px; width: auto; }

/* Brand block fix (2026-11-10) */
.brand { flex-direction: column; align-items: flex-start; gap: 8px; }
.brand-logo { height: 44px; width: auto; }
.brand-name { font-size: 13px; font-weight: 600; color: #e3e3e3; letter-spacing: .2px; }

/* ---- Stage 4: New Order screen ---- */
.inp {
  padding: 8px 10px; border: 1px solid #aeb4b9; border-radius: 7px; font-size: 14px;
  background: #fff; color: #202223;
}
.inp:focus { outline: 2px solid #005bd3; outline-offset: 0; border-color: transparent; }
label > .inp, label > select.inp, label > textarea.inp { margin-top: 4px; }
.btn {
  display: inline-block; padding: 8px 14px; border: none; border-radius: 7px; cursor: pointer;
  background: #1a1a1a; color: #fff; font-size: 13.5px; font-weight: 600; text-decoration: none;
}
.btn:hover { background: #000; text-decoration: none; }
.btn-light { background: #fff; color: #202223; border: 1px solid #c9ccd1; }
.btn-light:hover { background: #f1f2f3; }
.btn-sm { padding: 4px 9px; font-size: 13px; }
.btn-save { width: 100%; padding: 11px; margin-top: 14px; font-size: 14.5px; background: #007a5c; }
.btn-save:hover { background: #00654c; }

.order-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 16px; align-items: start; }
@media (max-width: 1000px) { .order-layout { grid-template-columns: 1fr; } }
.summary-card { position: sticky; top: 76px; }
.sum-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 14px; }
.sum-row.total { border-top: 1px solid #dfe3e8; margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 16px; }
.sum-warnings { color: #8a6d00; font-size: 12.5px; margin-top: 8px; }

.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 16px; }
.grid2 label, .item-fields label { display: flex; flex-direction: column; font-size: 13px; font-weight: 550; }
.inline2 { display: flex; gap: 8px; align-items: center; margin-top: 4px; }

.cust-results {
  border: 1px solid #dfe3e8; border-radius: 8px; margin-top: 6px; overflow: hidden; background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.08); position: relative; z-index: 6;
}
.cust-result { padding: 9px 12px; cursor: pointer; font-size: 13.5px; }
.cust-result:hover { background: #f1f6fb; }
.cust-selected {
  display: flex; justify-content: space-between; align-items: center;
  background: #f4fbf7; border: 1px solid #bfe3cf; border-radius: 8px; padding: 10px 12px;
}
.cust-name { font-weight: 650; font-size: 15px; }
.new-cust { margin-top: 12px; border-top: 1px dashed #dfe3e8; padding-top: 12px; }

.item-row { border: 1px solid #e3e6e9; border-radius: 8px; padding: 12px 14px; margin-bottom: 12px; background: #fdfdfd; }
.item-head { display: flex; gap: 10px; align-items: center; margin-bottom: 10px; }
.item-head .prod-sel { flex: 1; font-weight: 600; }
.item-fields { display: flex; gap: 14px; flex-wrap: wrap; align-items: flex-end; }
.item-fields .chk { flex-direction: row; align-items: center; gap: 6px; font-weight: 500; padding-bottom: 9px; }
.item-fields .f-opts { display: flex; gap: 12px; align-items: flex-end; }
.item-price { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; gap: 12px; flex-wrap: wrap; }
.price-right { display: flex; align-items: center; gap: 10px; }
.amt-inp { width: 120px; text-align: right; font-weight: 650; }
.unit-inp { width: 92px; text-align: right; font-weight: 650; }
.unit-label { font-weight: 600; }
.badge-special {
  background: #ffdf5d; color: #594d00; border: 1px solid #e8c93c; border-radius: 20px;
  font-size: 12px; font-weight: 700; padding: 2px 9px;
}
.badge-paid { background: #d3f8df; color: #05603a; border-radius: 20px; font-size: 11.5px; font-weight: 700; padding: 1px 8px; }
.auto-note { font-size: 12.5px; margin-top: 2px; text-align: right; }
.auto-note:not(:empty) { text-decoration: line-through; }
.item-warn { margin-top: 6px; font-size: 12.5px; }
.warn-text { color: #b54708; }
.form-error {
  background: #fdecea; border: 1px solid #f5c6c0; color: #8e1f11;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px;
}
.form-success {
  background: #e7f8ee; border: 1px solid #bfe3cf; color: #05603a;
  padding: 10px 14px; border-radius: 8px; margin-bottom: 16px; font-size: 13.5px; font-weight: 600;
}
.list-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 12px; gap: 12px; flex-wrap: wrap; }
