/* ======================================================================
   Master Stylesheet — Ultra Smooth Glassmorphism (Unified Monochrome)
   Clean and premium monochrome palette, unified icon colors,
   and butter-smooth transitions across the entire site and sidebar.
   ====================================================================== */

:root {
  --bg-canvas: #f8fafc;
  --glass-bg: rgba(255, 255, 255, 0.74);
  --glass-bg-hover: rgba(255, 255, 255, 0.90);
  --glass-bg-active: rgba(255, 255, 255, 0.98);
  --glass-bg-subtle: rgba(255, 255, 255, 0.58);
  --glass-bg-inset: rgba(241, 245, 249, 0.6);
  
  --glass-border: rgba(255, 255, 255, 0.88);
  --glass-border-subtle: rgba(226, 232, 240, 0.75);
  --glass-border-specular: rgba(255, 255, 255, 0.98);

  --text-primary: #090d16;
  --text-secondary: #334155;
  --text-muted: #64748b;

  --accent-dark: #0f172a;
  --accent-dark-hover: #000000;
  
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-pill: 9999px;

  --header-height: 58px;
  --mobile-nav-height: 52px;

  /* Silky smooth physics easing */
  --ease-smooth: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-fluid: cubic-bezier(0.4, 0, 0.2, 1);

  --shadow-glass: 
    0 10px 30px -5px rgba(15, 23, 42, 0.04),
    0 1px 3px 0 rgba(15, 23, 42, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);

  --shadow-glass-hover: 
    0 16px 36px -4px rgba(15, 23, 42, 0.07),
    0 2px 6px 0 rgba(15, 23, 42, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 1);

  --shadow-modal: 
    0 25px 60px -15px rgba(15, 23, 42, 0.18),
    0 0 0 1px rgba(15, 23, 42, 0.04),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Hind Siliguri", "Noto Sans Bengali", "Helvetica Neue", Arial, sans-serif;
  color: var(--text-primary);
  background-color: var(--bg-canvas);
  background-image: 
    radial-gradient(at 10% 12%, rgba(226, 232, 240, 0.85) 0px, transparent 55%),
    radial-gradient(at 90% 15%, rgba(203, 213, 225, 0.65) 0px, transparent 50%),
    radial-gradient(at 50% 50%, rgba(248, 250, 252, 0.95) 0px, transparent 65%),
    radial-gradient(at 15% 90%, rgba(226, 232, 240, 0.8) 0px, transparent 55%),
    radial-gradient(at 85% 85%, rgba(203, 213, 225, 0.55) 0px, transparent 50%);
  background-attachment: fixed;
  background-size: 100% 100%;
  line-height: 1.5;
  font-size: 14px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a {
  color: var(--accent-dark);
  text-decoration: none;
  font-weight: 500;
  transition: color 0.2s var(--ease-fluid);
}
a:hover {
  text-decoration: underline;
}

h1 {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--text-primary);
}
h2 {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}
h3 {
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-primary);
}
p {
  color: var(--text-secondary);
}

/* ══════════════ UNIFIED MONOCHROME ICONS ══════════════ */
.icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  stroke: currentColor;
  stroke-width: 1.85;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  vertical-align: middle;
  transition: transform 0.25s var(--ease-smooth), stroke 0.2s var(--ease-fluid);
}

.icon-sm {
  width: 13.5px;
  height: 13.5px;
  stroke-width: 1.8;
}

.icon-lg {
  width: 19px;
  height: 19px;
}

.nav-icon {
  width: 18px;
  height: 18px;
  min-width: 18px;
  max-width: 18px;
  stroke: currentColor;
  opacity: 0.85;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.25s var(--ease-smooth), opacity 0.2s ease;
}

/* ══════════════ LOGIN SCREEN ══════════════ */
#login {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--bg-canvas);
  background-image: 
    radial-gradient(at 20% 25%, rgba(203, 213, 225, 0.8) 0px, transparent 50%),
    radial-gradient(at 80% 20%, rgba(226, 232, 240, 0.9) 0px, transparent 50%),
    radial-gradient(at 50% 80%, rgba(148, 163, 184, 0.35) 0px, transparent 60%);
  overflow: hidden;
  z-index: 1000;
  padding: 16px;
}

