@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #e0e7ff 50%, #f0f9ff 100%);
  min-height: 100vh;
}

.glass {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.bottom-bar {
  box-shadow: 0 -6px 24px rgba(0, 0, 0, 0.07);
}

.source-tt {
  background: linear-gradient(135deg, #00f2ea 0%, #ff0050 100%);
}

.source-fb {
  background: linear-gradient(135deg, #1877f2 0%, #42b72a 100%);
}

input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer;
  opacity: 0.55;
}

.fade-in {
  animation: fadeIn 0.28s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-backdrop {
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(5px);
}

/* Custom radio cards */
.peer:checked + div {
  border-color: currentColor;
}

/* Scrollbar */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: #cbd5e1;
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: #94a3b8;
}

/* Toast animation */
#toast:not(.hidden) {
  animation: slideIn 0.3s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

/* ===== Dark theme ===== */
html.dark body,
html.dark {
  color-scheme: dark;
}
html.dark body {
  background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%);
  color: #e2e8f0;
}
html.dark .glass {
  background: rgba(30, 41, 59, 0.85);
  border-color: rgba(71, 85, 105, 0.5);
}
html.dark header,
html.dark .bottom-bar {
  background: rgba(15, 23, 42, 0.92) !important;
  border-color: rgba(51, 65, 85, 0.8) !important;
}
html.dark .text-slate-800 { color: #f1f5f9 !important; }
html.dark .text-slate-700 { color: #e2e8f0 !important; }
html.dark .text-slate-600 { color: #cbd5e1 !important; }
html.dark .text-slate-500 { color: #94a3b8 !important; }
html.dark .text-slate-400 { color: #94a3b8 !important; }
html.dark .bg-white,
html.dark .bg-white\/80,
html.dark .bg-white\/95 {
  background-color: rgba(30, 41, 59, 0.95) !important;
}
html.dark .bg-slate-50,
html.dark .bg-slate-100 {
  background-color: #1e293b !important;
}
html.dark .border-slate-100,
html.dark .border-slate-200 {
  border-color: #334155 !important;
}
html.dark input,
html.dark select,
html.dark textarea {
  background-color: #1e293b !important;
  border-color: #475569 !important;
  color: #f1f5f9 !important;
}
html.dark table thead { background-color: #1e293b !important; }
html.dark .divide-slate-100 > * { border-color: #334155 !important; }
html.dark #loginScreen { background: linear-gradient(135deg, #020617, #1e1b4b, #020617) !important; }
html.dark #loadingOverlay { background: rgba(2, 6, 23, 0.55) !important; }


/* Orders cards + modal dark */
.order-card { transition: background 0.15s; }
html.dark #ordersModal .bg-white {
  background-color: #0f172a !important;
  border: 1px solid #334155;
}
html.dark #ordersModal .border-b {
  border-color: #334155 !important;
}
html.dark #ordersModal .bg-slate-100,
html.dark #ordersModal .hover\:bg-slate-200:hover {
  background-color: #1e293b !important;
}
html.dark .order-card {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}
html.dark .order-card:hover,
html.dark .order-card > div:first-child:hover {
  background-color: #243044 !important;
}
html.dark .order-details {
  background-color: #0f172a !important;
  border-color: #334155 !important;
}
html.dark .order-details pre {
  color: #cbd5e1 !important;
}
html.dark .order-card .border-r {
  border-color: #475569 !important;
}
html.dark #ordersModal select {
  background-color: #1e293b !important;
  border-color: #475569 !important;
  color: #e2e8f0 !important;
}
html.dark #auditModal .bg-white {
  background-color: #0f172a !important;
  border: 1px solid #334155;
}


/* Открытые заявки: новая / в работе */
.order-card.order-open-new {
  background: #eff6ff !important;
  border: 1px solid #93c5fd !important;
  box-shadow: inset 3px 0 0 #3b82f6;
}
.order-card.order-open-progress {
  background: #fffbeb !important;
  border: 1px solid #fcd34d !important;
  box-shadow: inset 3px 0 0 #f59e0b;
}
.order-card.order-issued {
  background: #f8fafc !important;
  border: 1px solid #e2e8f0 !important;
  opacity: 0.92;
}
html.dark .order-card.order-open-new {
  background: rgba(30, 64, 175, 0.25) !important;
  border-color: #3b82f6 !important;
  box-shadow: inset 3px 0 0 #60a5fa;
}
html.dark .order-card.order-open-progress {
  background: rgba(146, 64, 14, 0.28) !important;
  border-color: #f59e0b !important;
  box-shadow: inset 3px 0 0 #fbbf24;
}
html.dark .order-card.order-issued {
  background: #1e293b !important;
  border-color: #334155 !important;
  opacity: 0.85;
}


#orderPlatformRow label:has(input[value="TT"]):hover > div {
  border-color: #ec4899; background-color: #fdf2f8; color: #be185d;
}
#orderPlatformRow label:has(input[value="FB"]):hover > div {
  border-color: #3b82f6; background-color: #eff6ff; color: #1d4ed8;
}
#orderPlatformRow label:has(input[value="TT"]:checked) > div {
  border-color: #ec4899 !important; background-color: #fdf2f8 !important; color: #be185d !important;
}
#orderPlatformRow label:has(input[value="FB"]:checked) > div {
  border-color: #3b82f6 !important; background-color: #eff6ff !important; color: #1d4ed8 !important;
}
#tabOrderLanding:hover { border-color: #34d399; color: #047857; }
#tabOrderLanding.is-on {
  border-color: #10b981 !important; background: #ecfdf5 !important; color: #047857 !important;
}
#orderPlatformRow.is-idle label > div,
#orderPlatformRow.is-idle label:has(input:checked) > div {
  border-color: #e2e8f0 !important; background-color: #fff !important; color: #475569 !important;
}
#orderPlatformRow.is-idle label:has(input[value="TT"]):hover > div {
  border-color: #ec4899 !important; background-color: #fdf2f8 !important; color: #be185d !important;
}
#orderPlatformRow.is-idle label:has(input[value="FB"]):hover > div {
  border-color: #3b82f6 !important; background-color: #eff6ff !important; color: #1d4ed8 !important;
}
#sectionOrderAccount.order-tint-tt {
  box-shadow: 0 0 0 1px rgba(236, 72, 153, 0.22);
  background: linear-gradient(135deg, rgba(253, 242, 248, 0.65), rgba(255, 255, 255, 0.9));
}
#sectionOrderAccount.order-tint-fb {
  box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.22);
  background: linear-gradient(135deg, rgba(239, 246, 255, 0.65), rgba(255, 255, 255, 0.9));
}
#sectionOrderAccount.order-tint-land {
  box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.25);
  background: linear-gradient(135deg, rgba(236, 253, 245, 0.7), rgba(255, 255, 255, 0.9));
}
html.dark #sectionOrderAccount.order-tint-tt {
  background: linear-gradient(135deg, rgba(131, 24, 67, 0.15), rgba(30, 41, 59, 0.9));
}
html.dark #sectionOrderAccount.order-tint-fb {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.15), rgba(30, 41, 59, 0.9));
}
html.dark #sectionOrderAccount.order-tint-land {
  background: linear-gradient(135deg, rgba(6, 95, 70, 0.2), rgba(30, 41, 59, 0.9));
}

