:root {
  --navy: #05192c;
  --green: #00642a;
  --green-bright: #01d95a;
  --mint: #e6fdef;
  --lavender: #efeaf7;
  --bg: #f5f6f8;
  --surface: #ffffff;
  --border: #e6e7ec;
  --text: #0f0d1c;
  --muted: #6b7280;
  --danger: #c8372d;
  --radius: 14px;
  --shadow: 0 6px 24px rgba(5, 25, 44, 0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}
.hidden { display: none !important; }
.muted { color: var(--muted); }
.right { text-align: right; }

/* Brand */
.brand { display: flex; align-items: center; gap: 12px; }
.brand h1 { font-size: 18px; margin: 0; }
.brand p { margin: 0; font-size: 12px; }
.brand-mark {
  width: 42px; height: 42px; border-radius: 12px;
  background: var(--green); color: #fff;
  display: grid; place-items: center;
  font-weight: 800; font-size: 22px;
}

/* Buttons */
.btn {
  border: none; border-radius: 100px; padding: 11px 20px;
  font-size: 14px; font-weight: 700; cursor: pointer;
  transition: transform .05s ease, opacity .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--navy); color: var(--green-bright); }
.btn-primary:hover { opacity: .92; }
.btn-ghost { background: transparent; color: var(--navy); border: 1.4px solid var(--border); }
.btn-ghost:hover { background: #f0f1f4; }
.btn-block { width: 100%; }
.btn-danger { background: #fdeceb; color: var(--danger); }
.icon-btn { background: none; border: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); }

/* Login */
.login-wrap { min-height: 100vh; display: grid; place-items: center; padding: 24px; }
.login-card {
  width: 100%; max-width: 380px; background: var(--surface);
  border-radius: 20px; padding: 32px; box-shadow: var(--shadow);
  display: flex; flex-direction: column; gap: 16px;
}
.login-card .brand { margin-bottom: 6px; }

label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 600; }
input, select {
  font: inherit; padding: 12px 14px; border: 1.4px solid var(--border);
  border-radius: 12px; background: #fff; font-weight: 500;
}
input:focus, select:focus { outline: none; border-color: var(--navy); }
label.checkbox { flex-direction: row; align-items: center; gap: 10px; font-weight: 600; }
label.checkbox input { width: 18px; height: 18px; }
small { font-weight: 500; }

/* Topbar */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 24px; display: flex; align-items: center; justify-content: space-between;
}
.topbar-actions { display: flex; gap: 10px; }

/* Container / toolbar */
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }
.toolbar { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.toolbar input[type="search"] { flex: 0 1 420px; }
.toolbar .spacer { flex: 1; }

/* Tabs */
.tabs { display: flex; gap: 8px; padding-top: 18px; padding-bottom: 0; }
.tab {
  background: none; border: none; cursor: pointer;
  padding: 10px 4px; margin-right: 18px; font-size: 15px; font-weight: 700;
  color: var(--muted); border-bottom: 3px solid transparent;
}
.tab.active { color: var(--navy); border-bottom-color: var(--green-bright); }

/* Banner grid */
.banner-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.banner-item { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
.banner-item img { width: 100%; height: 150px; object-fit: cover; display: block; background: #eef0f3; }
.banner-item .b-body { padding: 12px 14px; }
.banner-item .b-title { font-weight: 700; }
.banner-item .b-link { font-size: 12px; color: var(--green); word-break: break-all; }
.banner-item .b-row { display: flex; align-items: center; gap: 8px; margin-top: 10px; }
.banner-item .b-row .spacer { flex: 1; }
.banner-item .btn { padding: 6px 12px; font-size: 13px; }
.order-btns { display: flex; gap: 4px; }
.order-btns button {
  width: 30px; height: 30px; border-radius: 8px; border: 1.4px solid var(--border);
  background: #fff; cursor: pointer; font-size: 15px; line-height: 1; color: var(--navy);
}
.order-btns button:disabled { opacity: .35; cursor: default; }
.banner-preview { border: 1px dashed var(--border); border-radius: 12px; overflow: hidden; }
.banner-preview img { width: 100%; max-height: 180px; object-fit: cover; display: block; }
.b-inactive { opacity: .55; }
.badge {
  background: var(--mint); color: var(--green);
  padding: 6px 14px; border-radius: 100px; font-size: 13px; font-weight: 700;
}

/* Table */
.table-card { background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 14px 16px; font-size: 14px; }
thead th { background: #fafbfc; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--border); }
tbody tr { border-bottom: 1px solid var(--border); }
tbody tr:last-child { border-bottom: none; }
tbody tr:hover { background: #fafbfc; }
.cust-name { font-weight: 700; }
.cust-sub { font-size: 12px; color: var(--muted); }
.store-link { color: var(--green); text-decoration: none; }
.store-link:hover { text-decoration: underline; }
.pill { display: inline-block; padding: 4px 12px; border-radius: 100px; font-size: 12px; font-weight: 700; }
.pill-on { background: var(--mint); color: var(--green); }
.pill-off { background: #fdeceb; color: var(--danger); }
.row-actions { display: flex; gap: 8px; justify-content: flex-end; }
.row-actions .btn { padding: 7px 14px; font-size: 13px; }
.empty { padding: 48px 24px; text-align: center; }

/* Modal */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(5, 25, 44, .45);
  display: grid; place-items: center; padding: 24px; z-index: 50;
}
.modal {
  background: var(--surface); border-radius: 20px; width: 100%; max-width: 560px;
  max-height: 92vh; overflow-y: auto; box-shadow: var(--shadow);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 20px 24px; border-bottom: 1px solid var(--border); }
.modal-head h2 { margin: 0; font-size: 18px; }
#user-form { padding: 24px; display: flex; flex-direction: column; gap: 14px; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.section-divider { font-size: 12px; font-weight: 800; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-top: 8px; padding-top: 12px; border-top: 1px dashed var(--border); }
.modal-actions { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.modal-actions .spacer { flex: 1; }

.error { color: var(--danger); font-size: 13px; font-weight: 600; margin: 0; }
.info { color: var(--green); font-size: 13px; font-weight: 600; margin: 0; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--navy); color: #fff; padding: 12px 22px; border-radius: 100px;
  font-size: 14px; font-weight: 600; box-shadow: var(--shadow); z-index: 100;
}

@media (max-width: 640px) {
  .grid { grid-template-columns: 1fr; }
  .topbar { flex-direction: column; gap: 12px; align-items: flex-start; }
  th:nth-child(3), td:nth-child(3), th:nth-child(4), td:nth-child(4) { display: none; }
}