#login::before {
  content: "";
  position: absolute;
  width: 440px;
  height: 440px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(203, 213, 225, 0.7), rgba(226, 232, 240, 0.2));
  top: 15%;
  left: 20%;
  filter: blur(70px);
  pointer-events: none;
  animation: orbFloat 16s ease-in-out infinite alternate;
}

#login::after {
  content: "";
  position: absolute;
  width: 380px;
  height: 380px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(226, 232, 240, 0.8), rgba(203, 213, 225, 0.2));
  bottom: 12%;
  right: 20%;
  filter: blur(70px);
  pointer-events: none;
  animation: orbFloat 14s ease-in-out infinite alternate-reverse;
}

@keyframes orbFloat {
  0% { transform: translate(0, 0) scale(1); }
  100% { transform: translate(35px, 45px) scale(1.08); }
}

#login .box {
  position: relative;
  width: 100%;
  max-width: 380px;
  background: rgba(255, 255, 255, 0.80);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  padding: 34px 28px;
  box-shadow: 
    0 25px 50px -12px rgba(15, 23, 42, 0.1),
    0 0 0 1px rgba(15, 23, 42, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 1);
  z-index: 2;
  transition: transform 0.3s var(--ease-smooth), box-shadow 0.3s var(--ease-smooth);
}

#login h1 {
  margin-bottom: 6px;
  font-size: 21px;
}
#login .sub {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 22px;
}
label {
  display: block;
  font-size: 11.5px;
  font-weight: 700;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
}

/* ══════════════ FORM INPUTS & SELECTS ══════════════ */
input, select, textarea {
  width: 100%;
  border: 1px solid var(--glass-border-subtle);
  border-radius: var(--radius-sm);
  padding: 10px 13px;
  font-size: 13.5px;
  font-family: inherit;
  background: rgba(255, 255, 255, 0.74);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: var(--text-primary);
  box-shadow: 
    inset 0 1px 2px rgba(15, 23, 42, 0.02),
    0 1px 0 rgba(255, 255, 255, 0.9);
  transition: all 0.22s var(--ease-smooth);
}

input:focus, select:focus, textarea:focus {
  background: rgba(255, 255, 255, 0.98);
  border-color: var(--accent-dark);
  outline: none;
  box-shadow: 
    0 0 0 3px rgba(15, 23, 42, 0.08),
    inset 0 1px 2px rgba(15, 23, 42, 0.02);
}

input::placeholder, textarea::placeholder {
  color: #94a3b8;
}

.err {
  color: #dc2626;
  font-weight: 600;
  font-size: 13px;
  min-height: 18px;
  margin-top: 10px;
}

/* ══════════════ BUTTONS ══════════════ */
button, .btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid var(--glass-border-subtle);
  border-radius: var(--radius-sm);
  padding: 9px 15px;
  background: var(--glass-bg);
  color: var(--text-primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 
    0 2px 6px rgba(15, 23, 42, 0.03),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transition: all 0.22s var(--ease-smooth);
  user-select: none;
  white-space: nowrap;
}

button:hover, .btn:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(148, 163, 184, 0.8);
  transform: translateY(-1.5px);
  box-shadow: 
    0 6px 16px rgba(15, 23, 42, 0.06),
    inset 0 1px 0 rgba(255, 255, 255, 1);
}

button:active, .btn:active {
  transform: translateY(0.5px);
  box-shadow: 0 2px 4px rgba(15, 23, 42, 0.04);
}

button.primary, .btn.primary {
  background: var(--accent-dark);
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 
    0 4px 14px rgba(15, 23, 42, 0.2),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
}

button.primary:hover, .btn.primary:hover {
  background: var(--accent-dark-hover);
  border-color: rgba(255, 255, 255, 0.3);
  transform: translateY(-1.5px);
  box-shadow: 
    0 8px 22px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
}