.req-star { color: #ef4444; font-weight: 700; margin-left: 1px; }
html.dark .req-star { color: #f87171; }
.land-form-compact .land-drop { min-height: 0; }
.land-form-compact #landProductLinks > div,
.land-form-compact #landGiftLinks > div {
  padding: 0.25rem 0.35rem !important; gap: 0.35rem !important; border-radius: 0.5rem !important;
}
.land-form-compact #landProductLinks input.land-url,
.land-form-compact #landGiftLinks input.land-url {
  padding: 0.3rem 0.5rem !important; font-size: 0.8125rem !important; border-radius: 0.5rem !important;
}
.land-thumb { cursor: default; object-fit: cover; border-radius: 0.4rem; }
.land-form-compact .land-thumb { width: 2.5rem; height: 2.5rem; }


html.dark #orderPanelLanding input,
html.dark #orderPanelLanding select,
html.dark #orderPanelLanding textarea,
html.dark #orderPanelLanding .land-url {
  background-color: #1e293b !important;
  border-color: #334155 !important;
  color: #e2e8f0 !important;
}
html.dark #orderPanelLanding input::placeholder,
html.dark #orderPanelLanding textarea::placeholder,
html.dark #orderPanelLanding .land-url::placeholder {
  color: #64748b !important;
}
html.dark #orderPanelLanding .land-drop {
  background-color: rgba(15, 23, 42, 0.6) !important;
  border-color: #334155 !important;
}
html.dark #orderPanelLanding #landProductLinks > div,
html.dark #orderPanelLanding #landGiftLinks > div {
  background-color: #1e293b !important;
  border-color: #334155 !important;
}
html.dark #orderPanelLanding .text-emerald-600,
html.dark #orderPanelLanding .text-emerald-700 {
  color: #34d399 !important;
}
html.dark #landRefBlock {
  background: rgba(6, 78, 59, 0.35) !important;
  border-color: #065f46 !important;
}
html.dark #landBanBox {
  background: rgba(120, 53, 15, 0.35) !important;
  border-color: #b45309 !important;
  color: #fde68a !important;
}
html.dark #orderPlatformRow.is-idle label > div,
html.dark #orderPlatformRow.is-idle label:has(input:checked) > div {
  border-color: #334155 !important;
  background-color: #1e293b !important;
  color: #cbd5e1 !important;
}


.order-card.order-land-done {
  background: #ecfdf5 !important;
  border: 1px solid #6ee7b7 !important;
  box-shadow: inset 3px 0 0 #10b981 !important;
  opacity: 1 !important;
}
html.dark .order-card.order-land-done {
  background: rgba(6, 78, 59, 0.35) !important;
  border-color: #34d399 !important;
  box-shadow: inset 3px 0 0 #34d399 !important;
  opacity: 1 !important;
}
#landPreview {
  border-radius: 0.75rem;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
}
html.dark #landPreview {
  background: #0f172a;
  border-color: #334155;
  color: #e2e8f0;
}

