html,
body {
  min-height: 100%;
  margin: 0;
  font-family: "Segoe UI", "Inter", sans-serif;
}

body {
  background:
    radial-gradient(circle at top right, rgba(201, 95, 35, 0.14), transparent 24%),
    radial-gradient(circle at bottom left, rgba(14, 116, 144, 0.09), transparent 22%),
    linear-gradient(180deg, #f6efe4 0%, #f5efe7 42%, #f7f5ef 100%);
  color: #0f172a;
}

.dark body {
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.12), transparent 24%),
    radial-gradient(circle at bottom left, rgba(14, 165, 233, 0.12), transparent 20%),
    #020617;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
}

::selection {
  background: rgba(249, 115, 22, 0.22);
}

.app-shell-light {
  background:
    radial-gradient(circle at top right, rgba(201, 95, 35, 0.12), transparent 24%),
    radial-gradient(circle at bottom left, rgba(15, 118, 110, 0.06), transparent 18%),
    linear-gradient(180deg, #f6efe4 0%, #f7f1e8 48%, #f5f4ee 100%);
}

.app-header {
  border-bottom: 1px solid rgba(148, 163, 184, 0.22);
  background:
    linear-gradient(90deg, rgba(255, 250, 244, 0.96), rgba(245, 237, 226, 0.94)),
    rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(10px);
}

.dark .app-header {
  border-bottom-color: rgba(51, 65, 85, 0.8);
  background: rgba(2, 6, 23, 0.82);
}

.app-version {
  margin-top: 0.1rem;
  color: #8a7765;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.dark .app-version {
  color: #94a3b8;
}

.app-sidebar {
  border: 1px solid rgba(204, 176, 141, 0.38);
  background:
    linear-gradient(180deg, rgba(255, 252, 248, 0.97), rgba(244, 238, 229, 0.96));
  border-radius: 1.75rem;
  padding: 1rem;
  box-shadow:
    0 12px 36px rgba(148, 163, 184, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.65);
}

.dark .app-sidebar {
  border-color: rgba(51, 65, 85, 0.82);
  background: rgba(15, 23, 42, 0.88);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.28);
}

.app-icon-button,
.app-secondary-button,
.app-danger-button,
.app-nav-link {
  transition: all 0.18s ease;
}

.app-icon-button {
  display: inline-flex;
  height: 2.75rem;
  width: 2.75rem;
  align-items: center;
  justify-content: center;
  border-radius: 1rem;
  border: 1px solid rgba(148, 163, 184, 0.24);
  background: rgba(255, 255, 255, 0.8);
  color: #334155;
  box-shadow: 0 6px 18px rgba(148, 163, 184, 0.12);
}

.app-icon-button:hover {
  border-color: rgba(234, 88, 12, 0.28);
  color: #c2410c;
}

.dark .app-icon-button {
  border-color: rgba(51, 65, 85, 0.9);
  background: rgba(15, 23, 42, 0.88);
  color: #e2e8f0;
  box-shadow: none;
}

.app-secondary-button,
.app-danger-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  padding: 0.62rem 0.95rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.app-secondary-button {
  border: 1px solid rgba(170, 146, 120, 0.24);
  background: rgba(255, 251, 245, 0.82);
  color: #334155;
}

.app-secondary-button:hover {
  border-color: rgba(217, 119, 6, 0.34);
  color: #b45309;
  background: rgba(255, 250, 245, 0.92);
}

.dark .app-secondary-button {
  border-color: rgba(51, 65, 85, 0.9);
  background: transparent;
  color: #cbd5e1;
}

.dark .app-secondary-button:hover {
  background: rgba(30, 41, 59, 0.8);
  color: #f8fafc;
}