button.primary:active, .btn.primary:active {
  transform: translateY(0.5px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

button.sm {
  padding: 6px 11px;
  font-size: 12px;
  border-radius: 6px;
  gap: 5px;
}

button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  transform: none !important;
  box-shadow: none !important;
}

/* ══════════════ APP HEADER ══════════════ */
#app {
  display: none;
  width: 100%;
  height: 100%;
}

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  height: var(--header-height);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(24px) saturate(190%);
  -webkit-backdrop-filter: blur(24px) saturate(190%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 
    0 4px 20px -2px rgba(15, 23, 42, 0.03),
    inset 0 -1px 0 rgba(0, 0, 0, 0.03);
  padding: 0 20px;
}

header .title {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

/* Mobile hamburger button */
.menu-btn {
  display: none;
  background: transparent;
  border: 1px solid var(--glass-border-subtle);
  border-radius: 8px;
  width: 36px;
  height: 36px;
  padding: 7px;
  flex-direction: column;
  justify-content: space-around;
  cursor: pointer;
  box-shadow: none;
  backdrop-filter: blur(8px);
  transition: all 0.25s var(--ease-smooth);
}
.menu-btn:hover {
  background: rgba(255, 255, 255, 0.6);
  border-color: rgba(148, 163, 184, 0.8);
}
.menu-btn span {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.25s var(--ease-smooth);
}

.view-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  padding: 3px 9px;
  background: rgba(15, 23, 42, 0.06);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: var(--radius-pill);
  color: var(--text-secondary);
  transition: all 0.25s var(--ease-smooth);
}

/* ══════════════ DESKTOP APP SHELL & ULTRA-SMOOTH SIDEBAR ══════════════ */
.shell {
  display: flex;
  position: fixed;
  top: var(--header-height);
  left: 0;
  right: 0;
  bottom: 0;
}

/* Ultra-smooth sidebar navigation */
nav {
  width: 215px;
  flex-shrink: 0;
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-right: 1px solid var(--glass-border);
  box-shadow: 
    4px 0 24px -2px rgba(15, 23, 42, 0.02),
    inset -1px 0 0 rgba(0, 0, 0, 0.02);
  padding: 16px 8px;
  overflow-y: auto;
  scroll-behavior: smooth;
}

nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  margin: 3px 0;
  text-align: left;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  padding: 10px 14px;
  font-size: 13.5px;
  font-weight: 500;
  letter-spacing: -0.01em;
  box-shadow: none;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  position: relative;
  overflow: hidden;
  transition: 
    background 0.25s var(--ease-smooth),
    color 0.2s var(--ease-fluid),
    transform 0.25s var(--ease-smooth),
    border-color 0.25s var(--ease-smooth),
    box-shadow 0.25s var(--ease-smooth);
}

nav button::before {
  content: "";
  position: absolute;
  left: 0;
  top: 15%;
  bottom: 15%;
  width: 3px;
  border-radius: 0 4px 4px 0;
  background: var(--text-primary);
  opacity: 0;
  transform: scaleY(0.4);
  transition: all 0.25s var(--ease-smooth);
}

nav button:hover {
  background: rgba(255, 255, 255, 0.75);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.03);
  transform: translateX(4px);
}

nav button:hover::before {
  opacity: 0.6;
  transform: scaleY(0.85);
}

nav button:hover .nav-icon {
  transform: scale(1.12);
  opacity: 1;
}

nav button.active {
  background: var(--accent-dark);
  color: #ffffff;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 
    0 4px 14px -1px rgba(15, 23, 42, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-weight: 600;
  transform: none;
}

nav button.active::before {
  opacity: 1;
  background: #ffffff;
  transform: scaleY(1);
}

nav button.active .nav-icon {
  opacity: 1;
  transform: scale(1.05);
}

/* Main content container */
main {
  flex: 1;
  padding: 26px 32px;
  overflow-y: auto;
  overflow-x: hidden;
  scroll-behavior: smooth;
}

/* ══════════════ MOBILE DRAWER ══════════════ */
#drawerOverlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.35);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  z-index: 500;
  opacity: 0;
  transition: opacity 0.3s var(--ease-smooth);
}
#drawerOverlay.open {
  display: block;
  opacity: 1;
}

#mobileDrawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: 290px;
  max-width: 84vw;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(30px) saturate(190%);
  -webkit-backdrop-filter: blur(30px) saturate(190%);
  border-right: 1px solid var(--glass-border);
  box-shadow: 12px 0 45px rgba(0, 0, 0, 0.16);
  z-index: 501;
  transform: translateX(-100%);
  transition: transform 0.32s var(--ease-smooth);
  flex-direction: column;
}
#mobileDrawer.open {
  transform: translateX(0);
}

.drawer-header {
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 18px;
  border-bottom: 1px solid var(--glass-border-subtle);
}

.drawer-nav {
  padding: 12px 10px;
  overflow-y: auto;
  flex: 1;
}

.drawer-nav button {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 12px;
  width: 100%;
  margin-bottom: 6px;
  padding: 11px 16px;
  text-align: left;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-secondary);
  font-size: 14px;
  font-weight: 500;
  box-shadow: none;
  backdrop-filter: none;
  transition: all 0.22s var(--ease-smooth);
}
.drawer-nav button:hover {
  background: rgba(255, 255, 255, 0.7);
  color: var(--text-primary);
  transform: translateX(4px);
}
.drawer-nav button:hover .nav-icon {
  transform: scale(1.12);
  opacity: 1;
}
.drawer-nav button.active {
  background: var(--accent-dark);
  color: #ffffff;
  font-weight: 600;
  border-color: rgba(255, 255, 255, 0.2);
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.22);
}
.drawer-nav button.active .nav-icon {
  opacity: 1;
  color: #ffffff;
  transform: scale(1.05);
}

.drawer-close-btn {
  width: 34px;
  height: 34px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  border: 1px solid var(--glass-border-subtle);
  background: rgba(255, 255, 255, 0.5);
  color: var(--text-secondary);
  cursor: pointer;
  box-shadow: none;
  backdrop-filter: blur(8px);
  transition: all 0.2s var(--ease-smooth);
}
.drawer-close-btn:hover {
  background: rgba(255, 255, 255, 0.95);
  color: var(--text-primary);
  border-color: rgba(148, 163, 184, 0.8);
  transform: scale(1.05);
}

/* ══════════════ VIEWS ══════════════ */
.view {
  display: none;
  animation: viewFade 0.28s var(--ease-smooth);
}
.view.active {
  display: block;
}

@keyframes viewFade {
  0% { opacity: 0; transform: translateY(6px); }
  100% { opacity: 1; transform: translateY(0); }
}

.view > h2 {
  margin-bottom: 4px;
}
.view > .desc {
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
}

/* ══════════════ GLASS CARDS & GRID ══════════════ */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 18px;
}

.card {
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  padding: 20px 22px;
  box-shadow: var(--shadow-glass);
  transition: all 0.28s var(--ease-smooth);
}

.card:hover {
  background: var(--glass-bg-hover);
  border-color: rgba(255, 255, 255, 1);
  box-shadow: var(--shadow-glass-hover);
  transform: translateY(-2px);
}

.card h3 {
  margin-bottom: 6px;
}
.card p {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 16px;
}

/* ══════════════ GLASS STATS STRIP ══════════════ */
.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 0;
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 22px;
  box-shadow: var(--shadow-glass);
}

.stat {
  padding: 16px 18px;
  border-right: 1px solid var(--glass-border-subtle);
  transition: background 0.2s ease;
}

.stat:last-child {
  border-right: 0;
}

.stat:hover {
  background: rgba(255, 255, 255, 0.45);
}

.stat .lbl {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}
.stat .val {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-primary);
  margin-top: 4px;
  letter-spacing: -0.03em;
}