.modal-panel {
  background: #ffffff;
  color: #0f172a;
  border: 1px solid #e2e8f0;
}
.modal-panel h3,
.modal-panel .font-semibold { color: #0f172a; }
html.dark .modal-panel {
  background: #1e293b;
  color: #e2e8f0;
  border-color: #334155;
}
html.dark .modal-panel h3,
html.dark .modal-panel .font-semibold { color: #f8fafc; }
html.dark .modal-panel .border-slate-100,
html.dark .modal-panel .border-b { border-color: #334155 !important; }
html.dark #orderPanelLanding input,
html.dark #orderPanelLanding select,
html.dark #orderPanelLanding textarea {
  background: #0f172a;
  color: #e2e8f0;
  border-color: #475569;
}

.history-float {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 4.75rem;
  z-index: 55;
  pointer-events: none;
}
.history-float button { pointer-events: auto; }
html.dark .history-float button {
  background: rgba(30, 41, 59, 0.95);
}

@keyframes login-spin { to { transform: rotate(360deg); } }
.login-spin { animation: login-spin 0.7s linear infinite; }
@keyframes login-pulse { 0%,100% { opacity: .55; } 50% { opacity: 1; } }
#loginAuthOverlay [data-i18n="login_auth"] { animation: login-pulse 1.2s ease-in-out infinite; }

input[type="date"], input[type="month"] {
  position: relative;
  min-height: 32px;
  height: 32px;
  cursor: pointer;
}
input[type="date"]::-webkit-calendar-picker-indicator,
input[type="month"]::-webkit-calendar-picker-indicator {
  display: none;
}
.jaja-cal {
  position: fixed;
  z-index: 130;
  width: 18.5rem;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 1rem;
  box-shadow: 0 18px 50px rgba(15,23,42,.18);
  padding: .75rem;
}
html.dark .jaja-cal {
  background: #1e293b;
  border-color: #334155;
  box-shadow: 0 18px 50px rgba(0,0,0,.45);
}
.jaja-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: .5rem;
  gap: .35rem;
}
.jaja-cal-head button {
  width: 2rem; height: 2rem;
  border-radius: .6rem;
  color: #64748b;
}
.jaja-cal-head button:hover { background: #f1f5f9; }
html.dark .jaja-cal-head button:hover { background: #334155; color: #e2e8f0; }
.jaja-cal-title { font-weight: 600; font-size: .9rem; }
.jaja-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: .2rem;
}
.jaja-cal-dow {
  text-align: center;
  font-size: .65rem;
  color: #94a3b8;
  padding: .15rem 0;
  text-transform: uppercase;
}
.jaja-cal-day, .jaja-cal-month {
  border-radius: .55rem;
  height: 2rem;
  font-size: .8rem;
  color: #334155;
}
html.dark .jaja-cal-day, html.dark .jaja-cal-month { color: #e2e8f0; }
.jaja-cal-day:hover, .jaja-cal-month:hover { background: #eef2ff; }
html.dark .jaja-cal-day:hover, html.dark .jaja-cal-month:hover { background: #312e81; }
.jaja-cal-day.is-mute { color: #cbd5e1; }
html.dark .jaja-cal-day.is-mute { color: #64748b; }
.jaja-cal-day.is-today, .jaja-cal-month.is-today { box-shadow: inset 0 0 0 1px #818cf8; }
.jaja-cal-day.is-on, .jaja-cal-month.is-on {
  background: #4f46e5;
  color: #fff;
}
.jaja-cal-months { display: grid; grid-template-columns: repeat(3, 1fr); gap: .35rem; }

.jaja-sel { position: relative; display: block; min-width: 0; }
.jaja-sel-btn {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.jaja-sel-btn {
  width: 100%;
  text-align: left;
  border: 1px solid #e2e8f0;
  border-radius: 0.65rem;
  padding: 0.35rem 1.6rem 0.35rem 0.6rem;
  background: #fff;
  font-size: 12px;
  line-height: 1.2;
  height: 32px;
  color: #334155;
  position: relative;
}
.jaja-sel-btn:after {
  content: '';
  position: absolute;
  right: .7rem; top: 50%;
  width: .4rem; height: .4rem;
  border-right: 2px solid #94a3b8;
  border-bottom: 2px solid #94a3b8;
  transform: translateY(-60%) rotate(45deg);
}
.jaja-sel.is-open .jaja-sel-btn:after { transform: translateY(-20%) rotate(225deg); }
.jaja-sel-menu {
  display: none;
  position: absolute;
  z-index: 80;
  left: 0; right: 0;
  top: calc(100% + 4px);
  max-height: 12.5rem;
  overflow: auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 0.85rem;
  box-shadow: 0 14px 40px rgba(15,23,42,.14);
  padding: .25rem;
}
.jaja-sel.is-open .jaja-sel-menu, .jaja-sel-menu.is-open { display: block; }
.jaja-sel-item {
  display: block;
  width: 100%;
  text-align: left;
  padding: .28rem .5rem;
  border-radius: .4rem;
  font-size: 12px;
  color: #334155;
}
.jaja-sel-item:hover { background: #eef2ff; }
.jaja-sel-item.is-on { background: #4f46e5; color: #fff; }
html.dark .jaja-sel-btn { background: #0f172a; border-color: #334155; color: #e2e8f0; }
html.dark .jaja-sel-menu { background: #1e293b; border-color: #334155; }
html.dark .jaja-sel-item { color: #e2e8f0; }
html.dark .jaja-sel-item:hover { background: #312e81; }
select.jaja-native-hide {
  position: absolute !important;
  opacity: 0 !important;
  pointer-events: none !important;
  height: 0 !important;
  width: 0 !important;
}

input[type="date"], input[type="month"] {
  padding-right: 2rem !important;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2364748b' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .65rem center;
  background-size: 16px;
}
html.dark input[type="date"], html.dark input[type="month"] {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' fill='none' stroke='%2394a3b8' stroke-width='1.8' viewBox='0 0 24 24'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M3 10h18M8 3v4M16 3v4'/%3E%3C/svg%3E");
}

.jaja-sel-menu { overscroll-behavior: contain; }

header .hdr-ctl.hidden { display: none !important; }
header .hdr-ctl,
header .jaja-sel-btn {
  height: 32px;
  min-height: 32px;
  padding: 0 10px;
  border-radius: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  line-height: 1;
  box-sizing: border-box;
}
header .hdr-lang { height: 32px; }
header .hdr-lang .jaja-sel,
header .jaja-sel {
  width: auto;
  min-width: 2.75rem;
  flex: 0 0 auto;
}
header .hdr-lang .jaja-sel-btn,
header .jaja-sel-btn {
  width: auto;
  min-width: 2.75rem;
  padding-left: 8px;
  padding-right: 22px;
}
header .jaja-sel-btn { width: 100%; }

#buyersList .buyer-name-in,
#buyersList .buyer-pass-in,
#buyersList .buyer-save-btn,
#buyersList .jaja-sel-btn {
  height: 32px;
  box-sizing: border-box;
}
#buyersList .buyer-name-in {
  width: 9.5rem;
  min-width: 9.5rem;
}
#buyersList .jaja-sel {
  width: 9.5rem;
  min-width: 9.5rem;
  flex: 0 0 9.5rem;
}
#buyersList .jaja-sel-btn {
  width: 100%;
  padding: 0 1.6rem 0 0.6rem;
  font-size: 12px;
}
#buyersList li > div { align-items: center; }

#sectionFilters .jaja-sel {
  width: 9rem;
  min-width: 9rem;
  flex: 0 0 9rem;
}
#sectionFilters input[type="date"] {
  width: 9.5rem;
  flex: 0 0 9.5rem;
}

#entryForm input,
#entryForm .jaja-sel-btn,
#entryForm button[type="submit"],
#sectionConverter input,
#sectionConverter .jaja-sel-btn,
#sectionConverter button {
  height: 32px !important;
  min-height: 32px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  font-size: 12px;
  border-radius: 0.5rem !important;
}
#entryForm label + div .rounded-xl,
#entryForm .peer + div {
  height: 32px;
  padding-top: 0;
  padding-bottom: 0;
  border-radius: 0.5rem;
  font-size: 12px;
}
#entryForm .grid { align-items: end; }

#buyersModal .flex.flex-wrap {
  flex-wrap: nowrap;
  align-items: center;
}
#buyersModal .flex.flex-wrap .jaja-sel {
  width: 5.75rem;
  min-width: 5.75rem;
  flex: 0 0 5.75rem;
}
#buyersModal .flex.flex-wrap .jaja-sel-btn {
  width: 100%;
  overflow: hidden;
}

#buyersModal .flex.flex-wrap input,
#buyersModal .flex.flex-wrap button,
#buyersModal .flex.flex-wrap .jaja-sel-btn {
  height: 32px !important;
  min-height: 32px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
}
#buyersModal .flex.flex-wrap > button {
  width: 32px;
  min-width: 32px;
  padding-left: 0;
  padding-right: 0;
}
#sectionFilters button {
  height: 32px !important;
  min-height: 32px !important;
  padding-top: 0 !important;
  padding-bottom: 0 !important;
  font-size: 12px;
}
#sectionFilters input[type="date"],
#sectionFilters .jaja-sel-btn {
  height: 32px !important;
}

