:root {
  --bg: #f5f1e8;
  --bg-soft: #fbf8f2;
  --panel: #ffffff;
  --ink: #10213b;
  --muted: #66748a;
  --line: #dfe6ee;
  --nav: #081528;
  --nav-2: #11243f;
  --accent: #0f7f79;
  --accent-2: #d2b04c;
  --accent-soft: #def3ef;
  --warning-soft: #fff2c7;
  --warning-text: #8a5d00;
  --danger: #b3261e;
  --danger-soft: #fde8e6;
  --success-soft: #dff4e7;
  --success-text: #156c42;
  --shadow: 0 10px 24px rgba(8, 21, 40, 0.06);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body { font-family: Arial, Helvetica, sans-serif; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, textarea, select { font: inherit; }
input, textarea, select { width: 100%; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
textarea { resize: vertical; min-height: 100px; }
button { cursor: pointer; }
.app-shell { display: grid; grid-template-columns: 230px 1fr; min-height: 100vh; }
.sidebar { background: linear-gradient(180deg, var(--nav) 0%, #091a31 100%); color: white; display: flex; flex-direction: column; gap: 20px; padding: 18px 16px; position: sticky; top: 0; height: 100vh; overflow-y: auto; }
.brand-box { display: flex; gap: 12px; align-items: center; }
.brand-logo { width: 124px; max-height: 54px; object-fit: contain; background: rgba(255,255,255,.06); border-radius: 14px; padding: 6px; }
.brand-box strong { display: block; font-size: 15px; }
.brand-box p { margin: 2px 0 0; color: #c8d3df; font-size: 13px; }
.nav-menu { display: grid; gap: 8px; }
.nav-link { color: #dde7f2; padding: 12px 14px; border-radius: 14px; font-size: 15px; transition: .18s ease; }
.nav-link.active, .nav-link:hover { background: var(--nav-2); color: #fff; }
.sidebar-footer { margin-top: auto; font-size: 13px; color: #dce3ed; }
.sidebar-footer p { margin: 0 0 6px; }
.main-shell { padding: 22px 22px 28px; min-width: 0; }
.topbar { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; margin-bottom: 18px; }
.topbar-title-wrap { display: flex; gap: 14px; align-items: flex-start; }
.topbar h1 { margin: 0; font-size: 30px; }
.topbar p { margin: 6px 0 0; color: var(--muted); }
.menu-toggle { display: none; border: 0; background: var(--nav); color: #fff; border-radius: 12px; width: 42px; height: 42px; font-size: 20px; }
.topbar-meta { display: flex; gap: 10px; flex-wrap: wrap; }
.chip { display: inline-flex; align-items: center; gap: 8px; border-radius: 999px; padding: 8px 12px; font-size: 13px; }
.chip.brand { background: var(--accent-soft); color: var(--accent); }
.chip.muted { background: #edf1f5; color: var(--muted); }
.card { background: var(--panel); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); }
.panel { padding: 18px; }
.panel h2, .panel h3 { margin: 0 0 12px; }
.panel-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-bottom: 14px; }
.panel-head.inline { margin-bottom: 10px; }
.top-gap { margin-top: 16px; }
.flash-stack { display: grid; gap: 10px; margin-bottom: 16px; }
.flash { padding: 12px 14px; border-radius: 12px; }
.flash.success { background: var(--success-soft); color: var(--success-text); }
.flash.error { background: var(--danger-soft); color: var(--danger); }
.button { border: 0; padding: 12px 16px; border-radius: 12px; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button.small { padding: 8px 10px; font-size: 13px; }
.button.primary { background: var(--accent); color: white; }
.button.secondary { background: var(--accent-2); color: #2f2510; }
.button.ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.button.danger { background: var(--danger); color: white; }
.stat-grid { display: grid; gap: 16px; grid-template-columns: repeat(6, minmax(0, 1fr)); margin-bottom: 18px; }
.stat-grid.three-col { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.stat-card { padding: 18px; }
.stat-card span { display: block; color: var(--muted); font-size: 14px; }
.stat-card strong { display: block; margin-top: 8px; font-size: 28px; }
.action-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 18px; }
.split-layout { display: grid; grid-template-columns: 1fr 1.08fr; gap: 18px; }
.order-layout, .detail-layout { grid-template-columns: 1.15fr .95fr; }
.dashboard-grid { display: grid; gap: 18px; }
.dashboard-grid.two-up { grid-template-columns: 1fr 1fr; }
.list-table { display: grid; gap: 10px; }
.list-row { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: #fff; position: relative; }
.list-row.align-top { align-items: flex-start; }
.fill-link { position: absolute; inset: 0; }
.card-lite { background: #fff; }
.list-row strong { display: block; }
.list-row span { display: block; margin-top: 4px; color: var(--muted); font-size: 13px; }
.row-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; position: relative; z-index: 1; }
.status { display: inline-flex; align-items: center; justify-content: center; padding: 6px 10px; border-radius: 999px; font-size: 12px; text-transform: capitalize; min-width: 76px; }
.status.active, .status.ready, .status.paid { background: var(--success-soft); color: var(--success-text); }
.status.inactive, .status.pending, .status.deposit { background: var(--warning-soft); color: var(--warning-text); }
.status.picked_up { background: #e0ecff; color: #2c62c5; }
.status.unpaid { background: var(--danger-soft); color: var(--danger); }
.form-grid { display: grid; gap: 14px; }
.form-grid.two-col { grid-template-columns: 1fr 1fr; }
.form-grid.single { grid-template-columns: 1fr; }
.form-grid label { display: grid; gap: 8px; color: var(--muted); font-size: 14px; }
.form-grid label span { color: var(--muted); }
.full { grid-column: 1 / -1; }
.form-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.toolbar { display: flex; gap: 10px; align-items: center; margin-bottom: 16px; }
.toolbar.wrap { flex-wrap: wrap; }
.inline-search, .search-inline { display: flex; gap: 8px; align-items: center; }
.metric-strip { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 16px; }
.metric-strip.compact { grid-template-columns: repeat(2, 1fr); }
.metric-strip > div { background: var(--bg-soft); border: 1px solid var(--line); border-radius: 14px; padding: 12px; }
.metric-strip span { display: block; color: var(--muted); font-size: 13px; }
.metric-strip strong { display: block; margin-top: 6px; }
.note-box, .empty-state { padding: 14px; border-radius: 14px; background: var(--bg-soft); color: var(--muted); }
.nested-panel { border: 1px dashed var(--line); border-radius: 14px; padding: 14px; background: #fff; }
.line-item-grid { display: grid; grid-template-columns: 1.1fr 1.1fr .7fr 1.2fr; gap: 10px; margin-bottom: 10px; }
.product-item-grid { grid-template-columns: 1.4fr .8fr auto; }
.category-tabs, .report-tabs { display: flex; gap: 8px; flex-wrap: wrap; }
.tab-chip { border: 1px solid var(--line); background: #fff; color: var(--ink); border-radius: 999px; padding: 10px 14px; display: inline-flex; align-items: center; justify-content: center; }
.tab-chip.active { background: var(--nav); color: white; border-color: var(--nav); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.quick-pick-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.quick-item { border: 1px solid var(--line); background: var(--bg-soft); color: var(--ink); border-radius: 12px; padding: 10px 12px; }
.quick-item:hover { background: var(--accent-soft); color: var(--accent); }
.report-table-wrap { overflow: auto; }
.report-table { width: 100%; border-collapse: collapse; }
.report-table th, .report-table td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; font-size: 14px; white-space: nowrap; }
.report-table th { background: var(--bg-soft); }
.login-shell { min-height: 100vh; display: grid; place-items: center; padding: 20px; }
.branded-login { background: radial-gradient(circle at top, #f9f4e4 0, var(--bg) 44%, #efe8db 100%); }
.login-card { width: min(460px, 100%); padding: 28px; text-align: center; }
.login-logo { width: min(260px, 100%); max-height: 86px; object-fit: contain; margin: 0 auto 10px; }
.login-card h1 { margin: 0 0 8px; }
.login-card p { color: var(--muted); }
.login-note { margin-top: 14px; padding: 12px; background: var(--bg-soft); border-radius: 12px; }
.settings-grid { display: grid; gap: 18px; }
.toggle { display: flex !important; align-items: center; gap: 10px; }
.toggle input { width: auto; }
.narrow { max-width: 980px; }
.compact-label { display: grid; gap: 6px; font-size: 13px; color: var(--muted); }
.app-footer { margin-top: 18px; text-align: center; color: var(--muted); font-size: 12px; padding: 12px 0 4px; }
.login-footer { margin-top: 18px; }
.pickup-action-stack, .sticky-actions, .admin-actions { justify-content: flex-end; }
.sales-filter-bar, .report-filter-bar { margin-bottom: 18px; }
.products-tab-list { margin-bottom: 10px; }
.full-width-mobile { width: auto; }
@media (max-width: 1280px) { .stat-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 1024px) {
  .app-shell { grid-template-columns: 1fr; }
  .sidebar { position: fixed; top: 0; left: 0; width: 270px; transform: translateX(-100%); transition: transform .2s ease; z-index: 40; }
  .app-shell.sidebar-open .sidebar { transform: translateX(0); }
  .main-shell { padding: 18px; }
  .menu-toggle { display: inline-flex; }
  .split-layout, .dashboard-grid.two-up, .order-layout, .detail-layout, .stat-grid, .stat-grid.three-col, .form-grid.two-col, .metric-strip, .metric-strip.compact, .line-item-grid, .product-item-grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; }
  .brand-logo { width: 104px; }
}
@media (max-width: 768px) {
  .main-shell { padding: 14px; }
  .button, .nav-link { min-height: 44px; }
  .list-row { flex-direction: column; align-items: flex-start; }
  .row-actions, .pickup-action-stack, .sticky-actions, .admin-actions { width: 100%; justify-content: flex-start; }
  .full-width-mobile { width: 100%; }
}

/* --- Login security hotfix: placeholders, remember me, forgot password --- */
.login-form input::placeholder,
.clock-modal-form input::placeholder,
.forgot-password-form input::placeholder,
input::placeholder {
  color: #9aa3b2;
  opacity: 1;
  font-weight: 600;
}

.login-form input,
.clock-modal-form input,
.forgot-password-form input {
  font-weight: 700;
}

.login-options {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin: 2px 0 4px;
  text-align: left;
}

.remember-me {
  display: inline-flex !important;
  grid-template-columns: none !important;
  align-items: center;
  gap: 8px !important;
  color: var(--ink) !important;
  font-size: 14px !important;
  font-weight: 800;
  cursor: pointer;
}

.remember-me input {
  width: 16px;
  height: 16px;
  padding: 0;
  margin: 0;
  accent-color: #f28c16;
}

.remember-me span {
  color: var(--ink) !important;
}

.forgot-password-link {
  color: #d97706;
  font-weight: 900;
  font-size: 14px;
  text-decoration: none;
  white-space: nowrap;
}

.forgot-password-link:hover,
.forgot-password-link:focus {
  text-decoration: underline;
}

.login-clock-open {
  width: 100%;
  margin-top: 12px;
}

.forgot-password-card h1 {
  margin-bottom: 8px;
}

.back-to-login {
  width: 100%;
}

@media (max-width: 480px) {
  .login-options {
    flex-direction: column;
    align-items: flex-start;
  }
}