/* ══════════════ DEFINITION ROWS ══════════════ */
.rows {
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 
    0 2px 10px rgba(15, 23, 42, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  padding: 12px 18px;
  border-bottom: 1px solid var(--glass-border-subtle);
  font-size: 13.5px;
  transition: background 0.15s ease;
}
.row:hover {
  background: rgba(255, 255, 255, 0.35);
}
.row:last-child {
  border-bottom: 0;
}
.row .k {
  color: var(--text-muted);
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.row .v {
  font-weight: 600;
  color: var(--text-primary);
  text-align: right;
  word-break: break-word;
}

/* ══════════════ TOGGLE SWITCHES ══════════════ */
.toggle-list {
  background: rgba(255, 255, 255, 0.65);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: 
    0 4px 16px rgba(15, 23, 42, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--glass-border-subtle);
  transition: background 0.15s ease;
}
.toggle:last-child {
  border-bottom: 0;
}
.toggle:hover {
  background: rgba(255, 255, 255, 0.45);
}
.toggle .t-name {
  font-weight: 600;
  color: var(--text-primary);
}
.toggle .t-desc {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}
.switch {
  position: relative;
  width: 46px;
  height: 24px;
  flex-shrink: 0;
}
.switch input {
  opacity: 0;
  width: 0;
  height: 0;
}
.slider {
  position: absolute;
  inset: 0;
  background: rgba(203, 213, 225, 0.7);
  backdrop-filter: blur(8px);
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.85);
  transition: 0.25s var(--ease-fluid);
  cursor: pointer;
}
.slider:before {
  content: "";
  position: absolute;
  width: 18px;
  height: 18px;
  left: 2px;
  top: 2px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.15);
  transition: 0.25s var(--ease-fluid);
}
.switch input:checked + .slider {
  background: var(--accent-dark);
}
.switch input:checked + .slider:before {
  transform: translateX(22px);
}

/* ══════════════ GLASS TABLES & SCROLL WRAPPERS ══════════════ */
div[style*="overflow-x:auto"], .table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-md);
  background: var(--glass-bg);
  backdrop-filter: blur(18px) saturate(180%);
  -webkit-backdrop-filter: blur(18px) saturate(180%);
  border: 1px solid var(--glass-border);
  box-shadow: var(--shadow-glass);
  margin-bottom: 18px;
}

table {
  width: 100%;
  min-width: 620px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 13px;
  border: none;
  background: transparent;
  box-shadow: none;
  margin-bottom: 0;
}

th {
  background: rgba(241, 245, 249, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  padding: 13px 14px;
  border-bottom: 1px solid var(--glass-border-subtle);
  text-align: left;
  white-space: nowrap;
}

td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--glass-border-subtle);
  color: var(--text-primary);
  vertical-align: middle;
  transition: background 0.15s ease;
}

tbody tr:last-child td {
  border-bottom: 0;
}

tbody tr:hover td {
  background: rgba(255, 255, 255, 0.55);
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  background: rgba(241, 245, 249, 0.8);
  backdrop-filter: blur(6px);
  border: 1px solid var(--glass-border-subtle);
  border-radius: var(--radius-pill);
  padding: 2px 9px;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
}

/* ══════════════ LED STATUS INDICATORS ══════════════ */
.badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.badge-dot.green {
  background: #16a34a;
  box-shadow: 0 0 0 2px rgba(22, 163, 74, 0.25);
}
.badge-dot.red {
  background: #dc2626;
  box-shadow: 0 0 0 2px rgba(220, 38, 38, 0.25);
}
.badge-dot.yellow {
  background: #ca8a04;
  box-shadow: 0 0 0 2px rgba(202, 138, 4, 0.25);
}
.badge-dot.gray {
  background: #94a3b8;
}

/* ══════════════ TOOLBAR & NOTICES ══════════════ */
.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}
.toolbar .spacer {
  flex: 1;
}
.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}
.muted {
  color: var(--text-muted);
  font-size: 12.5px;
}
.hidden {
  display: none !important;
}

.notice {
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--glass-border-subtle);
  border-radius: var(--radius-md);
  padding: 13px 16px;
  margin-bottom: 16px;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 
    0 2px 8px rgba(15, 23, 42, 0.02),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
}

/* ══════════════ GLASS MODALS ══════════════ */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.38);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 200;
}

.modal.open {
  display: flex;
}