.jaja-sel.jaja-lang {
  width: max-content !important;
  min-width: 0 !important;
  max-width: none !important;
  flex: 0 0 auto !important;
}
.jaja-sel.jaja-lang .jaja-sel-btn {
  width: max-content;
  height: 32px;
  padding: 0 1.35rem 0 0.5rem !important;
  font-size: 12px;
  gap: 4px;
  white-space: nowrap;
}
.jaja-sel.jaja-lang .jaja-sel-btn:after {
  right: 0.4rem;
}
#loginScreen .jaja-sel:has(#loginUser),
#loginScreen .jaja-sel:has(#loginUser) .jaja-sel-btn,
#loginPass {
  height: 40px !important;
  min-height: 40px !important;
}
#loginScreen .jaja-sel:has(#loginUser) {
  width: 100%;
}
#loginScreen .jaja-sel.jaja-lang,
#loginScreen .jaja-sel.jaja-lang .jaja-sel-btn {
  height: 32px !important;
  min-height: 32px !important;
}

#entryForm .jaja-sel { height: 32px; }
#entryForm .peer + div {
  height: 32px !important;
  min-height: 32px !important;
  border-width: 1px !important;
}
#sectionConverter .jaja-sel {
  width: 11rem;
  min-width: 11rem;
  flex: 0 0 11rem;
}
#sectionConverter .jaja-sel-btn {
  font-size: 12px;
}
#sectionConverter .h-8 { height: 32px !important; }

