/* ─── Neumorphism Theme — beez DMS Product Console ─────────────────────── */
:root {
  --bg: #e5ebf4;
  --bg-2: #f2f5fb;
  --surface: #ebf0f8;
  --ink: #1f2a3a;
  --ink-2: #3f4f66;
  --muted: #64748b;
  --primary: #4f46e5;
  --primary-ink: #ffffff;
  --primary-soft: #6366f1;
  --danger: #e53e3e;
  --good: #10b981;
  --warn: #f59e0b;
  --info: #3b82f6;

  --nm-shadow-out: 10px 10px 22px #c8d0db, -10px -10px 22px #ffffff;
  --nm-shadow-out-sm: 5px 5px 12px #c8d0db, -5px -5px 12px #ffffff;
  --nm-shadow-in: inset 4px 4px 9px #c8d0db, inset -4px -4px 9px #ffffff;
  --nm-shadow-in-sm: inset 2px 2px 5px #c8d0db, inset -2px -2px 5px #ffffff;
  --nm-shadow-pressed: inset 6px 6px 12px #c8d0db, inset -6px -6px 12px #ffffff;

  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; min-height: 100vh; }
body {
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background:
    radial-gradient(circle at 8% -8%, rgba(79, 70, 229, 0.08), transparent 36%),
    radial-gradient(circle at 90% 0%, rgba(14, 165, 233, 0.08), transparent 34%),
    var(--bg);
  color: var(--ink);
  -webkit-font-smoothing: antialiased; letter-spacing: -0.01em;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus,
a:active {
  text-decoration: none;
}

:focus-visible {
  outline: 2px solid rgba(79, 70, 229, 0.45);
  outline-offset: 2px;
}

.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 24px;
  background: color-mix(in srgb, var(--bg) 88%, white 12%);
  position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid rgba(184, 196, 214, 0.55);
  backdrop-filter: blur(12px);
}
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 17px; color: var(--ink); }
.brand-logo {
  width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center;
  background: var(--bg); border-radius: 12px; box-shadow: var(--nm-shadow-out-sm);
  font-size: 18px;
}
.badge {
  background: var(--bg); color: var(--warn); font-size: 11px; padding: 4px 10px;
  border-radius: 999px; box-shadow: var(--nm-shadow-in-sm); font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.05em;
}

.nav { display: flex; gap: 4px; flex: 1; justify-content: center; padding: 4px; background: var(--surface); border-radius: 999px; box-shadow: var(--nm-shadow-in-sm); max-width: 760px; margin: 0 20px; }
.nav a {
  padding: 8px 16px; border-radius: 999px; text-decoration: none; color: var(--muted);
  font-size: 13px; font-weight: 500; transition: all 0.2s;
}
.nav a:hover { color: var(--ink); }
.nav a.active {
  background: var(--bg); color: var(--primary); font-weight: 700;
  box-shadow: var(--nm-shadow-out-sm);
}

.user-box { display: flex; align-items: center; gap: 14px; font-size: 13px; color: var(--ink-2); }
.user-box span { font-weight: 600; }

.status-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-right: 12px;
  flex-wrap: wrap;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  background: color-mix(in srgb, var(--surface) 88%, white 12%);
  box-shadow: var(--nm-shadow-in-sm);
  color: var(--muted);
}

.status-pill.ok {
  color: var(--good);
  background: rgba(16, 185, 129, 0.12);
}

.status-pill.warn {
  color: var(--warn);
  background: rgba(245, 158, 11, 0.14);
}

.status-pill.bad {
  color: var(--danger);
  background: rgba(229, 62, 62, 0.14);
}

.container { max-width: 1320px; margin: 26px auto 64px; padding: 0 28px; }

.card {
  background: color-mix(in srgb, var(--surface) 92%, white 8%); border-radius: var(--radius); padding: 30px;
  box-shadow: var(--nm-shadow-out); margin-bottom: 24px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 20px; gap: 16px; flex-wrap: wrap;
}
.card-head h1 { margin: 0; }

h1 { font-size: 24px; font-weight: 700; margin: 0 0 8px; color: var(--ink); letter-spacing: -0.02em; }
h2 { font-size: 13px; font-weight: 700; margin: 28px 0 14px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.08em; }
h3 { font-size: 15px; font-weight: 600; margin: 0 0 12px; color: var(--ink); }
.muted { color: var(--muted); font-size: 13px; }
.error { color: var(--danger); margin: 8px 0 0; min-height: 20px; font-size: 13px; font-weight: 500; }
.error-card { border-left: 4px solid var(--danger); }
.success { color: var(--good); font-weight: 500; }
.hidden { display: none !important; }