.app-danger-button {
  border: 1px solid rgba(251, 191, 36, 0.24);
  background: linear-gradient(180deg, #fff3e8, #ffe7d0);
  color: #9a3412;
}

.app-danger-button:hover {
  background: linear-gradient(180deg, #ffedd5, #fed7aa);
}

.dark .app-danger-button {
  border-color: rgba(124, 45, 18, 0.65);
  background: rgba(124, 45, 18, 0.22);
  color: #fed7aa;
}

.app-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  border-radius: 1.15rem;
  padding: 0.72rem 0.85rem;
  font-size: 0.94rem;
  font-weight: 600;
  isolation: isolate;
  overflow: hidden;
}

.app-nav-link-idle {
  color: #475569;
}

.app-nav-link-idle:hover {
  background: rgba(255, 255, 255, 0.74);
  color: #0f172a;
}

.app-nav-link-active {
  background:
    linear-gradient(90deg, rgba(255, 226, 186, 0.98), rgba(255, 248, 239, 0.99));
  color: #7c2d12;
  font-weight: 800;
  box-shadow:
    inset 0 0 0 1px rgba(223, 110, 33, 0.22),
    0 12px 24px rgba(154, 52, 18, 0.10);
}

.app-nav-link-active::before {
  content: "";
  position: absolute;
  left: 0.38rem;
  top: 0.7rem;
  bottom: 0.7rem;
  width: 0.28rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #f97316, #ea580c);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.12);
}

.app-nav-link-active::after {
  display: none;
}

.app-nav-link-compact {
  justify-content: center;
  padding-inline: 0.55rem;
}

.app-nav-link-compact.app-nav-link-active::before {
  left: 0.18rem;
  top: 0.58rem;
  bottom: 0.58rem;
}

.dark .app-nav-link-idle {
  color: #cbd5e1;
}

.dark .app-nav-link-idle:hover {
  background: rgba(30, 41, 59, 0.82);
  color: #f8fafc;
}

.dark .app-nav-link-active {
  background:
    linear-gradient(90deg, rgba(124, 45, 18, 0.46), rgba(30, 41, 59, 0.70));
  color: #fed7aa;
  box-shadow:
    inset 0 0 0 1px rgba(249, 115, 22, 0.32),
    0 14px 28px rgba(0, 0, 0, 0.24);
}

.dark .app-nav-link-active::before {
  background: linear-gradient(180deg, #fdba74, #f97316);
  box-shadow: 0 0 0 4px rgba(249, 115, 22, 0.18);
}

.app-nav-icon {
  display: inline-flex;
  height: 2.25rem;
  width: 2.25rem;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 0.9rem;
  background: linear-gradient(180deg, #f7efe4, #efe2d0);
  color: #7c3f1d;
  box-shadow: inset 0 0 0 1px rgba(124, 63, 29, 0.08);
  transition: background 0.16s ease, color 0.16s ease, transform 0.16s ease;
}

.app-nav-icon svg {
  height: 1.25rem;
  width: 1.25rem;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.9;
}

.dark .app-nav-icon {
  background: rgba(30, 41, 59, 0.95);
  color: #e2e8f0;
}

.app-nav-link:hover .app-nav-icon,
.app-nav-link-active .app-nav-icon {
  transform: translateY(-1px);
}

.app-nav-link-active .app-nav-icon {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.45),
    0 8px 18px rgba(15, 23, 42, 0.16);
}

.dark .app-nav-link-active .app-nav-icon {
  box-shadow:
    inset 0 0 0 1px rgba(255, 255, 255, 0.14),
    0 10px 22px rgba(0, 0, 0, 0.35);
}

.app-nav-icon-home { background: linear-gradient(145deg, #fef3c7, #fed7aa); color: #b45309; }
.app-nav-icon-tasks { background: linear-gradient(145deg, #dbeafe, #bfdbfe); color: #1d4ed8; }
.app-nav-icon-box { background: linear-gradient(145deg, #ecfccb, #bef264); color: #4d7c0f; }
.app-nav-icon-device { background: linear-gradient(145deg, #cffafe, #67e8f9); color: #0e7490; }
.app-nav-icon-location { background: linear-gradient(145deg, #fee2e2, #fecaca); color: #dc2626; }
.app-nav-icon-inventory { background: linear-gradient(145deg, #ede9fe, #ddd6fe); color: #6d28d9; }
.app-nav-icon-transfer { background: linear-gradient(145deg, #ffedd5, #fdba74); color: #c2410c; }
.app-nav-icon-user-transfer { background: linear-gradient(145deg, #fce7f3, #f9a8d4); color: #be185d; }
.app-nav-icon-check { background: linear-gradient(145deg, #dcfce7, #86efac); color: #15803d; }
.app-nav-icon-clipboard { background: linear-gradient(145deg, #e0f2fe, #7dd3fc); color: #0369a1; }
.app-nav-icon-history { background: linear-gradient(145deg, #f1f5f9, #cbd5e1); color: #475569; }
.app-nav-icon-info { background: linear-gradient(145deg, #f5f3ff, #c4b5fd); color: #7c3aed; }
.app-nav-icon-warehouse { background: linear-gradient(145deg, #fef9c3, #fde047); color: #a16207; }
.app-nav-icon-tag { background: linear-gradient(145deg, #ccfbf1, #5eead4); color: #0f766e; }
.app-nav-icon-factory { background: linear-gradient(145deg, #e7e5e4, #a8a29e); color: #57534e; }
.app-nav-icon-users { background: linear-gradient(145deg, #dbeafe, #93c5fd); color: #2563eb; }
.app-nav-icon-qr { background: linear-gradient(145deg, #fae8ff, #e879f9); color: #a21caf; }
.app-nav-icon-chart { background: linear-gradient(145deg, #d1fae5, #6ee7b7); color: #047857; }
.app-nav-icon-backup { background: linear-gradient(145deg, #e0e7ff, #a5b4fc); color: #4338ca; }
.app-nav-icon-log { background: linear-gradient(145deg, #f8fafc, #cbd5e1); color: #334155; }

.dark .app-nav-icon-home { background: rgba(180, 83, 9, 0.22); color: #fbbf24; }
.dark .app-nav-icon-tasks { background: rgba(29, 78, 216, 0.22); color: #93c5fd; }
.dark .app-nav-icon-box { background: rgba(77, 124, 15, 0.24); color: #bef264; }
.dark .app-nav-icon-device { background: rgba(14, 116, 144, 0.26); color: #67e8f9; }
.dark .app-nav-icon-location { background: rgba(220, 38, 38, 0.22); color: #fca5a5; }
.dark .app-nav-icon-inventory { background: rgba(109, 40, 217, 0.24); color: #c4b5fd; }
.dark .app-nav-icon-transfer { background: rgba(194, 65, 12, 0.24); color: #fdba74; }
.dark .app-nav-icon-user-transfer { background: rgba(190, 24, 93, 0.22); color: #f9a8d4; }
.dark .app-nav-icon-check { background: rgba(21, 128, 61, 0.24); color: #86efac; }
.dark .app-nav-icon-clipboard { background: rgba(3, 105, 161, 0.24); color: #7dd3fc; }
.dark .app-nav-icon-history { background: rgba(71, 85, 105, 0.32); color: #cbd5e1; }
.dark .app-nav-icon-info { background: rgba(124, 58, 237, 0.24); color: #c4b5fd; }
.dark .app-nav-icon-warehouse { background: rgba(161, 98, 7, 0.24); color: #fde047; }
.dark .app-nav-icon-tag { background: rgba(15, 118, 110, 0.24); color: #5eead4; }
.dark .app-nav-icon-factory { background: rgba(87, 83, 78, 0.34); color: #d6d3d1; }
.dark .app-nav-icon-users { background: rgba(37, 99, 235, 0.24); color: #93c5fd; }
.dark .app-nav-icon-qr { background: rgba(162, 28, 175, 0.24); color: #e879f9; }
.dark .app-nav-icon-chart { background: rgba(4, 120, 87, 0.24); color: #6ee7b7; }
.dark .app-nav-icon-backup { background: rgba(67, 56, 202, 0.24); color: #a5b4fc; }
.dark .app-nav-icon-log { background: rgba(51, 65, 85, 0.42); color: #cbd5e1; }

html:not(.dark) .rounded-3xl.border.border-slate-200.bg-white,
html:not(.dark) .rounded-3xl.border.border-slate-200.bg-white.p-5,
html:not(.dark) .rounded-3xl.border.border-slate-200.bg-white.p-8,
html:not(.dark) .rounded-3xl.border.border-slate-200.bg-white.px-5.py-8,
html:not(.dark) .rounded-3xl.border.border-slate-200.bg-white\/90,
html:not(.dark) .rounded-3xl.border.border-slate-200.bg-white\/80 {
  border-color: rgba(205, 176, 137, 0.34) !important;
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.99), rgba(246, 241, 233, 0.97)) !important;
  box-shadow:
    0 16px 42px rgba(148, 163, 184, 0.12),
    inset 0 1px 0 rgba(255, 255, 255, 0.74);
}

html:not(.dark) .rounded-2xl.border.border-slate-200,
html:not(.dark) .rounded-2xl.border.border-slate-200.bg-white,
html:not(.dark) .rounded-2xl.border.border-slate-200.p-4 {
  border-color: rgba(217, 119, 6, 0.14) !important;
}

html:not(.dark) .bg-slate-50 {
  background-color: #ede3d5 !important;
}

html:not(.dark) .text-slate-400 {
  color: #8a7765 !important;
}

html:not(.dark) .text-slate-500 {
  color: #6f6154 !important;
}

html:not(.dark) .text-slate-600 {
  color: #5f544a !important;
}

html:not(.dark) .text-slate-700 {
  color: #433d37 !important;
}

html:not(.dark) .text-slate-900 {
  color: #1f2937 !important;
}

html:not(.dark) input,
html:not(.dark) select,
html:not(.dark) textarea {
  border-color: rgba(191, 160, 120, 0.28);
  background: rgba(255, 251, 246, 0.96);
  box-shadow: inset 0 1px 2px rgba(148, 163, 184, 0.08);
  color: #1f2937;
}

html:not(.dark) input::placeholder,
html:not(.dark) textarea::placeholder {
  color: #8a7765;
}

html:not(.dark) input:focus,
html:not(.dark) select:focus,
html:not(.dark) textarea:focus {
  outline: none;
  border-color: rgba(217, 119, 6, 0.38);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.12);
}

html:not(.dark) .bg-orange-600 {
  background: linear-gradient(180deg, #c75d1c, #ad4f18) !important;
}

html:not(.dark) .hover\:bg-orange-500:hover {
  background: linear-gradient(180deg, #d06a26, #b8551c) !important;
}

html:not(.dark) table tbody tr:hover {
  background: rgba(255, 247, 237, 0.76);
}

.login-shell {
  background:
    linear-gradient(180deg, rgba(255, 252, 247, 0.99), rgba(246, 241, 233, 0.97)) !important;
  border-color: rgba(205, 176, 137, 0.34) !important;
}

.dark .login-shell {
  background:
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.08), transparent 28%),
    linear-gradient(180deg, rgba(10, 17, 30, 0.98), rgba(15, 23, 42, 0.98)) !important;
  border-color: rgba(71, 85, 105, 0.72) !important;
  box-shadow:
    0 24px 46px rgba(0, 0, 0, 0.34),
    inset 0 1px 0 rgba(148, 163, 184, 0.06) !important;
}

.login-brand {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.login-brand--stacked {
  flex-direction: column;
  justify-content: center;
  text-align: center;
}

.login-brand-icon {
  width: 5.5rem;
  height: 5.5rem;
  border-radius: 1rem;
  box-shadow: 0 10px 24px rgba(148, 163, 184, 0.18);
}

.dark .login-brand-icon {
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.28);
}

.dark .login-input {
  border-color: rgba(71, 85, 105, 0.85) !important;
  background: rgba(2, 6, 23, 0.92) !important;
  color: #f8fafc !important;
  box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.28);
}

.dark .login-input::placeholder {
  color: #94a3b8 !important;
}

.dark .login-input:focus {
  border-color: rgba(251, 146, 60, 0.8) !important;
  box-shadow:
    0 0 0 4px rgba(124, 45, 18, 0.24),
    inset 0 1px 2px rgba(0, 0, 0, 0.24) !important;
}

.dark .login-primary-button {
  background: linear-gradient(180deg, #ea580c, #c2410c) !important;
  box-shadow: 0 14px 24px rgba(124, 45, 18, 0.24);
}

.dark .login-primary-button:hover {
  background: linear-gradient(180deg, #f97316, #d9480f) !important;
}

.dark .login-divider {
  background: linear-gradient(90deg, transparent, rgba(71, 85, 105, 0.9), transparent) !important;
}

.dark .login-passkey-button {
  border-color: rgba(71, 85, 105, 0.9) !important;
  background: rgba(15, 23, 42, 0.72) !important;
  color: #e2e8f0 !important;
}

.dark .login-passkey-button:hover {
  border-color: rgba(251, 146, 60, 0.55) !important;
  background: rgba(30, 41, 59, 0.9) !important;
  color: #fed7aa !important;
}