#sectionAddEntry #entryForm input,
#sectionAddEntry #entryForm .jaja-sel-btn,
#sectionAddEntry #entryForm button[type="submit"] {
  height: 30px !important;
  min-height: 30px !important;
  font-size: 12px !important;
  border-radius: 0.5rem !important;
  box-shadow: none !important;
}
#sectionAddEntry #entryForm button[type="submit"] {
  font-weight: 500;
  padding-left: 10px !important;
  padding-right: 10px !important;
}
#sectionAddEntry .peer + div {
  height: 30px !important;
  min-height: 30px !important;
  border-width: 1px !important;
  font-size: 12px !important;
  border-radius: 0.5rem !important;
}
#sectionConverter input,
#sectionConverter .jaja-sel-btn,
#sectionConverter button,
#sectionConverter .h-8 {
  height: 30px !important;
  min-height: 30px !important;
  font-size: 12px !important;
}

.order-tab {
  height: 30px;
  min-width: 4.5rem;
  padding: 0 10px;
  border-radius: 0.5rem;
  border: 1px solid #cbd5e1;
  background: transparent;
  color: #475569;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}
html.dark .order-tab { border-color: #475569; color: #cbd5e1; }
#orderPlatformRow label:has(input[value="FB"]:checked) .order-tab {
  border-color: #3b82f6; color: #1d4ed8; background: transparent;
}
#orderPlatformRow label:has(input[value="TT"]:checked) .order-tab {
  border-color: #ec4899; color: #be185d; background: transparent;
}
#tabOrderLanding.is-on {
  border-color: #10b981 !important;
  background: transparent !important;
  color: #047857 !important;
}
html.dark #orderPlatformRow label:has(input[value="FB"]:checked) .order-tab { color: #93c5fd; }
html.dark #orderPlatformRow label:has(input[value="TT"]:checked) .order-tab { color: #f9a8d4; }
html.dark #tabOrderLanding.is-on { color: #6ee7b7 !important; }

#sectionOrderAccount input[type="text"],
#sectionOrderAccount input[type="url"],
#sectionOrderAccount input[type="number"],
#sectionOrderAccount .jaja-sel-btn,
#sectionOrderAccount select,
#sectionOrderAccount button.order-tab,
#sectionOrderAccount #tabOrderLanding {
  height: 30px !important;
  min-height: 30px !important;
  box-sizing: border-box;
}
#sectionOrderAccount textarea { min-height: 60px; }

.land-form-airy label {
  font-size: 11px !important;
  font-weight: 500 !important;
  color: #94a3b8 !important;
  letter-spacing: .01em;
}
.land-form-airy .req-star { font-size: 11px; }
.land-form-airy input[type="text"],
.land-form-airy input[type="url"],
.land-form-airy textarea,
.land-form-airy .jaja-sel-btn,
.land-form-airy .land-url {
  background: rgba(255,255,255,.55) !important;
  border-color: #e2e8f0 !important;
  box-shadow: none !important;
}
html.dark .land-form-airy input[type="text"],
html.dark .land-form-airy input[type="url"],
html.dark .land-form-airy textarea,
html.dark .land-form-airy .jaja-sel-btn,
html.dark .land-form-airy .land-url {
  background: rgba(15,23,42,.35) !important;
  border-color: #334155 !important;
}
.land-form-airy .land-drop {
  border-style: dashed;
  border-color: #cbd5e1;
  background: transparent;
  padding: .4rem .55rem;
}
html.dark .land-form-airy .land-drop { border-color: #475569; }
.land-form-airy #landPreviewBtn,
.land-form-airy button[onclick="previewLandingOrder()"] {
  background: transparent !important;
  box-shadow: none !important;
  color: #64748b !important;
}
.land-form-airy #btnLandSubmit {
  box-shadow: none !important;
  font-weight: 500;
}
.land-form-airy #landFullForm > div + div {
  padding-top: .35rem;
}

.jaja-sel.is-locked{opacity:.55;pointer-events:none}
.jaja-sel.is-locked .jaja-sel-btn{cursor:not-allowed}