.modal .box {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(28px) saturate(190%);
  -webkit-backdrop-filter: blur(28px) saturate(190%);
  border: 1px solid rgba(255, 255, 255, 0.95);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  padding: 28px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-modal);
  animation: modalPop 0.28s var(--ease-smooth);
}

@keyframes modalPop {
  0% { opacity: 0; transform: scale(0.96) translateY(8px); }
  100% { opacity: 1; transform: scale(1) translateY(0); }
}

.modal h3 {
  margin-bottom: 16px;
  font-size: 17px;
}
.field {
  margin-bottom: 14px;
}

/* ══════════════ FROSTED SCROLLBARS ══════════════ */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(148, 163, 184, 0.35);
  border-radius: var(--radius-pill);
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.55);
}

/* ══════════════ RESPONSIVE MOBILE VIEW (< 768px) ══════════════ */
@media (max-width: 768px) {
  header {
    padding: 0 14px;
  }
  .menu-btn {
    display: flex;
  }
  header .title {
    font-size: 15px;
  }
  .view-badge {
    font-size: 10.5px;
    padding: 2px 7px;
  }

  /* Mobile Shell: top bar + main */
  .shell {
    flex-direction: column;
    top: var(--header-height);
  }

  /* Horizontal swipeable pill tab-bar */
  nav {
    width: 100%;
    height: var(--mobile-nav-height);
    flex-shrink: 0;
    border-right: 0;
    border-bottom: 1px solid var(--glass-border);
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 6px 12px;
    gap: 8px;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
  }
  nav::-webkit-scrollbar {
    display: none;
  }
  nav button {
    width: auto;
    flex-shrink: 0;
    margin: 0;
    padding: 7px 14px;
    font-size: 13px;
    height: 38px;
    border-radius: var(--radius-pill);
    background: rgba(255, 255, 255, 0.65);
    border: 1px solid var(--glass-border-subtle);
    display: inline-flex;
    align-items: center;
    gap: 6px;
    transition: all 0.25s var(--ease-smooth);
  }
  nav button .nav-icon {
    margin-right: 0;
    width: 15px;
    height: 15px;
  }
  nav button::before {
    display: none;
  }
  nav button:hover {
    transform: none;
  }
  nav button.active {
    background: var(--accent-dark);
    color: #ffffff;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.22);
  }

  /* Mobile Drawer */
  #mobileDrawer {
    display: flex;
  }

  /* Main viewport on mobile */
  main {
    padding: 16px 14px 28px 14px;
  }

  /* Stats 2x2 grid */
  .stats {
    grid-template-columns: repeat(2, 1fr);
    border-radius: var(--radius-md);
  }
  .stat {
    padding: 12px 14px;
    border-right: 1px solid var(--glass-border-subtle);
    border-bottom: 1px solid var(--glass-border-subtle);
  }
  .stat:nth-child(2n) {
    border-right: 0;
  }
  .stat:nth-last-child(-n+2) {
    border-bottom: 0;
  }
  .stat .val {
    font-size: 20px;
  }

  /* Cards single column */
  .cards {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .card {
    padding: 16px;
    border-radius: var(--radius-md);
  }

  /* Toolbar buttons on mobile */
  .toolbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
  }
  .toolbar .spacer {
    display: none;
  }
  .toolbar button {
    flex-grow: 1;
    text-align: center;
    justify-content: center;
  }

  /* Inputs on mobile — 15px to prevent iOS auto-zoom */
  input, select, textarea {
    font-size: 15px;
    padding: 11px 12px;
  }

  /* Bottom sheet style modals on mobile */
  .modal {
    padding: 0;
    align-items: flex-end;
  }
  .modal .box {
    width: 100%;
    max-width: 100%;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    padding: 24px 18px 30px 18px;
    max-height: 85vh;
  }

  /* Login on mobile */
  #login {
    padding: 14px;
  }
  #login .box {
    padding: 26px 20px;
    border-radius: var(--radius-lg);
  }
  #login::before {
    width: 260px;
    height: 260px;
  }
  #login::after {
    width: 220px;
    height: 220px;
  }
}
