:root {
  --text: #16181d;
  --muted: #5b6070;

  /* Liquid glass surfaces: translucent enough to see the colorful bg through them */
  --glass-bg: rgba(255, 255, 255, 0.42);
  --glass-bg-strong: rgba(255, 255, 255, 0.55);
  --glass-border: rgba(255, 255, 255, 0.65);
  --glass-highlight: inset 0 1px 0 rgba(255, 255, 255, 0.7);
  --glass-blur: 26px;
  --glass-shadow: 0 8px 32px rgba(50, 30, 100, 0.16);

  --accent-1: #7c3aed;
  --accent-2: #06b6d4;
  --accent-3: #fb7185;
  --accent-gradient: linear-gradient(135deg, #8b5cf6 0%, #06b6d4 100%);
  --accent-gradient-warm: linear-gradient(135deg, #fb7185 0%, #f59e0b 100%);
  --neon-glow: 0 4px 20px rgba(124, 58, 237, 0.45), 0 0 0 1px rgba(139, 92, 246, 0.3);
  --neon-glow-warm: 0 4px 20px rgba(251, 113, 133, 0.45), 0 0 0 1px rgba(251, 113, 133, 0.3);

  --good: #22c55e;
  --medium: #eab308;
  --bad: #f97316;
  --critical: #ef4444;
  --radius: 22px;
  --sidebar-width: 252px;
}

* { box-sizing: border-box; }

html {
  background: #dfe3f4;
  overflow-x: hidden;
}

/* Vivid aurora wallpaper painted straight on body — the thing the glass blurs.
   Radial gradients are soft by themselves, no filter:blur needed (cheap on phones). */
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", Roboto, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  color: var(--text);
  line-height: 1.45;
  position: relative;
  min-height: 100vh;
  overflow-x: hidden;
  background-color: #e6e4fb;
  background-image:
    radial-gradient(60% 45% at 10% 5%, rgba(139, 92, 246, 0.85) 0%, rgba(139, 92, 246, 0) 62%),
    radial-gradient(55% 40% at 92% 10%, rgba(6, 182, 212, 0.8) 0%, rgba(6, 182, 212, 0) 62%),
    radial-gradient(55% 42% at 50% 55%, rgba(255, 255, 255, 0.6) 0%, rgba(255, 255, 255, 0) 70%),
    radial-gradient(60% 45% at 12% 100%, rgba(251, 113, 133, 0.75) 0%, rgba(251, 113, 133, 0) 62%),
    radial-gradient(55% 40% at 94% 92%, rgba(245, 158, 11, 0.6) 0%, rgba(245, 158, 11, 0) 62%),
    linear-gradient(165deg, #e9e4ff 0%, #ddf2fb 45%, #ffe7ee 100%);
  background-repeat: no-repeat;
  background-size: 100% 100%;
}

h1, h2, h3, h4 { letter-spacing: -0.015em; }

a { color: var(--accent-1); text-decoration: none; }
a:hover { text-decoration: underline; }

img, svg, video { max-width: 100%; }

.container {
  max-width: 880px;
  width: 100%;
  margin: 0 auto;
  padding: 16px 14px;
}

/* ---- App shell ---- */

.app-shell {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Desktop sidebar: frosted glass panel */
.sidebar {
  display: none;
  width: var(--sidebar-width);
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.35);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border-right: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
  color: var(--text);
  flex-direction: column;
  padding: 22px 14px;
  position: sticky;
  top: 0;
  align-self: flex-start;
  height: 100vh;
  overflow-y: auto;
}

.sidebar .brand {
  font-weight: 800;
  font-size: 16px;
  line-height: 1.3;
  margin-bottom: 26px;
  display: block;
  background: linear-gradient(120deg, #7c3aed, #06b6d4 60%, #fb7185);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.sidebar-nav { display: flex; flex-direction: column; gap: 5px; flex: 1; }
.sidebar-nav a {
  color: var(--text);
  padding: 11px 13px;
  border-radius: 15px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  font-size: 14.5px;
  transition: background 0.15s ease, box-shadow 0.15s ease, transform 0.12s ease;
}
.sidebar-nav a:hover {
  background: rgba(255, 255, 255, 0.5);
  text-decoration: none;
}
.sidebar-nav a.active {
  background: var(--accent-gradient);
  color: #fff;
  box-shadow: var(--neon-glow);
}

.nav-icon { font-size: 18px; line-height: 1; }

.sidebar-user {
  border-top: 1px solid rgba(255, 255, 255, 0.6);
  padding-top: 14px;
  margin-top: 14px;
}
.sidebar-user-name { font-weight: 700; font-size: 14px; }
.sidebar-user-role { font-size: 12px; }
.sidebar-user form { margin-top: 8px; }

/* Mobile top bar: light liquid glass, colorful wallpaper glows through */
.topbar {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight), 0 4px 24px rgba(50, 30, 100, 0.08);
  color: var(--text);
  padding: 12px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;
  position: sticky;
  top: 0;
  z-index: 30;
  width: 100%;
}

.topbar a.brand {
  font-weight: 800;
  font-size: 18px;
  background: linear-gradient(120deg, #7c3aed, #06b6d4 70%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.topbar form { margin: 0; }

.link-btn {
  background: rgba(255, 255, 255, 0.5);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 999px;
  cursor: pointer;
  font-size: 13.5px;
}

.sidebar .link-btn { color: var(--text); }

.app-main { flex: 1; min-width: 0; padding-bottom: 96px; }

/* Mobile bottom nav: floating glass dock */
.bottom-nav {
  position: fixed;
  bottom: 10px;
  left: 10px;
  right: 10px;
  display: flex;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(30px) saturate(180%);
  -webkit-backdrop-filter: blur(30px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 24px;
  z-index: 30;
  box-shadow: var(--glass-highlight), 0 12px 40px rgba(50, 30, 100, 0.25);
  padding: 6px;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
}
.bottom-nav::-webkit-scrollbar { display: none; }
.bottom-nav a {
  flex: 1 0 62px;
  min-width: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 7px 2px 6px;
  color: var(--muted);
  font-size: 9.5px;
  font-weight: 600;
  line-height: 1.15;
  text-align: center;
  border-radius: 18px;
  overflow: hidden;
}
.bottom-nav a:hover { text-decoration: none; }
.bottom-nav a.active {
  color: #fff;
  background: var(--accent-gradient);
  box-shadow: var(--neon-glow);
}
.bottom-nav .nav-icon { font-size: 20px; }
.bottom-nav .nav-label {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 768px) {
  .app-shell { flex-direction: row; }
  .sidebar { display: flex; }
  .topbar { display: none; }
  .bottom-nav { display: none; }
  .app-main { padding-bottom: 0; }
  .container { padding: 22px 20px; }
}

/* ---- Liquid glass components ---- */

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  padding: 18px;
  margin-bottom: 14px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 12px;
}

.obj-card {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  padding: 14px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.obj-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--glass-highlight), 0 16px 44px rgba(50, 30, 100, 0.24);
}

.obj-card img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.5);
}

.obj-card h3 { margin: 0; font-size: 17px; }
.obj-card .year { color: var(--muted); font-size: 13px; }

.badge {
  display: inline-block;
  padding: 3px 11px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
  white-space: nowrap;
}
.badge.good { background: var(--good); box-shadow: 0 2px 10px rgba(34, 197, 94, 0.45); }
.badge.medium { background: var(--medium); color: #3d2f00; box-shadow: 0 2px 10px rgba(234, 179, 8, 0.45); }
.badge.bad { background: var(--bad); box-shadow: 0 2px 10px rgba(249, 115, 22, 0.45); }
.badge.critical { background: var(--critical); box-shadow: 0 2px 10px rgba(239, 68, 68, 0.5); }
.badge.none { background: rgba(120, 126, 145, 0.85); }

.btn {
  display: inline-block;
  background: var(--accent-gradient);
  color: #fff;
  padding: 11px 18px;
  border-radius: 16px;
  border: none;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  text-align: center;
  white-space: normal;
  max-width: 100%;
  box-shadow: var(--neon-glow);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.btn:hover {
  transform: translateY(-1px);
  text-decoration: none;
  box-shadow: 0 6px 28px rgba(124, 58, 237, 0.55), 0 0 0 1px rgba(139, 92, 246, 0.35);
}
.btn.secondary {
  background: var(--glass-bg-strong);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  color: var(--text);
  border: 1px solid var(--glass-border);
  box-shadow: var(--glass-highlight);
}
.btn.secondary:hover { box-shadow: var(--glass-highlight), 0 6px 18px rgba(50, 30, 100, 0.14); }
.btn.warm { background: var(--accent-gradient-warm); box-shadow: var(--neon-glow-warm); }
.btn.warm:hover { box-shadow: 0 6px 28px rgba(251, 113, 133, 0.55), 0 0 0 1px rgba(251, 113, 133, 0.35); }
.btn.danger { background: linear-gradient(135deg, #ef4444, #f97316); box-shadow: 0 4px 20px rgba(239, 68, 68, 0.45); }
.btn.small { padding: 7px 14px; font-size: 13px; border-radius: 12px; }
.btn-row { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.btn-row .btn { flex-shrink: 1; }

.field { margin-bottom: 16px; min-width: 0; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; }
.field input[type=text],
.field input[type=password],
.field input[type=date],
.field input[type=number],
.field input[type=file],
.field textarea,
.field select {
  width: 100%;
  min-width: 0;
  padding: 11px 13px;
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  font-size: 15px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  color: var(--text);
}
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: rgba(139, 92, 246, 0.8);
  box-shadow: 0 0 0 4px rgba(139, 92, 246, 0.25);
}
.field textarea { min-height: 70px; resize: vertical; }

.status-options {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.status-options label {
  border: 2px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 13px;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}
.status-options input { margin: 0; }
.status-options label.good { border-color: var(--good); }
.status-options label.medium { border-color: var(--medium); }
.status-options label.bad { border-color: var(--bad); }
.status-options label.critical { border-color: var(--critical); }
.status-options input:checked + span { font-weight: 800; }

.checklist-item {
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--glass-highlight), var(--glass-shadow);
  padding: 14px;
  margin-bottom: 12px;
}
.checklist-item h4 { margin: 0 0 10px; }

.inspection-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 14px;
  background: var(--glass-bg);
  backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: 17px;
  box-shadow: var(--glass-highlight);
  margin-bottom: 8px;
  flex-wrap: wrap;
  gap: 8px;
}
.inspection-row > * { min-width: 0; }

.muted { color: var(--muted); font-size: 14px; }

.error-box {
  background: rgba(239, 68, 68, 0.14);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(239, 68, 68, 0.45);
  color: #b91c1c;
  font-weight: 600;
  padding: 10px 14px;
  border-radius: 14px;
  margin-bottom: 14px;
}

.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.login-box {
  background: var(--glass-bg);
  backdrop-filter: blur(32px) saturate(190%);
  -webkit-backdrop-filter: blur(32px) saturate(190%);
  border: 1px solid var(--glass-border);
  border-radius: 28px;
  box-shadow: var(--glass-highlight), 0 24px 70px rgba(50, 30, 100, 0.3);
  padding: 30px;
  width: 100%;
  max-width: 350px;
}
.login-box h1 {
  font-size: 21px;
  margin-top: 0;
  background: linear-gradient(120deg, #7c3aed, #06b6d4 60%, #fb7185);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.trend-row {
  display: flex;
  align-items: flex-end;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.trend-point {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.trend-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-block;
}
.trend-dot.good { background: var(--good); box-shadow: 0 0 10px rgba(34, 197, 94, 0.7); }
.trend-dot.medium { background: var(--medium); box-shadow: 0 0 10px rgba(234, 179, 8, 0.7); }
.trend-dot.bad { background: var(--bad); box-shadow: 0 0 10px rgba(249, 115, 22, 0.7); }
.trend-dot.critical { background: var(--critical); box-shadow: 0 0 10px rgba(239, 68, 68, 0.75); }
.trend-date { font-size: 11px; color: var(--muted); white-space: nowrap; }

.progress-bar {
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid var(--glass-border);
  border-radius: 999px;
  height: 12px;
  overflow: hidden;
  margin: 8px 0 4px;
}
.progress-bar-fill {
  background: var(--accent-gradient);
  box-shadow: 0 0 12px rgba(124, 58, 237, 0.6);
  height: 100%;
  border-radius: 999px;
  transition: width 0.2s ease;
}

.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(120px, 100%), 1fr));
  gap: 8px;
  margin-top: 10px;
}
.photo-grid img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
}

.search-row {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.search-row form { flex: 1 1 220px; min-width: 0; }
.search-row input {
  flex: 1 1 120px;
  min-width: 0;
  width: auto;
  padding: 11px 13px;
  border-radius: 14px;
  border: 1px solid var(--glass-border);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(14px) saturate(160%);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
}
.search-row .btn { flex-shrink: 0; }

@media (max-width: 480px) {
  .obj-card img { height: 120px; }
  .container { padding: 12px 12px; }
}
