* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Inter', -apple-system, 'Segoe UI', Roboto, sans-serif; background: #0f1115; color: #e7e9ee; min-height: 100vh; }

/* ─── Login — Tec Premium ─── */
.login-body {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background:
    radial-gradient(ellipse at top left, rgba(0, 61, 165, 0.25) 0%, transparent 50%),
    radial-gradient(ellipse at bottom right, rgba(132, 204, 22, 0.12) 0%, transparent 55%),
    linear-gradient(135deg, #0A1628 0%, #001F54 55%, #0F172A 100%);
  padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-body::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image:
    radial-gradient(circle at 25% 30%, rgba(132, 204, 22, 0.08) 0%, transparent 3%),
    radial-gradient(circle at 75% 80%, rgba(132, 204, 22, 0.06) 0%, transparent 2%);
  pointer-events: none;
}
.login-card {
  width: 100%;
  max-width: 440px;
  background: rgba(255, 255, 255, 0.98);
  padding: 44px 40px;
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow:
    0 2px 4px rgba(0, 0, 0, 0.05),
    0 12px 40px rgba(0, 31, 84, 0.30),
    0 0 0 1px rgba(132, 204, 22, 0.1);
  position: relative;
  z-index: 1;
}
.login-card::before {
  content: '';
  position: absolute;
  top: -2px; left: -2px; right: -2px; bottom: -2px;
  background: linear-gradient(135deg, #003DA5 0%, #84CC16 100%);
  border-radius: 18px;
  z-index: -1;
  opacity: 0.35;
  filter: blur(8px);
}
.login-card h1 {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-size: 1.65rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0F172A;
  margin-bottom: 6px;
}
.login-sub {
  font-size: 0.92rem;
  color: #475569;
  margin-bottom: 28px;
  line-height: 1.4;
}
.login-card label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  margin-top: 16px;
  margin-bottom: 6px;
  color: #475569;
  letter-spacing: 0.01em;
}
.login-card input {
  width: 100%;
  padding: 12px 14px;
  background: #FAFBFC;
  border: 1.5px solid #E2E8F0;
  border-radius: 10px;
  color: #0F172A;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}
.login-card input:focus {
  outline: none;
  border-color: #003DA5;
  background: #FFFFFF;
  box-shadow: 0 0 0 4px rgba(0, 61, 165, 0.12);
}
.login-card input:hover:not(:focus) {
  border-color: #CBD5E1;
}
.login-card button {
  width: 100%;
  margin-top: 24px;
  padding: 13px;
  background: linear-gradient(135deg, #003DA5 0%, #0050D4 100%);
  color: #FFFFFF;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  font-family: inherit;
  box-shadow: 0 2px 6px rgba(0, 61, 165, 0.25);
  transition: all 150ms ease;
  position: relative;
  overflow: hidden;
}
.login-card button::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, transparent 0%, rgba(132, 204, 22, 0.2) 100%);
  opacity: 0;
  transition: opacity 150ms ease;
}
.login-card button:hover:not(:disabled) {
  background: linear-gradient(135deg, #0050D4 0%, #003DA5 100%);
  box-shadow: 0 4px 14px rgba(0, 61, 165, 0.40);
  transform: translateY(-1px);
}
.login-card button:hover:not(:disabled)::after { opacity: 1; }
.login-card button:active:not(:disabled) { transform: translateY(0); box-shadow: 0 2px 4px rgba(0, 61, 165, 0.30); }
.login-card button:disabled { opacity: 0.6; cursor: not-allowed; }

.msg { margin-top: 12px; font-size: 0.85rem; min-height: 1em; font-weight: 500; }
.msg.error { color: #DC2626; }
.msg.ok { color: #16A34A; }

/* ─── Topbar ─── */
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; background: #1a1d25; border-bottom: 1px solid #2a2e3a; }
.topbar-left { display: flex; align-items: center; gap: 12px; }
.topbar-left h1 { font-size: 1.2rem; }
.pill { font-size: 0.7rem; background: #2a2e3a; padding: 3px 10px; border-radius: 12px; color: #8a8f9a; }
.topbar-right { display: flex; align-items: center; gap: 10px; }
.btn-ghost { background: transparent; color: #b8bcc7; border: 1px solid #2a2e3a; padding: 7px 14px; border-radius: 6px; font-size: 0.85rem; cursor: pointer; }
.btn-ghost:hover { background: #2a2e3a; color: #fff; }
.sse-status { font-size: 0.75rem; color: #8a8f9a; padding: 4px 10px; border-radius: 10px; background: #2a2e3a; }
.sse-status.connected { background: rgba(46,204,113,0.15); color: #2ecc71; }
.sse-status.error { background: rgba(231,76,60,0.15); color: #e74c3c; }

/* ─── Kanban ─── */
.kanban { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; padding: 20px; min-height: calc(100vh - 60px); }
.column { background: #141720; border-radius: 10px; border: 1px solid #2a2e3a; display: flex; flex-direction: column; overflow: hidden; }
.column header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid #2a2e3a; }
.column h2 { font-size: 0.9rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: #b8bcc7; }
.count { background: #2a2e3a; padding: 3px 10px; border-radius: 10px; font-size: 0.75rem; font-weight: 700; }
.column[data-status="0"] .count { background: rgba(74,144,226,0.2); color: #4a90e2; }
.column[data-status="1"] .count { background: rgba(241,196,15,0.2); color: #f1c40f; }
.column[data-status="2"] .count { background: rgba(230,126,34,0.2); color: #e67e22; }
.column[data-status="3"] .count { background: rgba(46,204,113,0.2); color: #2ecc71; }
.column[data-status="4"] .count { background: rgba(149,165,166,0.2); color: #95a5a6; }
.col-body { flex: 1; padding: 12px; overflow-y: auto; display: flex; flex-direction: column; gap: 10px; }

/* ─── Order card ─── */
.order-card { background: #1a1d25; border: 1px solid #2a2e3a; border-radius: 8px; padding: 14px; cursor: pointer; transition: all 0.2s; }
.order-card:hover { border-color: #4a90e2; transform: translateY(-1px); }
.order-card.new { animation: pulse 2s ease-in-out 3; border-color: #4a90e2; }
@keyframes pulse { 0%,100% { box-shadow: 0 0 0 0 rgba(74,144,226,0.5); } 50% { box-shadow: 0 0 0 8px rgba(74,144,226,0); } }
.order-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.order-id { font-size: 0.75rem; color: #8a8f9a; font-family: ui-monospace, monospace; }
.order-time { font-size: 0.7rem; color: #8a8f9a; }
.order-customer { font-weight: 600; font-size: 0.95rem; margin-bottom: 4px; }
.order-phone { font-size: 0.8rem; color: #b8bcc7; margin-bottom: 8px; }
.order-total { font-size: 1.1rem; font-weight: 700; color: #4a90e2; }
.order-items-preview { font-size: 0.78rem; color: #8a8f9a; margin-top: 6px; }
.order-actions { display: flex; gap: 6px; margin-top: 10px; }
.order-actions button { flex: 1; padding: 6px 8px; font-size: 0.75rem; background: #2a2e3a; color: #e7e9ee; border: none; border-radius: 5px; cursor: pointer; }
.order-actions button:hover { background: #3a3e4a; }
.order-actions .primary { background: #4a90e2; color: white; }
.order-actions .primary:hover { background: #3a7ed2; }

/* ─── Modal ─── */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,0.7); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal[hidden] { display: none !important; }
.modal-card { background: #1a1d25; border: 1px solid #2a2e3a; border-radius: 10px; padding: 28px; max-width: 520px; width: 100%; max-height: 90vh; overflow-y: auto; position: relative; }
.modal-close { position: absolute; top: 10px; right: 14px; background: transparent; border: none; color: #8a8f9a; font-size: 1.8rem; cursor: pointer; line-height: 1; }
.modal-card h2 { margin-bottom: 14px; font-size: 1.3rem; }
.modal-card .hint { font-size: 0.82rem; color: #8a8f9a; margin-bottom: 14px; }
.modal-card label { display: block; font-size: 0.85rem; margin-top: 12px; margin-bottom: 6px; color: #b8bcc7; }
.modal-card input { width: 100%; padding: 10px 12px; background: #10121a; border: 1px solid #2a2e3a; border-radius: 6px; color: #e7e9ee; }
.modal-card button { margin-top: 16px; padding: 10px 18px; background: #4a90e2; color: white; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; }

/* ─── Detail modal ─── */
.detail-section { margin-top: 16px; padding-top: 16px; border-top: 1px solid #2a2e3a; }
.detail-section h3 { font-size: 0.85rem; text-transform: uppercase; color: #8a8f9a; margin-bottom: 10px; letter-spacing: 0.5px; }
.detail-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 0.9rem; }
.detail-row strong { color: #b8bcc7; }
.status-buttons { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; margin-top: 16px; }
.status-buttons button { padding: 10px; font-size: 0.85rem; background: #2a2e3a; color: #e7e9ee; border: none; border-radius: 6px; cursor: pointer; font-weight: 600; }
.status-buttons button:hover { background: #3a3e4a; }
.status-buttons button.active { background: #4a90e2; color: white; }

@media (max-width: 1280px) { .kanban { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 900px)  { .kanban { grid-template-columns: 1fr 1fr; } }
@media (max-width: 600px)  { .kanban { grid-template-columns: 1fr; } }

/* Seq num + MP badge + kitchen notes */
.seq-num { display:inline-block; background:#4a90e2; color:#fff; padding:2px 8px; border-radius:12px; font-weight:700; font-size:0.8rem; margin-right:6px; }
.mp-badge { display:inline-block; padding:2px 8px; border-radius:10px; font-size:0.7rem; font-weight:700; margin-left:6px; text-transform:uppercase; }
.mp-badge.mp-approved { background: rgba(46,204,113,0.2); color:#2ecc71; }
.mp-badge.mp-pending { background: rgba(241,196,15,0.2); color:#f1c40f; }
.mp-badge.mp-rejected, .mp-badge.mp-cancelled { background: rgba(231,76,60,0.2); color:#e74c3c; }
.mp-badge.mp-in_process, .mp-badge.mp-authorized { background: rgba(74,144,226,0.2); color:#4a90e2; }
.order-kitchen-notes { background: rgba(241,196,15,0.1); color:#f1c40f; padding:6px 8px; border-radius:5px; font-size:0.78rem; margin-top:6px; border-left:2px solid #f1c40f; }
.modal-card h3 { font-size:0.95rem; color:#b8bcc7; margin-bottom:6px; }
.modal-card input[type="password"], .modal-card input[type="url"] { font-family: ui-monospace, monospace; font-size:0.85rem; }
