@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Sans:ital,wght@0,400;0,500;0,600;0,700;1,400&family=Sora:wght@500;600;700;800&display=swap');

/* Axindo ATP — industrial field-ops theme */
:root {
  --ainet-blue: #0088FF;
  --ainet-blue-dark: #0066CC;
  --ainet-red: #E0002A;
  --ainet-navy: #07111f;
  --ainet-surface: #0f1a2e;
  --success: #1fa971;
  --danger: #d64545;
  --page-bg: #07111f;
  --page-fg: #e8eef7;
  --surface: #0f1a2e;
  --surface-2: #162338;
  --border: rgba(148, 163, 184, 0.16);
  --muted: #8b9bb4;
  --font-display: "Sora", "Segoe UI", sans-serif;
  --font-body: "IBM Plex Sans", "Segoe UI", sans-serif;
  --radius: 12px;
  --radius-sm: 8px;
  --shadow-soft: 0 1px 0 rgba(255, 255, 255, 0.04) inset, 0 12px 32px rgba(0, 0, 0, 0.28);
}

html, body {
  overflow-x: hidden;
  max-width: 100vw;
}

body {
  font-family: var(--font-body);
  -webkit-tap-highlight-color: transparent;
  transition: background-color 0.25s ease, color 0.25s ease;
  letter-spacing: 0.01em;
}

h1, h2, h3, h4, .font-display {
  font-family: var(--font-display);
  letter-spacing: -0.02em;
}

main {
  min-width: 0;
}

html.dark body {
  background-color: var(--page-bg);
  color: var(--page-fg);
  background-image:
    radial-gradient(ellipse 80% 50% at 10% -10%, rgba(0, 136, 255, 0.14), transparent 55%),
    radial-gradient(ellipse 60% 40% at 100% 0%, rgba(224, 0, 42, 0.08), transparent 50%),
    linear-gradient(rgba(148, 163, 184, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.035) 1px, transparent 1px);
  background-size: auto, auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
}

/* ========== LIGHT MODE ========== */
html:not(.dark) {
  --page-bg: #e9eef5;
  --page-fg: #0f172a;
  --surface: #ffffff;
  --surface-2: #f4f7fb;
  --border: #d5deea;
  --muted: #64748b;
}

html:not(.dark) body,
html:not(.dark) body.bg-\[\#0b132b\] {
  background-color: var(--page-bg) !important;
  color: var(--page-fg) !important;
  background-image:
    radial-gradient(ellipse 70% 45% at 0% 0%, rgba(0, 136, 255, 0.1), transparent 55%),
    linear-gradient(rgba(15, 23, 42, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.03) 1px, transparent 1px);
  background-size: auto, 48px 48px, 48px 48px;
  background-attachment: fixed;
}

