:root {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --border: #dce2eb;
  --text: #182230;
  --muted: #5b6778;
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #15803d;
  --success-bg: #dcfce7;
  --danger: #b91c1c;
  --danger-bg: #fee2e2;
  --warn: #b45309;
  --warn-bg: #fef3c7;
  --radius: 10px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.45;
}

a {
  color: var(--primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.topbar {
  background: #0f172a;
  color: #f8fafc;
  padding: 0 20px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 56px;
}

.brand {
  font-weight: 700;
  font-size: 17px;
  letter-spacing: 0.2px;
  color: #fff;
}

.nav {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.nav a {
  color: #cbd5e1;
  padding: 8px 12px;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 500;
}

.nav a.active,
.nav a:hover {
  background: #1e293b;
  color: #fff;
  text-decoration: none;
}

.user-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  color: #cbd5e1;
}

.container {
  max-width: 1280px;
  margin: 20px auto;
  padding: 0 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 16px;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.card-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

h1, h2, h3 {
  margin: 0 0 12px 0;
}

h1 {
  font-size: 22px;
}

h2 {
  font-size: 18px;
}

.row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}

.col {
  flex: 1 1 220px;
}

label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 4px;
}

input[type="text"],
input[type="password"],
input[type="number"],
select,
textarea {
  width: 100%;
  padding: 9px 11px;
  border: 1px solid var(--border);
  border-radius: 7px;
  font-size: 14px;
  background: #fff;
  color: var(--text);
}

input:focus,
select:focus {
  outline: 2px solid rgba(37, 99, 235, 0.25);
  border-color: var(--primary);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 7px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  background: #e2e8f0;
  color: var(--text);
}

.btn:hover {
  background: #cbd5e1;
  text-decoration: none;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-success {
  background: var(--success);
  color: #fff;
}

.btn-danger {
  background: var(--danger);
  color: #fff;
}

.btn-sm {
  padding: 5px 10px;
  font-size: 13px;
}

.alert {
  padding: 11px 14px;
  border-radius: 8px;
  margin-bottom: 14px;
  font-size: 14px;
  font-weight: 500;
}

.alert-success {
  background: var(--success-bg);
  color: var(--success);
  border: 1px solid #86efac;
}

.alert-danger {
  background: var(--danger-bg);
  color: var(--danger);
  border: 1px solid #fca5a5;
}

.alert-warn {
  background: var(--warn-bg);
  color: var(--warn);
  border: 1px solid #fcd34d;
}

.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: #e2e8f0;
  color: #334155;
}

.badge-new { background: #dbeafe; color: #1d4ed8; }
.badge-confirm { background: #fef3c7; color: #92400e; }
.badge-packed { background: #dcfce7; color: #15803d; }
.badge-complete { background: #e0e7ff; color: #3730a3; }
.badge-cancel { background: #fee2e2; color: #b91c1c; }
.badge-kiz { background: #f3e8ff; color: #6b21a8; }

.table-wrap {
  overflow-x: auto;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

th, td {
  text-align: left;
  padding: 10px 8px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

th {
  font-size: 12px;
  text-transform: uppercase;
  color: var(--muted);
  background: #f8fafc;
}

.thumb {
  width: 46px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: #f1f5f9;
}

.thumb-lg {
  width: 110px;
  height: 140px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
}

.auth-box {
  max-width: 420px;
  margin: 60px auto;
}

.scan-input {
  font-size: 18px !important;
  padding: 13px 14px !important;
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 100;
  padding: 16px;
}

.modal-backdrop.open {
  display: flex;
}

.modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  max-width: 520px;
  width: 100%;
}

#camera-video {
  width: 100%;
  border-radius: 8px;
  background: #000;
  max-height: 360px;
}

.muted {
  color: var(--muted);
  font-size: 13px;
}

.mono {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
}

.password-field {
  position: relative;
  display: flex;
  align-items: center;
  width: 100%;
}

.password-field input {
  padding-right: 38px;
}

.password-toggle-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 5px;
}

.password-toggle-btn:hover {
  color: var(--text);
  background: #f1f5f9;
}

@media print {
  .no-print {
    display: none !important;
  }
  body {
    background: #fff;
  }
  .card {
    border: none;
    box-shadow: none;
    padding: 0;
  }
}