@media (prefers-reduced-motion: no-preference) {
  button, .order-tab, .hdr-ctl, .jaja-sel-btn, .jaja-sel-item,
  input, select, textarea, a, .glass, .land-drop, .modal-panel {
    transition: background-color .18s ease, color .18s ease, border-color .18s ease,
                box-shadow .18s ease, transform .18s ease, opacity .18s ease;
  }
  button:hover, .hdr-ctl:hover, .order-tab:hover { transform: translateY(-1px); }
  button:active, .hdr-ctl:active, .order-tab:active { transform: translateY(0) scale(.98); }
  .jaja-sel-menu { animation: jajaPop .14s ease; }
  .jaja-cal { animation: jajaPop .14s ease; }
  .modal-panel, .fade-in { animation: jajaIn .2s ease; }
  #toast:not(.hidden) { animation: jajaToast .22s ease; }
  #loadingOverlay:not(.hidden) { animation: jajaFade .15s ease; }
}
@keyframes jajaPop {
  from { opacity: 0; transform: translateY(-6px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes jajaIn {
  from { opacity: 0; transform: translateY(8px) scale(.98); }
  to { opacity: 1; transform: none; }
}
@keyframes jajaToast {
  from { opacity: 0; transform: translateY(-8px); }
  to { opacity: 1; transform: none; }
}
@keyframes jajaFade { from { opacity: 0; } to { opacity: 1; } }

.order-acc-lbl {
  display: block;
  font-size: 11px;
  font-weight: 500;
  color: #94a3b8;
  margin-bottom: 4px;
}
.order-acc-ctl {
  width: 100%;
  height: 32px;
  padding: 0 10px;
  border-radius: 0.5rem;
  border: 1px solid #e2e8f0;
  background: rgba(255,255,255,.7);
  font-size: 13px;
  outline: none;
}
html.dark .order-acc-ctl {
  background: rgba(15,23,42,.4);
  border-color: #334155;
  color: #e2e8f0;
}
.order-acc-ctl:focus { border-color: #8b5cf6; box-shadow: 0 0 0 2px rgba(139,92,246,.15); }
.order-acc-hint { font-size: 11px; color: #94a3b8; margin-top: 3px; }
#btnOrderSubmit {
  height: 32px !important;
  padding: 0 14px !important;
  border-radius: 0.5rem !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  box-shadow: none !important;
}
.order-acc-form .jaja-sel { width: 100% !important; min-width: 0 !important; flex: 1 1 auto !important; }
.order-acc-form .jaja-sel-btn { height: 32px; }

html.theme-switching, html.theme-switching * {
  transition: none !important;
  animation: none !important;
}

.footer-metrics {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  width: 100%;
}
.footer-metric {
  text-align: center;
  min-width: 0;
  padding: 2px 4px;
}
.footer-metric > div:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 700px) {
  .footer-metrics { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}


.footer-chip {
  border-radius: 12px;
  padding: 6px 8px;
  border: 1px solid transparent;
}
.footer-chip > div:first-child { letter-spacing: .04em; text-transform: uppercase; }
.footer-chip-tt { background: #fff1f2; border-color: #fecdd3; color: #e11d48; }
.footer-chip-tt #totalTT { color: #e11d48; }
.footer-chip-fb { background: #eff6ff; border-color: #bfdbfe; color: #2563eb; }
.footer-chip-fb #totalFB { color: #1d4ed8; }
.footer-chip-all { background: #eef2ff; border-color: #c7d2fe; color: #4f46e5; }
.footer-chip-all #totalAll { color: #4338ca; }
.footer-chip-ecards { background: #ecfeff; border-color: #a5f3fc; color: #0e7490; }
.footer-chip-ecards #totalEcards { color: #0e7490; }
.footer-chip-spend { background: #fff7ed; border-color: #fed7aa; color: #c2410c; }
.footer-chip-spend #totalSpend { color: #c2410c; }
.footer-chip-recv { background: #ecfdf5; border-color: #a7f3d0; color: #047857; }
.footer-chip-recv #totalReceived { color: #047857; }
.footer-chip-profit { background: #f1f5f9; border-color: #cbd5e1; color: #475569; }
.footer-chip-profit.is-plus { background: #ecfdf5; border-color: #6ee7b7; color: #047857; }
.footer-chip-profit.is-minus { background: #fff1f2; border-color: #fecdd3; color: #e11d48; }

html.dark .footer-chip-tt { background: rgba(244,63,94,.14); border-color: rgba(251,113,133,.35); color: #fda4af; }
html.dark .footer-chip-tt #totalTT { color: #fda4af; }
html.dark .footer-chip-fb { background: rgba(37,99,235,.16); border-color: rgba(96,165,250,.35); color: #93c5fd; }
html.dark .footer-chip-fb #totalFB { color: #93c5fd; }
html.dark .footer-chip-all { background: rgba(79,70,229,.18); border-color: rgba(165,180,252,.35); color: #c7d2fe; }
html.dark .footer-chip-all #totalAll { color: #c7d2fe; }
html.dark .footer-chip-ecards { background: rgba(6,182,212,.14); border-color: rgba(34,211,238,.32); color: #67e8f9; }
html.dark .footer-chip-ecards #totalEcards { color: #67e8f9; }
html.dark .footer-chip-spend { background: rgba(234,88,12,.14); border-color: rgba(251,146,60,.35); color: #fdba74; }
html.dark .footer-chip-spend #totalSpend { color: #fdba74; }
html.dark .footer-chip-recv { background: rgba(16,185,129,.14); border-color: rgba(52,211,153,.35); color: #6ee7b7; }
html.dark .footer-chip-recv #totalReceived { color: #6ee7b7; }
html.dark .footer-chip-profit { background: rgba(99,102,241,.12); border-color: rgba(165,180,252,.28); color: #e2e8f0; }
html.dark .footer-chip-profit #totalProfit { color: #e2e8f0; }
html.dark .footer-chip-profit.is-plus { background: rgba(16,185,129,.18); border-color: rgba(52,211,153,.4); color: #6ee7b7; }
html.dark .footer-chip-profit.is-plus #totalProfit { color: #6ee7b7 !important; }
html.dark .footer-chip-profit.is-minus { background: rgba(244,63,94,.16); border-color: rgba(251,113,133,.4); color: #fda4af; }
html.dark .footer-chip-profit.is-minus #totalProfit { color: #fda4af !important; }

.fee-edit { border-color: #c7d2fe !important; background: #eef2ff; }
html.dark .fee-edit { border-color: rgba(165,180,252,.35) !important; background: rgba(79,70,229,.18); }
.fee-ok { background: #4f46e5 !important; }
.fee-ok:hover { background: #4338ca !important; }

#reportMonth {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  margin: 0 !important;
  border: 0 !important;
  background: none !important;
  opacity: 0 !important;
  font-size: 1px !important;
}

#filterStart, #filterEnd {
  position: absolute !important;
  inset: 0 !important;
  width: 100% !important;
  height: 100% !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
  background: none !important;
  opacity: 0 !important;
  border: 0 !important;
}
.jaja-date-wrap { min-width: 7.6rem; }


/* ===== Phone / small tablet ===== */
@media (max-width: 768px) {
  html, body { overflow-x: hidden; }
  body { padding-bottom: calc(18rem + env(safe-area-inset-bottom, 0px)); }

  header {
    padding-top: env(safe-area-inset-top, 0px);
  }
  header .hdr-inner { padding-top: 8px; padding-bottom: 8px; }
  header h1 { font-size: 1.05rem; line-height: 1.2; }
  header .hdr-inner > div:first-child p { display: none; }
  header img.w-11 { width: 2.25rem; height: 2.25rem; }

  .hdr-actions { width: 100%; justify-content: flex-start; gap: 6px; }
  header .hdr-ctl,
  header .jaja-sel-btn {
    min-height: 36px;
    padding: 0 10px;
    font-size: 13px;
  }

  main { padding: 12px 12px 16px; }
  .glass, section.glass { padding-left: 14px; padding-right: 14px; }

  .filters-row { align-items: flex-start; }
  .filters-controls { width: 100%; }
  .filters-controls .jaja-date-wrap,
  .filters-controls select,
  .filters-controls button {
    flex: 1 1 calc(50% - 6px);
    min-width: 0;
  }
  .filters-controls > span { display: none; }
  .jaja-date-wrap { min-width: 0; width: auto; }

  input, select, textarea, button, .jaja-sel-btn {
    font-size: 16px !important; /* no iOS zoom */
  }
  input[type="date"], input[type="month"] { font-size: 16px !important; }

  table { font-size: 12px; }
  th, td { padding-left: 8px !important; padding-right: 8px !important; }
  .overflow-x-auto { -webkit-overflow-scrolling: touch; }

  .fixed.inset-0 { padding: env(safe-area-inset-top, 8px) 8px 8px; }
  .fixed.inset-0 > .absolute.inset-0.flex { padding: 8px; align-items: stretch; }
  #monthModal .bg-white,
  #offerFeesModal .bg-white,
  #buyersModal .bg-white,
  #ecardsModal .bg-white,
  [id$="Modal"] .bg-white.rounded-2xl,
  [id$="Modal"] .modal-panel {
    max-width: 100% !important;
    width: 100% !important;
    max-height: calc(100dvh - 16px) !important;
    border-radius: 16px !important;
    margin: 0;
  }

  .bottom-bar {
    padding-bottom: env(safe-area-inset-bottom, 8px);
  }
  #sectionHistory { margin-bottom: 8px; }
  #historyMoreWrap, #emptyState { padding-bottom: 12px; }

  .footer-metrics {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
  }
  .footer-chip { padding: 8px 6px; }
  .footer-chip > div:last-child { font-size: 0.95rem; }

  .jaja-cal {
    left: 8px !important;
    right: 8px !important;
    width: auto !important;
    max-width: none;
  }
}

@media (max-width: 420px) {
  .footer-metrics { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  header h1 { font-size: 1rem; }
  #loginCard, #loginPanel { margin: 12px; }
}

@media (max-width: 768px) {
  #offerFeesModal .bg-white,
  #buyersModal .modal-panel {
    overflow: hidden;
  }
  .offer-fee-row {
    flex-wrap: wrap;
  }
  .offer-fee-row .offer-fee-name {
    flex: 1 1 100%;
    min-width: 0;
  }
  .offer-fee-row .offer-fee-pct { width: 4rem; }
  #buyersModal .flex.flex-wrap > input,
  #buyersModal .flex.flex-wrap > select {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    width: auto;
  }
  #buyersModal .flex.flex-wrap > button {
    flex: 0 0 auto;
  }
  .buyer-row {
    flex-wrap: wrap;
  }
  .buyer-row .buyer-name-in {
    flex: 1 1 100%;
    width: 100%;
  }
  .buyer-row .buyer-ecards,
  .buyer-row .jaja-sel {
    flex: 1 1 calc(50% - 8px);
    min-width: 0;
    width: auto !important;
  }
  .buyer-row .buyer-pass-in {
    flex: 1 1 calc(50% - 36px);
    min-width: 0;
  }
  .buyer-row .w-6,
  .buyer-row button {
    flex: 0 0 auto;
  }
}



/* DOOM arcade cabinet */
.doom-overlay {
  position: fixed; inset: 0; z-index: 80;
  display: flex; align-items: flex-end; justify-content: center;
  padding: 12px 12px 0;
}
.doom-overlay.hidden { display: none; }
.doom-backdrop {
  position: absolute; inset: 0;
  background: rgba(8,10,18,.55);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}
.doom-machine { position: relative; z-index: 1; width: min(560px, 100%); }
.doom-cab {
  background:
    linear-gradient(#0000, #0000) padding-box,
    repeating-linear-gradient(90deg, #3b2418 0 6px, #2a1810 6px 12px);
  background-color: #2a1810;
  border-radius: 18px 18px 6px 6px;
  border: 5px solid #1a0e0a;
  box-shadow:
    0 0 0 3px #6b4a32,
    8px 0 0 #1a100c,
    -8px 0 0 #1a100c,
    0 28px 50px rgba(0,0,0,.55),
    inset 0 2px 0 rgba(255,200,120,.12);
  overflow: hidden;
}
.doom-marquee {
  position: relative;
  padding: 10px 12px 8px;
  background: radial-gradient(ellipse at 50% 0%, #b91c1c, #450a0a 70%);
  box-shadow: inset 0 -8px 16px rgba(0,0,0,.35);
}
.doom-marquee-glass {
  text-align: center;
  padding: 6px 8px 8px;
  border-radius: 6px;
  background: linear-gradient(180deg, rgba(255,255,255,.08), transparent);
}
.doom-marquee-title {
  display: block;
  font-family: Impact, "Arial Black", sans-serif;
  letter-spacing: .28em;
  color: #fde68a;
  text-shadow: 0 0 16px #f59e0b, 0 2px 0 #7f1d1d;
  font-size: 1.8rem;
}
.doom-marquee-sub {
  display: block;
  font-family: ui-monospace, monospace;
  font-size: 10px;
  color: #fecaca;
  letter-spacing: .22em;
  margin-bottom: 2px;
}
.doom-x {
  position: absolute; top: 8px; right: 8px;
  width: 28px; height: 28px; border-radius: 999px;
  background: rgba(0,0,0,.35); color: #fee2e2; border: 1px solid rgba(255,255,255,.2);
}
.doom-speaker {
  display: flex; justify-content: center; gap: 8px;
  padding: 6px 24px;
  background: #1a100c;
}
.doom-speaker i {
  width: 18%; height: 7px; border-radius: 99px;
  background: #0a0706;
  box-shadow: inset 0 1px 2px #000, 0 1px 0 #3a281c;
}
.doom-bezel {
  margin: 0 28px;
  padding: 8px;
  background: #0c0c0c;
  border-radius: 6px;
  box-shadow: 0 0 0 3px #3f2a22, inset 0 0 0 2px #111;
}
.doom-screen {
  position: relative;
  height: min(46vh, 380px);
  background: #000;
  overflow: hidden;
}
.doom-player { position: absolute; inset: 0; background: #000; }
.doom-player .emulator, .doom-player canvas { width: 100% !important; height: 100% !important; }
.doom-err { color: #f59e0b; font-family: monospace; padding: 2rem; text-align: center; }
.doom-scan, .doom-vignette { pointer-events: none; position: absolute; inset: 0; }
.doom-scan {
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.035) 0 1px, transparent 1px 3px);
}
.doom-vignette { box-shadow: inset 0 0 55px 14px rgba(0,0,0,.55); }
.doom-splash {
  position: absolute; inset: 0; z-index: 2;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px;
  background: radial-gradient(circle at 50% 40%, #4a1c12, #120806 72%);
}
.doom-splash.is-off { display: none; }
.doom-splash-logo {
  font-family: Impact, "Arial Black", sans-serif;
  font-size: clamp(2.4rem, 10vw, 4.2rem);
  letter-spacing: .14em; color: #ef4444;
  text-shadow: 4px 4px 0 #7f1d1d, 0 0 24px #dc2626;
}
.doom-splash-sub { font-family: ui-monospace, monospace; font-size: 11px; color: #fbbf24; }
.doom-play {
  margin-top: 6px; padding: 8px 18px;
  border: 2px solid #f59e0b; background: transparent; color: #fde68a;
  letter-spacing: .18em; font-family: ui-monospace, monospace; font-size: 12px;
  animation: doomBlink 1.2s step-end infinite;
}
.doom-play:hover { background: #f59e0b; color: #111; animation: none; }
@keyframes doomBlink { 50% { opacity: .35; } }
.doom-panel {
  display: flex; flex-wrap: wrap; justify-content: center; align-items: flex-end;
  gap: 10px 12px;
  padding: 12px 10px 16px;
  background:
    linear-gradient(180deg, #3a281e, #1a120e);
  border-top: 3px solid #5a3c2a;
}
.doom-stick, .doom-btns, .doom-coin { text-align: center; min-width: 48px; }
.doom-key, .doom-key-row span, .doom-btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 22px; padding: 0 6px;
  border-radius: 4px; background: #1e1e1e; color: #e5e5e5;
  font-size: 10px; border: 1px solid #444; box-shadow: 0 2px 0 #000;
}
.doom-key-row { display: flex; gap: 3px; justify-content: center; margin-top: 3px; }
.doom-btn.red { background: #7f1d1d; border-color: #b91c1c; }
.doom-btn.blue { background: #1e3a5f; border-color: #3b82f6; }
.doom-slot {
  width: 42px; height: 10px; margin: 6px auto 0;
  border-radius: 2px;
  background: #0a0a0a;
  box-shadow: inset 0 2px 3px #000, 0 0 0 2px #6b4a32;
}
.doom-lab { margin-top: 4px; font-size: 9px; color: #d6b07a; }
@media (max-width: 640px) {
  .doom-overlay { padding: 6px 6px 0; }
  .doom-bezel { margin: 0 12px; }
  .doom-screen { height: min(42vh, 320px); }
}

body.doom-open { overflow: hidden; }
.doom-overlay { isolation: isolate; }