.btn {
  border: 0; cursor: pointer; padding: 10px 20px; border-radius: 12px;
  font-size: 13px; font-weight: 600; letter-spacing: 0.01em;
  background: color-mix(in srgb, var(--surface) 86%, white 14%); color: var(--ink);
  box-shadow: var(--nm-shadow-out-sm);
  transition: all 0.15s ease;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { transform: translateY(-1px); box-shadow: 7px 7px 16px #c7ced9, -7px -7px 16px #ffffff; }
.btn:active { box-shadow: var(--nm-shadow-pressed); transform: translateY(0); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }

.btn-primary { background: linear-gradient(145deg, #6f73ff, #4f46e5); color: var(--primary-ink); }
.btn-primary:hover { box-shadow: 0 6px 16px rgba(79, 70, 229, 0.4); }

.btn-danger { color: var(--danger); }
.btn-good { color: var(--good); }
.btn-warn { color: var(--warn); }
.btn-ghost { box-shadow: none; color: var(--muted); }
.btn-ghost:hover { box-shadow: var(--nm-shadow-out-sm); color: var(--ink); transform: none; }

.btn-sm { padding: 6px 12px; font-size: 12px; border-radius: 8px; }
.btn-icon { padding: 8px; min-width: 36px; justify-content: center; }

.form { display: flex; flex-direction: column; gap: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid .full { grid-column: 1 / -1; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 11px; color: var(--muted); font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; }

.form input, .form select, .form textarea {
  padding: 12px 14px; border: 0; border-radius: var(--radius-sm); font-size: 14px;
  background: var(--bg); color: var(--ink); font-family: inherit;
  box-shadow: var(--nm-shadow-in-sm);
  transition: box-shadow 0.15s;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: 0; box-shadow: var(--nm-shadow-in), 0 0 0 2px rgba(79, 70, 229, 0.2);
}
.form textarea { min-height: 80px; resize: vertical; }

select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a5568' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat; background-position: right 12px center; background-size: 16px;
  padding-right: 36px;
}

.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row > select { min-width: 240px; }

.search-input {
  padding: 10px 14px; border: 0; border-radius: 10px; font-size: 13px;
  background: var(--bg); box-shadow: var(--nm-shadow-in-sm); min-width: 240px;
}

.table-wrap {
  background: color-mix(in srgb, var(--surface) 88%, white 12%); border-radius: var(--radius); padding: 6px;
  box-shadow: var(--nm-shadow-in-sm); overflow: auto;
}
.table { width: 100%; border-collapse: collapse; font-size: 13px; }
.table th, .table td {
  text-align: left; padding: 14px 16px;
  border-bottom: 1px solid rgba(199, 204, 214, 0.4);
}
.table tr:last-child td { border-bottom: 0; }
.table th {
  color: var(--muted); font-weight: 700; font-size: 11px;
  text-transform: uppercase; letter-spacing: 0.06em;
}
.table tbody tr:hover { background: rgba(255, 255, 255, 0.55); }
.table td a {
  color: var(--primary);
  font-weight: 600;
}
.table td a:hover {
  color: var(--primary-soft);
}
.table td a code {
  color: inherit;
  text-decoration: none;
  border: 1px solid rgba(99, 102, 241, 0.2);
  box-shadow: none;
  background: rgba(99, 102, 241, 0.08);
}
.table td a.btn {
  color: inherit;
}
.table code {
  background: color-mix(in srgb, var(--surface) 78%, white 22%); padding: 2px 8px; border-radius: 6px;
  box-shadow: var(--nm-shadow-in-sm); font-size: 12px;
}
.table .actions { display: flex; gap: 6px; justify-content: flex-end; }

.thumb {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  object-fit: cover;
  box-shadow: var(--nm-shadow-out-sm);
}

.thumb.placeholder {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
  color: var(--muted);
  background: var(--bg);
  box-shadow: var(--nm-shadow-in-sm);
}

.pill { display: inline-block; padding: 4px 12px; border-radius: 999px; font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.04em; }
.pill-active { background: rgba(16, 185, 129, 0.18); color: #059669; }
.pill-suspended { background: rgba(229, 62, 62, 0.15); color: var(--danger); }
.pill-archived { background: rgba(113, 128, 150, 0.15); color: var(--muted); }
.pill-pending { background: rgba(245, 158, 11, 0.15); color: var(--warn); }
.pill-confirmed, .pill-loaded, .pill-delivered { background: rgba(59, 130, 246, 0.15); color: var(--info); }
.pill-paid, .pill-closed { background: rgba(16, 185, 129, 0.15); color: var(--good); }

.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 16px; margin-bottom: 8px; }
.kpi {
  background: color-mix(in srgb, var(--surface) 82%, white 18%); border-radius: var(--radius-sm); padding: 18px;
  box-shadow: var(--nm-shadow-out-sm); transition: transform 0.15s;
}
.kpi:hover { transform: translateY(-2px); }
.kpi .num { font-size: 26px; font-weight: 800; color: var(--primary); letter-spacing: -0.02em; }
.kpi .lbl { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 0.06em; margin-top: 6px; font-weight: 700; }

.activity { padding-left: 0; list-style: none; margin: 0; }
.activity li {
  padding: 10px 14px; margin: 6px 0; background: var(--bg); border-radius: 10px;
  box-shadow: var(--nm-shadow-out-sm); font-size: 13px;
}

.output {
  background: var(--bg); color: var(--ink-2); padding: 16px; border-radius: var(--radius-sm);
  max-height: 320px; overflow: auto; font-size: 12px; font-family: "JetBrains Mono", "Consolas", monospace;
  box-shadow: var(--nm-shadow-in-sm); white-space: pre-wrap;
}

.modal-backdrop {
  position: fixed; inset: 0; background: rgba(45, 55, 72, 0.5); backdrop-filter: blur(6px);
  display: flex; align-items: center; justify-content: center; z-index: 100; padding: 20px;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--bg); border-radius: var(--radius-lg); padding: 32px; max-width: 640px;
  width: 100%; max-height: 90vh; overflow-y: auto;
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.modal-head h2 { margin: 0; text-transform: none; letter-spacing: -0.01em; font-size: 20px; color: var(--ink); }
.modal-foot { display: flex; gap: 12px; justify-content: flex-end; margin-top: 24px; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.toast-stack {
  position: fixed; bottom: 24px; right: 24px; display: flex; flex-direction: column;
  gap: 10px; z-index: 200; max-width: 380px;
}
.toast {
  background: var(--bg); padding: 14px 18px; border-radius: var(--radius-sm);
  box-shadow: var(--nm-shadow-out); font-size: 13px; font-weight: 500;
  border-left: 4px solid var(--primary); animation: slideIn 0.2s ease;
}
.toast.success { border-left-color: var(--good); color: var(--good); }
.toast.error { border-left-color: var(--danger); color: var(--danger); }
.toast.warn { border-left-color: var(--warn); color: var(--warn); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

.login-wrap { min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; padding: 40px 20px; }
.login-card {
  background: var(--bg); border-radius: var(--radius-lg); padding: 48px 40px;
  box-shadow: var(--nm-shadow-out); max-width: 440px; width: 100%; text-align: center;
}
.login-card .login-icon {
  width: 72px; height: 72px; margin: 0 auto 20px; display: flex; align-items: center; justify-content: center;
  background: var(--bg); border-radius: 50%; box-shadow: var(--nm-shadow-out); font-size: 32px;
}
.login-card h1 { margin: 0 0 8px; font-size: 24px; }
.login-card .subtitle { color: var(--muted); margin: 0 0 28px; font-size: 13px; }
.login-card .form { text-align: left; }
.login-card .form label { font-size: 11px; }
.login-card .btn-primary { width: 100%; justify-content: center; padding: 14px; font-size: 14px; }

.empty { text-align: center; padding: 48px 24px; color: var(--muted); }
.empty .icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.empty p { margin: 6px 0; }

.footer { text-align: center; padding: 24px; color: var(--ink-2); font-size: 12px; }
.footer code { background: var(--bg); padding: 2px 8px; border-radius: 6px; box-shadow: var(--nm-shadow-in-sm); }

.loader {
  display: inline-block; width: 18px; height: 18px;
  border: 2px solid rgba(79, 70, 229, 0.2); border-top-color: var(--primary);
  border-radius: 50%; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 720px) {
  .nav { display: none; }
  .status-row { display: none; }
  .form-grid { grid-template-columns: 1fr; }
  .container { padding: 0 16px; }
  .card { padding: 20px; }
  .topbar { padding: 12px 16px; }
}
