:root {
  --bg: #0f172a;
  --card: #1e293b;
  --line: #334155;
  --text: #e2e8f0;
  --muted: #94a3b8;
  --pri: #2563eb;
  --ok: #22c55e;
  --warn: #f59e0b;
  --bad: #ef4444;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: Segoe UI, system-ui, sans-serif; background: var(--bg); color: var(--text); min-height: 100vh; }
.brand-bar {
  text-align: center;
  padding: 20px 16px 16px;
  background: linear-gradient(180deg, #1e3a5f 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.brand-title {
  font-size: clamp(1.75rem, 5vw, 2.75rem);
  font-weight: 800;
  letter-spacing: 0.06em;
  line-height: 1.15;
  color: #fff;
  text-shadow: 0 2px 12px rgba(37, 99, 235, 0.45);
}
.hidden { display: none !important; }
.muted { color: var(--muted); font-size: 0.9rem; }
.err { color: var(--bad); font-size: 0.875rem; margin-top: 8px; }
.box, .card-order { background: var(--card); border: 1px solid var(--line); border-radius: 10px; padding: 16px; }
label { display: block; font-size: 0.85rem; color: var(--muted); margin: 10px 0 4px; }
input:not([type="checkbox"]):not([type="radio"]), select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  color: var(--text);
}
input[type="checkbox"], input[type="radio"] {
  width: 18px;
  height: 18px;
  margin: 0;
  padding: 0;
  flex-shrink: 0;
  accent-color: var(--pri);
}
.btn { border: 0; border-radius: 8px; padding: 10px 14px; cursor: pointer; font-weight: 600; }
.primary { background: var(--pri); color: #fff; }
.ghost { background: transparent; color: var(--text); border: 1px solid var(--line); }
.success { background: var(--ok); color: #fff; }
.full { width: 100%; }
.login-wrap { min-height: calc(100vh - 90px); display: flex; align-items: center; justify-content: center; padding: 16px; }
.login-wrap .box { width: 100%; max-width: 400px; }
.auth-box { width: 100%; max-width: 400px; }
.auth-alt { margin-top: 10px; }
.auth-heading { font-size: 1.1rem; margin: 8px 0 12px; }
.btn-link { background: none; border: 0; color: var(--muted); cursor: pointer; font-size: 0.85rem; padding: 0 0 8px; }
.btn-link:hover { color: var(--text); }
.ok-msg { color: var(--ok); font-size: 0.875rem; margin-top: 8px; }
.head { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; background: var(--card); border-bottom: 1px solid var(--line); }
.head-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.head-actions a { text-decoration: none; }
.page-title { font-size: 1.15rem; font-weight: 700; margin-bottom: 4px; }
.page-wrap { max-width: 960px; margin: 0 auto; padding: 16px; }
.agents-page { display: grid; gap: 16px; }
.bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: space-between; align-items: center; padding: 12px 16px; }
.bar-actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; flex-shrink: 0; }
.gate-btn { border-color: #f59e0b; color: #fcd34d; }
.gate-btn.gate-btn-active { background: rgba(245, 158, 11, 0.15); }
.btn-add-blocked { opacity: 0.65; border-color: #f59e0b; }
.order-gate-banner {
  margin: 0 16px 8px;
  padding: 10px 14px;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.45);
  border-radius: 8px;
  color: #fcd34d;
  font-size: 0.9rem;
  line-height: 1.45;
}
.order-gate-banner strong { display: block; margin-bottom: 4px; }
.order-closed-reason {
  margin-top: 10px;
  padding: 12px 14px;
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 8px;
  white-space: pre-wrap;
  line-height: 1.5;
}
.gate-check { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; font-weight: 600; }
#gate-reason {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #0b1220;
  color: var(--text);
  font: inherit;
  resize: vertical;
  min-height: 88px;
}
.tabs { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.tab { background: #0b1220; border: 1px solid var(--line); color: var(--muted); padding: 8px 12px; border-radius: 8px; cursor: pointer; }
.tab.active { background: var(--pri); border-color: var(--pri); color: #fff; }
.tab.hidden { display: none; }
.tab.tab-done.active { background: #166534; border-color: #166534; }
.tab.tab-klasemen { margin-left: auto; }
.tag { font-size: 0.7rem; background: #1e3a5f; color: #93c5fd; padding: 2px 8px; border-radius: 99px; margin-left: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 12px; padding: 0 16px 16px; }
.card-order { cursor: pointer; transition: border 0.15s; }
.card-order:hover { border-color: var(--pri); }
.badge { font-size: 0.7rem; font-weight: 700; text-transform: uppercase; padding: 2px 6px; border-radius: 4px; margin-right: 6px; }
.badge.partial { background: #fef3c7; color: #92400e; }
.badge.available { background: #dbeafe; color: #1e40af; }
.badge.claimed { background: #ffedd5; color: #c2410c; }
.badge.completed { background: #dcfce7; color: #166534; }
.badge.expired { background: #f3f4f6; color: #4b5563; }
.available { background: #1e3a5f; color: #93c5fd; }
.claimed { background: #422006; color: #fcd34d; }
.completed { background: #14532d; color: #86efac; }
.expired { background: #450a0a; color: #fca5a5; }
.meta { font-size: 0.85rem; color: var(--muted); margin-top: 8px; line-height: 1.5; }
.empty { text-align: center; padding: 40px; color: var(--muted); }
.grid-form { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 8px; align-items: end; }
.box h2 { font-size: 1rem; margin-bottom: 12px; }
.tbl { width: 100%; border-collapse: collapse; margin-top: 8px; }
.tbl th, .tbl td { border: 1px solid var(--line); padding: 8px; text-align: left; font-size: 0.9rem; }
.role-sel { min-width: 110px; margin: 0; }
.tbl th { color: var(--muted); }
.tbl-order-detail { table-layout: fixed; width: 100%; min-width: 640px; }
.tbl-order-detail th,
.tbl-order-detail td { vertical-align: top; word-wrap: break-word; overflow-wrap: anywhere; }
.tbl-order-detail th:nth-child(1),
.tbl-order-detail td:nth-child(1) { width: 40px; }
.tbl-order-detail th:nth-child(2),
.tbl-order-detail td:nth-child(2) { width: 38%; min-width: 200px; }
.tbl-order-detail th:nth-child(3),
.tbl-order-detail td:nth-child(3) { width: 16%; min-width: 96px; }
.tbl-order-detail th:nth-child(4),
.tbl-order-detail td:nth-child(4) { width: 11%; min-width: 80px; white-space: nowrap; }
.tbl-order-detail th:nth-child(5),
.tbl-order-detail td:nth-child(5) { width: 14%; min-width: 88px; }
.tbl-order-detail th:nth-child(6),
.tbl-order-detail td:nth-child(6) { width: 12%; min-width: 72px; }
.tbl-order-detail .pax-form { display: flex; flex-direction: column; gap: 6px; max-width: 100%; }
.tbl-order-detail .pax-form input[type=text],
.tbl-order-detail .pax-form input:not([type=file]) { width: 100%; max-width: 100%; box-sizing: border-box; }
.tg-inp { width: 100%; min-width: 100px; max-width: 160px; padding: 6px 8px; border: 1px solid var(--line); border-radius: 6px; background: #0b1220; color: var(--text); font: inherit; }
.tg-activate-btn { text-align: center; text-decoration: none; display: block; margin-top: 4px; }
.act-cell { white-space: nowrap; }
.btn-sm { padding: 6px 10px; font-size: 0.85rem; }
.danger-text { color: #f87171; }
.danger-text:hover { background: rgba(248, 113, 113, 0.12); }
.dlg { border: 0; border-radius: 10px; background: var(--card); color: var(--text); padding: 0; width: calc(100% - 24px); max-width: 520px; }
#dlg-order { max-width: 580px; }
#dlg-claim { max-width: min(560px, calc(100vw - 24px)); }
.dlg.wide { max-width: min(960px, calc(100vw - 24px)); }
#dlg-detail .dlg-b { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.dlg::backdrop { background: rgba(0,0,0,0.65); }
.dlg-h, .dlg-f { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.dlg-f { border-bottom: 0; border-top: 1px solid var(--line); gap: 8px; justify-content: flex-end; }
.dlg-b { padding: 16px; max-height: 70vh; overflow: auto; }
.x { background: none; border: 0; color: var(--muted); font-size: 1.4rem; cursor: pointer; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dt-row { display: grid; grid-template-columns: 1fr auto; gap: 8px; align-items: start; }
.date-dd { display: grid; grid-template-columns: 72px 1fr 88px; gap: 6px; }
.date-dd select { margin: 0; padding: 8px 6px; font-size: 0.85rem; }
.time-dd { display: grid; grid-template-columns: 72px 72px; gap: 6px; min-width: 150px; }
.time-dd select { margin: 0; padding: 8px 6px; font-size: 0.85rem; }
.pax-date-dd { margin-top: 0; }
.field-hint { display: block; font-size: 0.75rem; color: var(--muted); margin-top: 4px; }
.pax-head { margin: 12px 0 8px; }
.pax-add-btn { margin: 4px 0 14px; }
.pax-card { border: 1px solid var(--line); border-radius: 8px; padding: 10px; margin-bottom: 10px; background: #0b1220; }
.pax-card-top { display: grid; grid-template-columns: minmax(120px, 140px) 1fr auto; gap: 8px; align-items: center; }
.pax-card-top input, .pax-card-top select { margin: 0; }
.pax-opt { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.pax-opt > div:last-child { grid-column: 1 / -1; }
.opt-lbl { display: block; font-size: 0.72rem; color: var(--muted); margin-bottom: 4px; }
.pax-meta { font-size: 0.8rem; color: var(--muted); margin-top: 4px; line-height: 1.4; }
.order-shot { margin: 12px 0; }
.shot-lbl { font-size: 0.85rem; color: var(--muted); margin-bottom: 8px; }
.shot-img { max-width: 100%; max-height: 320px; border-radius: 8px; border: 1px solid var(--line); display: block; cursor: pointer; }
input[type=file] { font-size: 0.85rem; padding: 8px; }
.rp-input { font-variant-numeric: tabular-nums; letter-spacing: 0.02em; }
.price-preview-box { margin-top: 12px; }
.price-box {
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  font-size: 0.88rem;
}
.price-box-title { display: block; margin-bottom: 10px; font-size: 0.9rem; }
.price-lines { list-style: none; margin: 0 0 10px; padding: 0; border-bottom: 1px solid var(--line); }
.price-line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  border-bottom: 1px dashed #1e293b;
  color: var(--muted);
}
.price-line:last-child { border-bottom: 0; }
.price-line span:last-child { color: var(--text); font-weight: 600; white-space: nowrap; }
.price-totals { display: flex; flex-direction: column; gap: 6px; }
.price-row { display: flex; justify-content: space-between; gap: 12px; }
.price-row.disc span:last-child { color: var(--warn); }
.price-row.grand {
  margin-top: 4px;
  padding-top: 8px;
  border-top: 1px solid var(--line);
  font-size: 1rem;
  font-weight: 700;
}
.price-row.grand span:last-child { color: var(--ok); }
.price-note { margin-top: 8px; font-size: 0.75rem; color: var(--muted); }
.claim-pax-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 12px;
  max-height: 280px;
  overflow-y: auto;
  overflow-x: hidden;
}
.claim-pax-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid #1e293b;
  border-radius: 8px;
  cursor: pointer;
  width: 100%;
  box-sizing: border-box;
}
.claim-pax-item input[type="checkbox"] { margin-top: 2px; }
.claim-pax-item > span {
  flex: 1;
  min-width: 0;
  line-height: 1.45;
  word-wrap: break-word;
  overflow-wrap: anywhere;
  color: var(--text);
}
.claim-pax-item strong { display: block; color: var(--text); }
.claim-pax-item .muted { display: block; font-size: 0.85rem; margin-top: 4px; }

.claim-history {
  background: #0b1220;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 12px;
  font-size: 0.88rem;
}
.claim-history-title { display: block; margin-bottom: 8px; }
.claim-history-list { list-style: none; margin: 0; padding: 0; }
.claim-history-list li { padding: 6px 0; border-bottom: 1px dashed #1e293b; color: var(--muted); line-height: 1.45; }
.claim-history-list li:last-child { border-bottom: 0; }
.warn-btn { color: var(--warn); border-color: #854d0e; }
.warn-btn:hover { background: #422006; }
.danger-btn { color: var(--bad); border-color: #7f1d1d; }
.danger-btn:hover { background: #450a0a; }
.lb-summary {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 10px;
  padding: 0 16px 14px;
}
.lb-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 14px;
  text-align: center;
}
.lb-card.highlight { border-color: var(--pri); background: linear-gradient(180deg, #1e3a5f 0%, var(--card) 100%); }
.lb-card .lb-lbl { display: block; font-size: 0.75rem; color: var(--muted); margin-bottom: 6px; }
.lb-card strong { font-size: 1.25rem; }
.lb-box { margin: 0 16px 16px; }
.lb-title { margin-bottom: 12px; font-size: 1rem; }
.lb-rank { font-size: 1.1rem; font-weight: 700; }
.lb-top { background: rgba(37, 99, 235, 0.08); }
.lb-me { outline: 1px solid var(--pri); }
@media (max-width: 520px) { .pax-opt { grid-template-columns: 1fr; } .pax-opt > div:last-child { grid-column: auto; } }
.summary { background: #0b1220; border: 1px solid var(--line); border-radius: 8px; padding: 12px; margin-bottom: 12px; font-size: 0.9rem; line-height: 1.6; }
.countdown { font-size: 1.1rem; font-weight: 700; color: var(--warn); margin: 8px 0 12px; }
.countdown.urgent { color: var(--bad); }
.pax-form input[type=file] { font-size: 0.8rem; margin-top: 4px; }
.link { color: var(--pri); font-size: 0.85rem; }
@media (max-width: 600px) { .row2 { grid-template-columns: 1fr; } }