html:not(.dark) .bg-slate-900,
html:not(.dark) .bg-slate-850,
html:not(.dark) .bg-slate-950,
html:not(.dark) .bg-slate-800,
html:not(.dark) .bg-\[\#0b132b\],
html:not(.dark) .bg-\[\#0b132b\]\/95,
html:not(.dark) .bg-\[\#0b132b\]\/90 {
  background-color: #ffffff !important;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
}

html:not(.dark) .bg-slate-900\/90,
html:not(.dark) .bg-slate-900\/80,
html:not(.dark) .bg-slate-900\/60,
html:not(.dark) .bg-slate-900\/50,
html:not(.dark) .bg-slate-900\/40,
html:not(.dark) .bg-slate-950\/80,
html:not(.dark) .bg-slate-850\/60,
html:not(.dark) .bg-slate-800\/60,
html:not(.dark) .bg-slate-800\/50 {
  background-color: #f4f7fb !important;
}

html:not(.dark) .bg-black\/40,
html:not(.dark) .bg-black\/50 {
  background-color: rgba(15, 23, 42, 0.06) !important;
}

html:not(.dark) .border-slate-800,
html:not(.dark) .border-slate-750,
html:not(.dark) .border-slate-700,
html:not(.dark) .border-slate-800\/80,
html:not(.dark) .border-slate-800\/60 {
  border-color: #d5deea !important;
}

html:not(.dark) .divide-slate-800 > :not([hidden]) ~ :not([hidden]),
html:not(.dark) .divide-slate-750 > :not([hidden]) ~ :not([hidden]),
html:not(.dark) .divide-slate-750\/70 > :not([hidden]) ~ :not([hidden]) {
  border-color: #e2e8f0 !important;
}

html:not(.dark) .text-white { color: #0f172a !important; }
html:not(.dark) .text-slate-100,
html:not(.dark) .text-slate-200 { color: #1e293b !important; }
html:not(.dark) .text-slate-300 { color: #475569 !important; }
html:not(.dark) .text-slate-400,
html:not(.dark) .text-slate-500 { color: #64748b !important; }
html:not(.dark) .text-sky-200,
html:not(.dark) .text-sky-300,
html:not(.dark) .text-sky-400 { color: #0369a1 !important; }
html:not(.dark) .text-emerald-300,
html:not(.dark) .text-emerald-400 { color: #047857 !important; }
html:not(.dark) .text-amber-300,
html:not(.dark) .text-amber-400 { color: #b45309 !important; }
html:not(.dark) .text-rose-300,
html:not(.dark) .text-rose-400 { color: #be123c !important; }
html:not(.dark) .text-purple-200,
html:not(.dark) .text-purple-300,
html:not(.dark) .text-purple-400 { color: #475569 !important; }
html:not(.dark) .text-blue-300 { color: #1d4ed8 !important; }

html:not(.dark) .brand-strip,
html:not(.dark) .brand-strip *,
html:not(.dark) .keep-on-color,
html:not(.dark) .keep-on-color *,
html:not(.dark) button.text-white,
html:not(.dark) a.text-white,
html:not(.dark) .bg-\[\#0088FF\],
html:not(.dark) .bg-\[\#0088FF\].text-white,
html:not(.dark) .bg-\[\#0088FF\] .text-white,
html:not(.dark) a.bg-\[\#0088FF\],
html:not(.dark) button.bg-\[\#0088FF\],
html:not(.dark) [class*="from-[#0088FF]"].text-white,
html:not(.dark) [class*="from-[#0088FF]"] .text-white,
html:not(.dark) [class*="from-blue-"].text-white,
html:not(.dark) [class*="bg-blue-"].text-white,
html:not(.dark) [class*="bg-sky-"].text-white,
html:not(.dark) [class*="bg-emerald-"].text-white,
html:not(.dark) [class*="bg-rose-"].text-white,
html:not(.dark) [class*="bg-purple-"].text-white,
html:not(.dark) [class*="bg-indigo-"].text-white,
html:not(.dark) [class*="from-rose-"].text-white,
html:not(.dark) [class*="from-red-"].text-white,
html:not(.dark) [class*="from-emerald-"].text-white,
html:not(.dark) [class*="to-[#E0002A]"].text-white,
html:not(.dark) .ax-btn-primary,
html:not(.dark) .ax-btn-primary * {
  color: #ffffff !important;
}

html:not(.dark) .bg-sky-950\/50,
html:not(.dark) .bg-sky-950\/40,
html:not(.dark) .bg-emerald-950\/40,
html:not(.dark) .bg-amber-950\/60,
html:not(.dark) .bg-amber-950\/80,
html:not(.dark) .bg-rose-950\/60,
html:not(.dark) .bg-rose-950\/80,
html:not(.dark) .bg-blue-950\/80,
html:not(.dark) .bg-purple-950\/40 {
  background-color: #f4f7fb !important;
}

html:not(.dark) .bg-blue-500\/10,
html:not(.dark) .bg-blue-500\/20,
html:not(.dark) .bg-emerald-500\/10,
html:not(.dark) .bg-amber-500\/10,
html:not(.dark) .bg-\[\#E0002A\]\/10,
html:not(.dark) .bg-\[\#0088FF\]\/15 {
  background-color: rgba(0, 136, 255, 0.08) !important;
}

html:not(.dark) input[type="text"],
html:not(.dark) input[type="number"],
html:not(.dark) input[type="date"],
html:not(.dark) input[type="password"],
html:not(.dark) select,
html:not(.dark) textarea {
  background-color: #ffffff !important;
  color: #0f172a !important;
  border-color: #c5d0de !important;
}

html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
  color: #94a3b8 !important;
}

html:not(.dark) header,
html:not(.dark) nav.mobile-bottom-nav,
html:not(.dark) footer {
  background-color: rgba(255, 255, 255, 0.92) !important;
  border-color: #d5deea !important;
}

html:not(.dark) header nav {
  background-color: #eef3f9 !important;
}

html:not(.dark) .mobile-more-sheet-panel {
  background-color: #ffffff !important;
  border-color: #d5deea !important;
}

.brand-strip {
  color: #ffffff !important;
  background: #0a1628 !important;
  border-bottom: 1px solid rgba(0, 136, 255, 0.35);
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.08em;
}
.brand-strip * {
  color: inherit !important;
}
.brand-strip::before {
  content: "";
  display: inline-block;
  width: 2.5rem;
  height: 2px;
  margin-right: 0.65rem;
  background: linear-gradient(90deg, var(--ainet-blue), var(--ainet-red));
  vertical-align: middle;
}

html:not(.dark) .theme-hero {
  background: linear-gradient(160deg, #f7fafc 0%, #e8f2fc 55%, #f8fafc 100%) !important;
  border-color: #b6d4f5 !important;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06) !important;
}
html:not(.dark) .theme-hero .text-white { color: #0f172a !important; }
html:not(.dark) .theme-hero a.text-white,
html:not(.dark) .theme-hero button.text-white,
html:not(.dark) .theme-hero .keep-on-color,
html:not(.dark) .theme-hero .keep-on-color * { color: #ffffff !important; }
html:not(.dark) .theme-hero .text-sky-200,
html:not(.dark) .theme-hero .text-sky-300 { color: #0369a1 !important; }

/* ---- Shared components ---- */
.ax-hero {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(0, 136, 255, 0.28);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(0, 136, 255, 0.08), transparent 42%),
    linear-gradient(180deg, #101c32 0%, #0b1528 100%);
  box-shadow: var(--shadow-soft);
}
.ax-hero::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ainet-blue) 0%, var(--ainet-blue) 62%, var(--ainet-red) 62%);
}
html:not(.dark) .ax-hero {
  background:
    linear-gradient(135deg, rgba(0, 136, 255, 0.06), transparent 45%),
    #ffffff;
}

.ax-panel {
  background: rgba(15, 26, 46, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}
html:not(.dark) .ax-panel {
  background: #ffffff;
}

.ax-stat {
  background: rgba(15, 26, 46, 0.88);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem 1.1rem;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.ax-stat:hover {
  border-color: rgba(0, 136, 255, 0.4);
  transform: translateY(-1px);
}
.ax-stat-link {
  display: block;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
}
.ax-stat-link:hover {
  border-color: rgba(0, 136, 255, 0.55);
}
.ax-stat-active {
  box-shadow: 0 0 0 1px rgba(0, 136, 255, 0.55), 0 10px 24px rgba(0, 0, 0, 0.25);
  border-color: rgba(0, 136, 255, 0.65);
}
html:not(.dark) .ax-stat {
  background: #ffffff;
}

.ax-stat-label {
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
}

.ax-stat-value {
  font-family: var(--font-display);
  font-size: 1.85rem;
  font-weight: 700;
  line-height: 1.1;
  margin-top: 0.35rem;
}

.ax-btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: var(--ainet-blue);
  color: #fff !important;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.8rem;
  border-radius: var(--radius-sm);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 0.8rem 1.25rem;
  transition: background 0.2s ease, transform 0.15s ease;
}
.ax-btn-primary:hover {
  background: var(--ainet-blue-dark);
  transform: translateY(-1px);
}

.ax-btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  background: transparent;
  color: inherit;
  font-weight: 600;
  font-size: 0.75rem;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  padding: 0.7rem 1rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}
.ax-btn-ghost:hover {
  border-color: rgba(0, 136, 255, 0.45);
  background: rgba(0, 136, 255, 0.08);
}

.ax-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  border: 1px solid transparent;
}
.ax-badge-ok {
  background: rgba(31, 169, 113, 0.12);
  color: #34d399;
  border-color: rgba(31, 169, 113, 0.28);
}
.ax-badge-wait {
  background: rgba(245, 158, 11, 0.12);
  color: #fbbf24;
  border-color: rgba(245, 158, 11, 0.28);
}
.ax-badge-info {
  background: rgba(0, 136, 255, 0.12);
  color: #7dd3fc;
  border-color: rgba(0, 136, 255, 0.28);
}
.ax-badge-warn {
  background: rgba(224, 0, 42, 0.12);
  color: #fb7185;
  border-color: rgba(224, 0, 42, 0.28);
}
.ax-badge-muted {
  background: rgba(148, 163, 184, 0.1);
  color: #94a3b8;
  border-color: rgba(148, 163, 184, 0.2);
}

html:not(.dark) .ax-badge-ok { color: #047857; }
html:not(.dark) .ax-badge-wait { color: #b45309; }
html:not(.dark) .ax-badge-info { color: #0369a1; }
html:not(.dark) .ax-badge-warn { color: #be123c; }

/* Login page */
.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr;
}
@media (min-width: 960px) {
  .login-shell {
    grid-template-columns: 1.15fr 0.85fr;
  }
}
.login-visual {
  position: relative;
  display: none;
  padding: 3rem;
  background:
    linear-gradient(160deg, rgba(7, 17, 31, 0.2), rgba(7, 17, 31, 0.85)),
    linear-gradient(135deg, #0a1a33 0%, #07111f 55%, #120a14 100%);
  overflow: hidden;
}
@media (min-width: 960px) {
  .login-visual { display: flex; flex-direction: column; justify-content: flex-end; }
}
.login-visual::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(0, 136, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(0, 136, 255, 0.08) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(180deg, rgba(0,0,0,0.55), transparent 85%);
}
.login-visual-accent {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ainet-blue) 0 70%, var(--ainet-red) 70%);
}
.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  position: relative;
}
.login-card {
  width: 100%;
  max-width: 420px;
  background: rgba(15, 26, 46, 0.92);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.75rem 1.5rem;
  box-shadow: var(--shadow-soft);
}
html:not(.dark) .login-card {
  background: #ffffff;
}
.login-input {
  width: 100%;
  background: rgba(8, 15, 28, 0.9);
  border: 1px solid var(--border);
  color: inherit;
  border-radius: var(--radius-sm);
  padding: 0.85rem 0.95rem;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: var(--font-body);
}
.login-input:focus {
  outline: none;
  border-color: rgba(0, 136, 255, 0.65);
  box-shadow: 0 0 0 3px rgba(0, 136, 255, 0.15);
}
html:not(.dark) .login-input {
  background: #f4f7fb;
}

.mobile-sticky-submit {
  position: fixed;
  left: 0;
  right: 0;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 64px);
  z-index: 35;
  padding: 0.75rem 1rem;
  background: rgba(7, 17, 31, 0.96);
  border-top: 1px solid var(--border);
  backdrop-filter: blur(10px);
}
html:not(.dark) .mobile-sticky-submit {
  background: rgba(255, 255, 255, 0.97);
  border-top-color: #d5deea;
}
@media (min-width: 1024px) {
  .mobile-sticky-submit { display: none !important; }
}

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: #07111f; }
html:not(.dark) ::-webkit-scrollbar-track { background: #e2e8f0; }
::-webkit-scrollbar-thumb { background: #2a3a55; border-radius: 4px; }
html:not(.dark) ::-webkit-scrollbar-thumb { background: #94a3b8; }
::-webkit-scrollbar-thumb:hover { background: #0088FF; }

button, input, select, textarea { touch-action: manipulation; }

.pb-safe {
  padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 96px);
}
@media (min-width: 768px) {
  .pb-safe { padding-bottom: 2.5rem !important; }
}

.mobile-bottom-nav {
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
.mobile-bottom-nav a,
.mobile-bottom-nav button {
  min-width: 0;
  flex: 1 1 0;
  max-width: 5.5rem;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.signature-canvas {
  touch-action: none;
  background-color: #ffffff;
  border-radius: var(--radius-sm);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.08);
  cursor: crosshair;
}

@keyframes gps-pulse {
  0% { transform: scale(0.95); opacity: 0.7; }
  70% { transform: scale(1); opacity: 1; }
  100% { transform: scale(0.95); opacity: 0.7; }
}
.gps-live-badge { animation: gps-pulse 2s infinite; }

/* Soften common AI-ish utility patterns sitewide */
.rounded-3xl { border-radius: 14px !important; }
.rounded-2xl { border-radius: 12px !important; }
.shadow-2xl { box-shadow: var(--shadow-soft) !important; }

@media print {
  body {
    background: white !important;
    color: black !important;
    background-image: none !important;
  }
  .no-print { display: none !important; }
  .print-only { display: block !important; }
}
