* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.multiselect-input.disabled {
  opacity: 0.5;
  pointer-events: none;
  cursor: not-allowed;
}

:root {
  /* School logo colors: Blue, Red, White */
  --primary: #1E40AF;
  --primary-light: #3B82F6;
  --accent: #DC2626;
  --accent-light: #EF4444;
  --gray-1: #F8F9FA;
  --gray-2: #E9ECEF;
  --gray-3: #DEE2E6;
  --gray-4: #ADB5BD;
  --text-primary: #111111;
  --text-secondary: #495057;
  --text-tertiary: #6C757D;
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --border-color: #DEE2E6;
  --shadow-color: rgba(0, 0, 0, 0.08);
  --shadow-color-lg: rgba(0, 0, 0, 0.15);
  /* Light mode frosted glass layers (depth: nav → sidebar → content → card → modal) */
  --glass-nav:     rgba(255, 255, 255, 0.92);
  --glass-sidebar: rgba(255, 255, 255, 0.88);
  --glass-content: rgba(255, 255, 255, 0.52);
  --glass-card:    rgba(255, 255, 255, 0.94);
  --glass-card-hover: rgba(255, 255, 255, 1);
  --glass-modal:   rgba(255, 255, 255, 0.97);
  --glass-border:  rgba(200, 210, 230, 0.85);
  --glass-inset:   inset 0 1px 0 rgba(255, 255, 255, 1);
  --shadow-color: rgba(30, 64, 175, 0.08);
  --shadow-color-lg: rgba(30, 64, 175, 0.16);
  color-scheme: light;
}

/* Dark mode */
[data-theme="dark"] {
  --primary: #60A5FA;
  --primary-light: #93C5FD;
  --accent: #F87171;
  --accent-light: #FCA5A5;
  --gray-1: #0D1117;
  --gray-2: #161B22;
  --gray-3: #21262D;
  --gray-4: #30363D;
  --text-primary: #FFFFFF;
  --text-secondary: #C9D1D9;
  --text-tertiary: #8B949E;
  --bg-primary: #000000;
  --bg-secondary: #0D1117;
  --border-color: #30363D;
  --shadow-color: rgba(0, 0, 0, 0.40);
  --shadow-color-lg: rgba(0, 0, 0, 0.60);
  color-scheme: dark;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  background: linear-gradient(135deg, #dfe9f3 0%, #c8d8e8 50%, #b8cfe0 100%);
  background-attachment: fixed;
  color: var(--text-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background 0.3s ease;
}

[data-theme="dark"] body {
  background: linear-gradient(135deg, #0a0c10 0%, #111827 40%, #0f172a 100%);
}

[data-theme="dark"] .content {
  background: rgba(13, 17, 23, 0.55);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
}

/* Auth Styles */
.auth-container {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  padding-bottom: 18vh;
  position: relative;
  overflow: hidden;
  transition: background 0.3s ease;
}

.auth-container::before {
  content: '';
  position: absolute;
  inset: -20px;
  background-image: url('123011932_1655972131242308_2583664852016640382_n.jpg');
  background-size: cover;
  background-position: center top;
  background-repeat: no-repeat;
  filter: blur(2px);
  transform: scale(1.05);
  z-index: 0;
}

.auth-container::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  z-index: 0;
}

.auth-container > * {
  position: relative;
  z-index: 1;
}

[data-theme="dark"] .auth-container::after {
  background: rgba(0, 0, 0, 0.55);
}

.theme-toggle-button {
  position: absolute;
  top: 20px;
  right: 20px;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 12px;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

.theme-toggle-button:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.4);
  transform: scale(1.05);
}

.auth-box {
  background: rgba(255, 255, 255, 0.55);
  -webkit-backdrop-filter: blur(32px) saturate(1.8) brightness(1.05);
  backdrop-filter: blur(32px) saturate(1.8) brightness(1.05);
  padding: 40px;
  border-radius: 20px;
  box-shadow:
    0 24px 64px rgba(0, 0, 0, 0.22),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.85);
  width: 100%;
  max-width: 400px;
  border: 1px solid rgba(255, 255, 255, 0.60);
  transition: all 0.3s ease;
}

[data-theme="dark"] .auth-box {
  background: rgba(28, 28, 30, 0.90);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.50);
  border: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
}

.auth-logo {
  display: block;
  margin: 0 auto 16px;
  width: 120px;
  height: 120px;
  object-fit: contain;
}

.auth-box h1 {
  text-align: center;
  margin-bottom: 6px;
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
}

.auth-box .subtitle {
  text-align: center;
  color: var(--text-secondary);
  margin-bottom: 30px;
  font-size: 14px;
}

.btn-forgot {
  display: block;
  width: 100%;
  background: none;
  border: none;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
  margin-top: 14px;
  padding: 4px 0;
  text-align: center;
  opacity: 0.75;
  transition: opacity 0.2s;
}
.btn-forgot:hover { opacity: 1; text-decoration: underline; }

.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 8px;
  padding: 0 4px;
  margin-left: 6px;
  vertical-align: middle;
}

/* Keep the arrow right-aligned even when badge is present */
.menu-parent {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 0;
}

.menu-parent::after {
  content: '▾';
  font-size: 12px;
  margin-left: auto;
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Bottom Info Bar */
.bottom-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: stretch;
  min-height: 56px;
  background: rgba(8, 8, 18, 0.45);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  border-top: 1px solid rgba(255, 255, 255, 0.10);
  z-index: 200;
}

.bottom-panel {
  flex: 1;
  display: none;
  align-items: center;
  padding: 8px 24px;
  gap: 14px;
  opacity: 1;
  transform: translateY(0);
  transition: opacity 0.45s cubic-bezier(0.4, 0, 0.2, 1),
              transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
}

.bottom-panel.panel-out {
  opacity: 0;
  transform: translateY(10px);
}

.bottom-panel.panel-in-start {
  opacity: 0 !important;
  transform: translateY(-10px) !important;
  transition: none !important;
}

.bottom-panel + .bottom-panel {
  border-left: 1px solid rgba(255, 255, 255, 0.10);
}

/* Weather panel */
.bp-current {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.bp-icon {
  font-size: 30px;
  line-height: 1;
}

.bp-current-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.bp-temp {
  font-size: 18px;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}

.bp-feel {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.45);
  line-height: 1;
}

.bp-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.60);
}

.bp-meta {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding-left: 14px;
  border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.bp-meta-item {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.55);
}

.bp-forecast {
  display: flex;
  gap: 8px;
  margin-left: auto;
}

.bp-forecast-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 4px 12px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

.bp-day-name {
  font-size: 10px;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.50);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.bp-day-icon {
  font-size: 16px;
}

.bp-day-temps {
  font-size: 10px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 500;
  white-space: nowrap;
}

/* AQI panel */
.aqi-panel {
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  border-left: 3px solid transparent;
}

/* Quote panel */
.quote-panel {
  justify-content: center;
  align-items: center;
  gap: 16px;
  text-align: center;
}

.quote-panel-mark {
  font-size: 48px;
  line-height: 1;
  color: rgba(255, 255, 255, 0.18);
  font-family: Georgia, serif;
  flex-shrink: 0;
  margin-top: -8px;
}

.quote-panel-body {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-width: 720px;
}

.quote-panel-text {
  font-size: 13px;
  font-style: italic;
  color: rgba(255, 255, 255, 0.82);
  line-height: 1.55;
  margin: 0;
}

.quote-panel-author {
  font-size: 11px;
  color: rgba(255, 255, 255, 0.45);
  letter-spacing: 0.4px;
}

.aqi-section-title {
  font-size: 9px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
}

.aqi-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.aqi-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
  transition: background 0.3s, box-shadow 0.3s;
}

.aqi-label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.aqi-badge {
  font-size: 11px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.08);
  letter-spacing: 0.3px;
}

[data-theme="dark"] .aqi-badge {
  background: rgba(255, 255, 255, 0.10);
}

.aqi-message {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.4;
  max-width: 340px;
}

.auth-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 30px;
  border-bottom: 2px solid var(--border-color);
  transition: all 0.3s ease;
}

.tab-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border-bottom: 3px solid transparent;
  transition: all 0.3s ease;
}

.tab-btn.active {
  color: var(--primary);
  border-bottom-color: var(--primary);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

/* Forms */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  margin-bottom: 8px;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 14px;
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background-color: rgba(255, 255, 255, 0.35);
  color: var(--text-primary);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.form-group input:hover,
.form-group textarea:hover,
.form-group select:hover {
  background-color: rgba(255, 255, 255, 0.45);
  border-color: var(--primary);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: translateY(-1px);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  background-color: rgba(255, 255, 255, 0.55);
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(30, 64, 175, 0.15);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  transform: translateY(-2px);
}

[data-theme="dark"] .form-group input,
[data-theme="dark"] .form-group textarea,
[data-theme="dark"] .form-group select {
  background-color: #1c1c20;
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color-scheme: dark;
}

.form-group textarea {
  resize: vertical;
  min-height: 100px;
}

.form-row {
  display: flex;
  gap: 20px;
  margin-bottom: 20px;
}

.form-row .form-group {
  flex: 1;
  margin-bottom: 0;
}

/* Buttons */
.btn {
  padding: 12px 24px;
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background-clip: padding-box;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn:active {
  transform: translateY(-1px) scale(0.97);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
  color: white;
  font-weight: 700;
  border-color: rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #2563eb 100%);
  box-shadow: 0 8px 24px rgba(37, 99, 235, 0.35);
  border-color: rgba(37, 99, 235, 0.4);
  transform: translateY(-2px);
}

.btn-primary:active {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.btn-secondary {
  background: rgba(200, 200, 200, 0.25);
  color: var(--text-primary);
  font-weight: 700;
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-secondary:hover {
  background: rgba(200, 200, 200, 0.35);
  color: var(--text-primary);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.5);
}

.btn-danger {
  background: linear-gradient(135deg, #dc2626 0%, #ef4444 100%);
  color: white;
  border-color: rgba(220, 38, 38, 0.3);
}

.btn-danger:hover {
  background: linear-gradient(135deg, #b91c1c 0%, #dc2626 100%);
  box-shadow: 0 8px 24px rgba(220, 38, 38, 0.35);
  border-color: rgba(220, 38, 38, 0.4);
  transform: translateY(-2px);
}

.btn-success {
  background: linear-gradient(135deg, #16a34a 0%, #22c55e 100%);
  color: white;
  border-color: rgba(22, 163, 74, 0.3);
}

.btn-success:hover {
  background: linear-gradient(135deg, rgba(52, 199, 89, 0.5) 0%, rgba(50, 215, 75, 0.4) 100%);
  box-shadow: 0 16px 40px rgba(52, 199, 89, 0.25), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-3px);
}

.btn-success:active {
  box-shadow: 0 4px 16px rgba(52, 199, 89, 0.3);
}

.btn-icon {
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.15);
  border: 1.5px solid rgba(255, 255, 255, 0.4);
  border-radius: 14px;
  font-size: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1), inset 0 1px 1px rgba(255, 255, 255, 0.4);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background-clip: padding-box;
}

.btn-icon:hover {
  background: rgba(255, 255, 255, 0.25);
  border-color: rgba(255, 255, 255, 0.5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.15), inset 0 1px 1px rgba(255, 255, 255, 0.5);
  transform: scale(1.1);
}

.btn-icon:active {
  transform: scale(0.95);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08), inset 0 1px 1px rgba(255, 255, 255, 0.3);
}

[data-theme="dark"] .btn-icon {
  background-color: rgba(255, 255, 255, 0.1);
}

/* Messages */
.message {
  margin-top: 15px;
  padding: 12px 16px;
  border-radius: 12px;
  text-align: center;
  font-size: 14px;
  font-weight: 500;
  display: none;
  animation: slideIn 0.2s ease;
}

.message.show {
  display: block;
}

.message.success {
  background-color: #e8f5e9;
  color: #1b5e20;
  border: 1px solid #c8e6c9;
}

.message.error {
  background-color: #ffebee;
  color: #b71c1c;
  border: 1px solid #ffcdd2;
}

[data-theme="dark"] .message.success {
  background-color: rgba(52, 199, 89, 0.2);
  color: #34C759;
  border: 1px solid rgba(52, 199, 89, 0.4);
}

[data-theme="dark"] .message.error {
  background-color: rgba(255, 59, 48, 0.2);
  color: #FF453A;
  border: 1px solid rgba(255, 59, 48, 0.4);
}

/* App Layout */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  background: var(--bg-secondary);
  transition: all 0.3s ease;
}

[data-theme="dark"] .app-container {
  background: #000000;
}

.navbar {
  background: var(--glass-nav);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
  color: var(--text-primary);
  padding: 16px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
  z-index: 100;
  border-bottom: 2px solid var(--primary);
  box-shadow: 0 4px 24px rgba(30, 64, 175, 0.09), 0 1px 3px rgba(0,0,0,0.06), var(--glass-inset);
  transition: all 0.3s ease;
}

[data-theme="dark"] .navbar {
  background: rgba(13, 17, 23, 0.88);
  border-bottom: 2px solid var(--primary);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4), 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(28px);
  -webkit-backdrop-filter: blur(28px);
}

.navbar-brand {
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.5px;
  color: var(--primary);
  background: linear-gradient(90deg, var(--primary) 0%, var(--accent) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.navbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}

.navbar-logo {
  height: 32px;
  width: 32px;
  object-fit: contain;
}

/* ── Language Switcher ── */
.lang-switcher {
  position: relative;
}
.lang-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  color: var(--text-primary);
  transition: background 0.2s;
  white-space: nowrap;
}
.lang-btn:hover {
  background: rgba(255,255,255,0.14);
}
.lang-menu {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  min-width: 150px;
  background: var(--card-bg, #1c1c1e);
  border: 1px solid var(--border-color, rgba(255,255,255,0.1));
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  z-index: 2000;
}
.lang-menu.open { display: block; }
.lang-menu button {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 100%;
  padding: 10px 16px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  transition: background 0.15s;
}
.lang-menu button:hover { background: rgba(255,255,255,0.07); }

/* Auth-page lang switcher (top-right, next to theme toggle) */
.lang-switcher-auth {
  position: absolute;
  top: 20px;
  right: 78px;
  z-index: 100;
}
.lang-switcher-auth .lang-btn {
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  padding: 12px 16px;
  font-size: 15px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}
.lang-switcher-auth .lang-btn:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.4);
}

.navbar-menu {
  display: flex;
  gap: 20px;
  align-items: center;
}

/* Navbar center: clock + weather */
.navbar-center {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  pointer-events: none;
}

.navbar-info-row {
  display: flex;
  align-items: stretch;
  gap: 0;
}

/* Each column in the navbar center */
.navbar-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 2px 0;
}

/* Time column */
#navbar-datetime {
  align-items: center;
}

#navbar-time {
  font-size: 12px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: 0.02em;
}

#navbar-date {
  font-size: 10px;
  color: var(--text-secondary);
}

.navbar-info-divider {
  width: 1px;
  background: var(--border-color);
  margin: 4px 10px;
  flex-shrink: 0;
}

/* Weather column */
.navbar-weather {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  font-size: 10px;
  color: var(--text-secondary);
}

#weather-icon {
  font-size: 14px;
  line-height: 1;
}

#weather-temp {
  font-weight: 600;
  color: var(--text-primary);
  font-size: 11px;
}

/* Navbar AQI (same look as login page) */
.navbar-aqi {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 2px 0 2px 10px;
  border-left: 3px solid transparent;
}

.navbar-aqi .aqi-section-title { font-size: 8px; letter-spacing: 0.5px; }
.navbar-aqi .aqi-dot           { width: 7px; height: 7px; }
.navbar-aqi .aqi-label         { font-size: 11px; }
.navbar-aqi .aqi-badge         { font-size: 9px; padding: 1px 6px; }
.navbar-aqi .aqi-message       { font-size: 9px; max-width: 220px; line-height: 1.3; }
.navbar-aqi .aqi-header        { gap: 5px; }

@media (max-width: 768px) {
  .navbar-center { display: none; }
}

/* Profile trigger button */
.profile-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 5px;
  border-radius: 20px;
  border: 1px solid transparent;
  background: transparent;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  transition: background 0.15s, border-color 0.15s;
}
.profile-trigger:hover {
  background: var(--bg-secondary);
  border-color: var(--border-color);
  color: var(--text-primary);
}
.profile-trigger-avatar {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}
.profile-trigger-initials {
  width: 28px; height: 28px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700; color: #fff;
  flex-shrink: 0;
}

/* Profile avatar hover overlay */
#profile-avatar-wrap:hover .profile-avatar-overlay { opacity: 1 !important; }


.main-container {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.sidebar {
  width: 220px;
  background: var(--glass-sidebar);
  border-right: 1px solid var(--glass-border);
  overflow-y: auto;
  padding: 20px 0;
  transition: all 0.3s ease;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  box-shadow: 2px 0 20px rgba(30, 64, 175, 0.08), 0 1px 3px rgba(0,0,0,0.05), inset -1px 0 0 rgba(255, 255, 255, 1);
}

[data-theme="dark"] .sidebar {
  background: rgba(22, 27, 34, 0.92);
  border-right: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 2px 0 20px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.side-menu {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
}

.menu-item {
  width: 100%;
  box-sizing: border-box;
  padding: 10px 16px;
  margin: 4px 0;
  background: none;
  border: none;
  border-radius: 10px;
  text-align: left;
  cursor: pointer;
  color: var(--text-secondary);
  font-weight: 700;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-item:hover {
  background: rgba(255, 255, 255, 0.11);
  -webkit-backdrop-filter: blur(10px) saturate(1.4);
  backdrop-filter: blur(10px) saturate(1.4);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    0 2px 10px rgba(0, 0, 0, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.35);
  color: var(--text-primary);
  transform: translateX(4px);
}

[data-theme="dark"] .menu-item:hover {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow:
    0 2px 12px rgba(0, 0, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.10);
  color: #ffffff;
}

.menu-item.active {
  background: rgba(255, 255, 255, 0.62);
  -webkit-backdrop-filter: blur(32px) saturate(2.2) brightness(1.08);
  backdrop-filter: blur(32px) saturate(2.2) brightness(1.08);
  border: 1px solid rgba(255, 255, 255, 0.80);
  box-shadow:
    0 6px 24px rgba(30, 64, 175, 0.18),
    0 2px 8px rgba(0, 0, 0, 0.10),
    inset 0 1.5px 0 rgba(255, 255, 255, 0.90),
    inset 0 -1px 0 rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
  font-weight: 700;
  transform: translateX(4px);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

[data-theme="dark"] .menu-item.active {
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.35),
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    inset 0 -1px 0 rgba(0, 0, 0, 0.2);
  color: #ffffff;
}

.menu-group {
  position: relative;
}

.menu-group.expanded .menu-parent::after {
  transform: rotate(180deg);
}

.submenu {
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.menu-group.expanded .submenu {
  max-height: 500px;
}

.menu-subitem {
  width: 100%;
  box-sizing: border-box;
  padding-left: 32px !important;
  padding-right: 16px !important;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.1);
}

.menu-subitem:hover {
  background-color: rgba(30, 64, 175, 0.15);
  color: var(--text-primary);
}

.menu-subitem.active {
  background-color: var(--primary);
  color: white;
}

.content {
  flex: 1;
  overflow-y: auto;
  padding: 30px 40px;
  background: var(--glass-content);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  transition: all 0.3s ease;
}

/* iOS-style view animations */
@keyframes slideInFromRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideOutToLeft {
  from {
    opacity: 1;
    transform: translateX(0);
  }
  to {
    opacity: 0;
    transform: translateX(-30px);
  }
}

.view {
  display: none;
  opacity: 0;
  transform: translateX(30px);
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
  will-change: opacity, transform;
}

.view.active {
  display: block;
  opacity: 1;
  transform: translateX(0);
  animation: slideInFromRight 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: auto;
}

.view.sliding-out {
  display: block;
  animation: slideOutToLeft 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

.view h2 {
  margin-bottom: 24px;
  color: var(--text-primary);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.view-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

/* Dashboard */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 16px;
  margin-bottom: 16px;
}

/* Dashboard sections */
.dash-section {
  margin-top: 24px;
}

.dash-section-title,
.dash-panel-title {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  color: var(--text-tertiary);
  margin-bottom: 12px;
}

.dash-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dash-action-btn {
  padding: 9px 16px;
  border-radius: 10px;
  border: 1px solid var(--border-color);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 1px 3px var(--shadow-color);
}

.dash-action-btn:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 12px rgba(78, 115, 223, 0.35);
  transform: translateY(-1px);
}

.dash-two-col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-top: 20px;
}

.dash-panel {
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  border-radius: 14px;
  padding: 18px 20px;
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.08), 0 1px 4px rgba(0,0,0,0.06), var(--glass-inset);
  box-sizing: border-box;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .dash-panel {
  background: rgba(255,255,255,0.06);
  border-color: rgba(255,255,255,0.10);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
}

/* Progress bar */
.dash-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.dash-progress-track {
  height: 10px;
  background: var(--gray-2);
  border-radius: 99px;
  overflow: hidden;
}

.dash-progress-bar {
  height: 100%;
  background: linear-gradient(90deg, #1cc88a, #17a673);
  border-radius: 99px;
  transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.dash-mini-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.dash-mini-value {
  font-size: 22px;
  font-weight: 700;
  line-height: 1;
}

.dash-mini-label {
  font-size: 10px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-tertiary);
}

/* Low stock & pending lists */
.dash-list-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 13px;
  gap: 8px;
  transition: background 0.15s;
}

.dash-list-item:hover {
  background: var(--gray-2);
}

[data-theme="dark"] .dash-list-item:hover {
  background: rgba(255,255,255,0.05);
}

.dash-list-item-name {
  flex: 1;
  color: var(--text-primary);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dash-badge-red {
  background: rgba(231, 74, 59, 0.12);
  color: #e74a3b;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
  margin-left: 6px;
}

.dash-badge-warn {
  background: rgba(246, 194, 62, 0.15);
  color: #d97706;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}

.dash-badge-ok {
  background: rgba(28, 200, 138, 0.12);
  color: #1cc88a;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 99px;
}

.dash-empty {
  font-size: 13px;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 4px 0;
}

/* Recent confirmations */
.dash-confirm-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 13px;
  transition: background 0.15s;
}

.dash-confirm-item:hover {
  background: var(--gray-2);
}

[data-theme="dark"] .dash-confirm-item:hover {
  background: rgba(255,255,255,0.05);
}

.dash-confirm-avatar {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #5a7dec);
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.dash-confirm-name {
  flex: 1;
  font-weight: 500;
  color: var(--text-primary);
}

.dash-confirm-date {
  font-size: 11px;
  color: var(--text-tertiary);
}

@media (max-width: 768px) {
  .dash-two-col { grid-template-columns: 1fr; }
}

.dash-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-radius: 12px;
  background: var(--glass-card);
  border: 1px solid var(--glass-border);
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.07), 0 1px 4px rgba(0,0,0,0.05), var(--glass-inset);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
}

.dash-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.07), var(--glass-inset);
  background: var(--glass-card-hover);
}

.dash-card:active {
  transform: scale(0.98);
}

[data-theme="dark"] .dash-card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
}

[data-theme="dark"] .dash-card:hover {
  background: rgba(255, 255, 255, 0.10);
  box-shadow: 0 8px 32px rgba(0,0,0,0.45), inset 0 1px 0 rgba(255,255,255,0.08);
}

.dash-card-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}

.dash-card-body {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.dash-card-label {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-secondary);
  opacity: 0.65;
}

.dash-card-value {
  font-size: 26px;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.1;
  letter-spacing: -0.5px;
}

.stat-card {
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.07) 0%, rgba(255, 255, 255, 0.88) 100%);
  padding: 24px;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.08), 0 1px 4px rgba(0,0,0,0.06), var(--glass-inset);
  text-align: center;
  border: 1px solid var(--glass-border);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.stat-card:hover {
  box-shadow: 0 8px 28px rgba(30, 64, 175, 0.14), var(--glass-inset);
  transform: translateY(-2px);
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.10) 0%, rgba(255, 255, 255, 0.98) 100%);
  border-color: var(--primary-light);
}

.stat-number {
  transition: color 0.3s ease;
}

#accounting-charts .stat-card {
  opacity: 0;
  transform: translateY(20px);
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

#accounting-charts .stat-card.visible {
  opacity: 1;
  transform: translateY(0);
}

#accounting-charts .stat-card:nth-child(1) { transition-delay: 0s; }
#accounting-charts .stat-card:nth-child(2) { transition-delay: 0.15s; }
#accounting-charts .stat-card:nth-child(3) { transition-delay: 0.3s; }

[data-theme="dark"] .stat-card {
  background: linear-gradient(135deg, rgba(96, 165, 250, 0.10) 0%, rgba(22, 27, 34, 0.90) 100%);
  border: 1px solid rgba(96, 165, 250, 0.25);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.stat-card h3 {
  color: var(--text-secondary);
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
}

.stat-number {
  font-size: 36px;
  font-weight: 800;
  color: var(--primary);
}

/* Tables */
.table-container {
  background: var(--glass-card);
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.08), 0 1px 4px rgba(0,0,0,0.06), var(--glass-inset);
  overflow: hidden;
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.3s ease;
}

[data-theme="dark"] .table-container {
  background: rgba(22, 27, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead {
  background-color: var(--gray-1);
  border-bottom: 1px solid var(--gray-2);
}

.data-table th {
  padding: 16px 20px;
  text-align: left;
  font-weight: 700;
  color: var(--text-primary);
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.data-table td {
  padding: 14px 20px;
  border-bottom: 1px solid var(--border-color);
  font-size: 14px;
  color: var(--text-primary);
  background: transparent;
  transition: background 0.15s ease;
  font-weight: 500;
}

.data-table tbody tr:hover {
  background-color: var(--gray-2);
}

.data-table tfoot {
  display: table-footer-group;
}

.data-table tfoot tr {
  border-top: 2px solid var(--text-secondary);
  background-color: rgba(255, 255, 255, 0.05);
}

.data-table tfoot td {
  padding: 16px;
  font-weight: 700;
  color: var(--text-primary);
}

[data-theme="dark"] .data-table thead {
  background-color: rgba(45, 45, 48, 0.6);
}

[data-theme="dark"] .data-table tfoot tr {
  background-color: rgba(45, 45, 48, 0.3);
}

/* Cards */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 9px;
  margin-top: 14px;
}

.card {
  position: relative;
  background: var(--glass-card);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.07), 0 1px 4px rgba(0,0,0,0.05), var(--glass-inset);
  border: 1px solid var(--glass-border);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  overflow: hidden;
  cursor: default;
  user-select: none;
}

.card-header {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 15px;
}

.card:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.10), 0 2px 6px rgba(0, 0, 0, 0.06), var(--glass-inset);
  transform: translateY(-1px);
  background: var(--glass-card-hover);
}

[data-theme="dark"] .card {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.06);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

[data-theme="dark"] .card:hover {
  background: rgba(255, 255, 255, 0.08);
}

#classes-list,
#groups-list {
  grid-template-columns: 1fr 1fr;
  gap: 9px 295px;
  align-items: start;
  max-width: 900px;
}

.card-inner {
  display: flex;
  align-items: stretch;
}

.card-left {
  flex: 0 0 100%;
}

.card.expanded {
  grid-column: 1 / -1;
}

.card.expanded .card-left {
  flex: 0 0 auto;
  min-width: 220px;
  max-width: 320px;
}

.card.expanded .card-header {
  border-bottom: none;
  border-right: 1px solid rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .card.expanded .card-header {
  border-right-color: rgba(255, 255, 255, 0.06);
}

/* Floating drawer panel for classes & groups */
#classes-list .card,
#groups-list .card {
  overflow: visible;
}

#classes-list .card.expanded,
#groups-list .card.expanded {
  grid-column: auto;
  z-index: 10;
}

#classes-list .card.expanded .card-left,
#groups-list .card.expanded .card-left {
  flex: 0 0 100%;
  min-width: unset;
  max-width: unset;
}

#classes-list .card.expanded .card-header,
#groups-list .card.expanded .card-header {
  border-right: none;
}

#classes-list .card-drawer,
#groups-list .card-drawer {
  position: absolute;
  left: calc(100% + 10px);
  top: 0;
  width: 0;
  opacity: 0;
  background: var(--bg-primary);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-radius: 12px;
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 32px var(--shadow-color-lg);
  max-height: 320px;
  overflow-y: auto;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
}

[data-theme="dark"] #classes-list .card-drawer,
[data-theme="dark"] #groups-list .card-drawer {
  background: rgba(30, 34, 46, 0.92);
  border-color: rgba(255, 255, 255, 0.08);
}

#classes-list .card.expanded .card-drawer,
#groups-list .card.expanded .card-drawer {
  width: 280px;
  opacity: 1;
}

#classes-list .card-drawer-inner,
#groups-list .card-drawer-inner {
  min-width: 280px;
  padding: 12px 14px;
}

.card-icon {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 700;
  flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #5a7dec);
  color: #fff;
  letter-spacing: -0.5px;
}

[data-theme="dark"] .card-icon {
  background: linear-gradient(135deg, rgba(78, 115, 223, 0.6), rgba(90, 125, 236, 0.4));
}

.card-body {
  flex: 1;
  min-width: 0;
}

.card-body h3 {
  margin: 0;
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-body .card-meta {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 2px;
  opacity: 0.7;
}

.card-actions {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.card-actions .card-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  transition: all 0.15s ease;
  background: rgba(0, 0, 0, 0.05);
  color: var(--text-secondary);
}

[data-theme="dark"] .card-actions .card-btn {
  background: rgba(255, 255, 255, 0.06);
}

.card-actions .card-btn:hover {
  background: rgba(78, 115, 223, 0.15);
  color: var(--primary);
}

.card-actions .card-btn.delete:hover {
  background: rgba(231, 74, 59, 0.15);
  color: #e74a3b;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 16px;
  padding: 8px 0;
}

.page-btn {
  min-width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.82);
  background: rgba(255, 255, 255, 0.65);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: var(--glass-inset);
}

.page-btn:hover:not(:disabled):not(.active) {
  background: rgba(78, 115, 223, 0.15);
  color: var(--primary);
  border-color: rgba(78, 115, 223, 0.3);
}

.page-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

.page-btn:disabled {
  opacity: 0.3;
  cursor: default;
}

[data-theme="dark"] .page-btn {
  border-color: rgba(255, 255, 255, 0.08);
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: none;
}

/* Card expand drawer */
.card-drawer {
  width: 0;
  overflow: hidden;
  transition: width 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  opacity: 0;
}

.card.expanded .card-drawer {
  width: var(--drawer-width, 400px);
  opacity: 1;
  min-width: 0;
  overflow-y: auto;
}

.card-drawer-inner {
  padding: 10px 16px 14px;
  min-width: var(--drawer-width, 400px);
}

.card-drawer-inner .drawer-title {
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--text-tertiary);
  margin-bottom: 8px;
}

.card-student-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.card-student-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.03);
  transition: background 0.15s ease;
}

.card-student-item:hover {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .card-student-item {
  background: rgba(255, 255, 255, 0.03);
}

[data-theme="dark"] .card-student-item:hover {
  background: rgba(255, 255, 255, 0.06);
}

.card-student-avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #5a7dec);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.card-student-name {
  font-size: 12px;
  color: var(--text-primary);
  flex: 1;
}

.card-student-badge {
  font-size: 9px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.card-student-badge.new {
  background: rgba(28, 200, 138, 0.15);
  color: #1cc88a;
}

.card-student-badge.old {
  background: rgba(78, 115, 223, 0.15);
  color: var(--primary);
}

.card-empty-msg {
  font-size: 11px;
  color: var(--text-tertiary);
  font-style: italic;
  padding: 4px 0;
}

.card-hint {
  font-size: 10px;
  color: var(--text-secondary);
  opacity: 0;
  transition: opacity 0.2s ease;
  margin-left: 4px;
}

.card:hover .card-hint {
  opacity: 0.4;
}

/* Accounting sticky summary */
#accounting-charts {
  position: sticky;
  bottom: 0;
  z-index: 10;
  padding: 16px 0 0;
  margin-top: 0 !important;
  background: linear-gradient(to bottom, transparent, var(--bg-secondary) 16px);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
}

/* Accounting table sticky header */
#accounting-books-container .data-table thead {
  position: sticky;
  top: 0;
  z-index: 5;
}

#accounting-books-container .data-table thead th {
  background: var(--gray-1);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  box-shadow: 0 1px 0 var(--border-color);
  padding: 10px 12px;
  font-size: 11px;
  line-height: 1.1;
  letter-spacing: 0.35px;
  white-space: nowrap;
}

[data-theme="dark"] #accounting-books-container .data-table thead th {
  background: rgba(30, 30, 34, 0.92);
}

#accounting-books-container .data-table td {
  padding: 10px 12px;
  font-size: 13px;
}

#accounting-books-container .data-table thead th:nth-child(6) {
  white-space: normal;
  min-width: 92px;
}

#accounting-books-container .data-table thead th:nth-child(10),
#accounting-books-container .data-table td:nth-child(10) {
  white-space: nowrap;
}

/* Modals */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.25);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  animation: fadeIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.modal.show {
  display: flex;
  justify-content: center;
  align-items: center;
}

[data-theme="dark"] .modal {
  background-color: rgba(0, 0, 0, 0.6);
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.modal-content {
  background: rgba(255, 255, 255, 0.60);
  padding: 36px;
  border-radius: 24px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(30, 64, 175, 0.12), 0 2px 8px rgba(0,0,0,0.07), var(--glass-inset);
  animation: slideIn 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1.5px solid rgba(255, 255, 255, 0.70);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(48px) saturate(2);
  -webkit-backdrop-filter: blur(48px) saturate(2);
  background-clip: padding-box;
  will-change: transform, opacity;
}

[data-theme="dark"] .modal-content {
  background: rgba(22, 27, 34, 0.60);
  border-color: rgba(255, 255, 255, 0.15);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5), inset 0 1px 0 rgba(255,255,255,0.10);
  backdrop-filter: blur(48px) saturate(1.6);
  -webkit-backdrop-filter: blur(48px) saturate(1.6);
}

@keyframes slideIn {
  from {
    transform: translateY(20px) scale(0.95);
    opacity: 0;
  }
  to {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateY(0) scale(1);
    opacity: 1;
  }
  to {
    transform: translateY(16px) scale(0.97);
    opacity: 0;
  }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

.modal.closing {
  display: flex;
  justify-content: center;
  align-items: center;
  animation: fadeOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  pointer-events: none;
}

.modal.closing .modal-content {
  animation: slideOut 0.25s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.close {
  float: right;
  font-size: 28px;
  font-weight: 300;
  color: var(--text-tertiary);
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
}

.close:hover {
  color: var(--text-primary);
}

.modal-content h2 {
  margin-bottom: 24px;
  font-size: 20px;
  font-weight: 700;
  color: var(--text-primary);
}

.form-actions {
  display: flex;
  gap: 12px;
  justify-content: flex-end;
  margin-top: 28px;
}

/* Filters and Search */
.assignments-filters {
  display: flex;
  gap: 16px;
  margin-bottom: 24px;
  flex-wrap: wrap;
  align-items: center;
}

.assignments-filters input,
.assignments-filters select {
  padding: 10px 14px;
  border: 1px solid var(--gray-3);
  border-radius: 12px;
  font-size: 14px;
  background-color: var(--gray-1);
  color: var(--text-primary);
  transition: all 0.2s ease;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

.assignments-filters input:hover,
.assignments-filters select:hover {
  border-color: var(--primary);
  background-color: white;
}

.assignments-filters input:focus,
.assignments-filters select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

/* Reports */
.reports-container {
  display: grid;
  grid-template-columns: 1fr;
  gap: 30px;
}

.report-filters {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.filter-group {
  flex: 0 1 calc(25% - 15px);
  min-width: 200px;
}

.filter-group label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 8px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-group select {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  transition: all 0.2s ease;
}

.filter-group select:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.60);
}

.filter-group select:focus {
  outline: none;
  border-color: var(--primary);
  background-color: white;
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

[data-theme="dark"] .filter-group select {
  background: rgba(45, 45, 48, 0.40);
  border-color: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

[data-theme="dark"] .filter-group select:hover {
  background: rgba(45, 45, 48, 0.50);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .filter-group select:focus {
  border-color: var(--primary);
  background: rgba(45, 45, 48, 0.60);
  box-shadow: 0 0 0 3px rgba(0, 122, 255, 0.1);
}

.filter-group .custom-multiselect {
  position: relative;
}

.filter-group .multiselect-input {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.55);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.2s ease;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.filter-group .multiselect-input:hover {
  border-color: rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.60);
}

.filter-group .multiselect-input.active {
  border-color: var(--primary);
  background-color: white;
}

[data-theme="dark"] .filter-group .multiselect-input {
  background: rgba(45, 45, 48, 0.40);
  border-color: rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .filter-group .multiselect-input:hover {
  background: rgba(45, 45, 48, 0.50);
  border-color: rgba(255, 255, 255, 0.12);
}

[data-theme="dark"] .filter-group .multiselect-input.active {
  background: rgba(45, 45, 48, 0.60);
  border-color: var(--primary);
}

.filter-group .multiselect-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.95);
  border: 2px solid rgba(0, 0, 0, 0.1);
  border-radius: 10px;
  max-height: 200px;
  overflow-y: auto;
  z-index: 100;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  margin-top: 8px;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.filter-group .multiselect-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

[data-theme="dark"] .filter-group .multiselect-dropdown {
  background: rgba(28, 28, 32, 0.97);
  border-color: rgba(255, 255, 255, 0.12);
}

.filter-group .multiselect-option {
  padding: 10px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  transition: background 0.15s ease;
  user-select: none;
  -webkit-user-select: none;
}

.filter-group .multiselect-option:hover {
  background: rgba(0, 122, 255, 0.1);
}

.filter-group .multiselect-option label {
  flex: 1;
  margin: 0;
  padding: 0;
  cursor: pointer;
  text-transform: none;
  letter-spacing: normal;
  font-size: 14px;
  font-weight: 500;
}

.filter-group .multiselect-option input[type="checkbox"] {
  cursor: pointer;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  accent-color: var(--primary);
}

@media (max-width: 768px) {
  .report-filters {
    flex-direction: column;
    gap: 12px;
  }

  .filter-group {
    flex: 1 1 100%;
    min-width: auto;
  }
}

.report-section {
  background: var(--glass-card);
  padding: 28px;
  border-radius: 16px;
  box-shadow: 0 4px 16px rgba(30, 64, 175, 0.08), 0 1px 4px rgba(0,0,0,0.05), var(--glass-inset);
  border: 1px solid var(--glass-border);
  transition: all 0.2s ease;
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.report-section:hover {
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.10), var(--glass-inset);
  background: var(--glass-card-hover);
}

[data-theme="dark"] .report-section {
  background: rgba(22, 27, 34, 0.88);
  border: 1px solid rgba(255, 255, 255, 0.10);
  box-shadow: 0 4px 20px rgba(0,0,0,0.35), inset 0 1px 0 rgba(255,255,255,0.05);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.report-section h3 {
  margin-bottom: 20px;
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 18px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.2px;
  transition: all 0.2s ease;
}

.status-badge.pending {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

.status-badge.completed {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-badge.new {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.status-badge.old {
  background-color: #fff3cd;
  color: #856404;
  border: 1px solid #ffeaa7;
}

[data-theme="dark"] .status-badge.pending {
  background-color: rgba(255, 193, 7, 0.2);
  color: #FFC107;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

[data-theme="dark"] .status-badge.completed {
  background-color: rgba(52, 199, 89, 0.2);
  color: #34C759;
  border: 1px solid rgba(52, 199, 89, 0.4);
}

[data-theme="dark"] .status-badge.new {
  background-color: rgba(52, 199, 89, 0.2);
  color: #34C759;
  border: 1px solid rgba(52, 199, 89, 0.4);
}

[data-theme="dark"] .status-badge.old {
  background-color: rgba(255, 193, 7, 0.2);
  color: #FFC107;
  border: 1px solid rgba(255, 193, 7, 0.4);
}

/* Custom Select (single-value) */
.custom-sel {
  position: relative;
  width: 100%;
}

.custom-sel-trigger {
  width: 100%;
  padding: 12px;
  border: 2px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  font-size: 14px;
  font-family: inherit;
  background-color: rgba(255, 255, 255, 0.35);
  color: var(--text-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  user-select: none;
  box-sizing: border-box;
}

.custom-sel-trigger:hover {
  background-color: rgba(255, 255, 255, 0.55);
  border-color: var(--primary);
  transform: translateY(-1px);
}

[data-theme="dark"] .custom-sel-trigger {
  background-color: #1c1c20;
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

[data-theme="dark"] .custom-sel-trigger:hover {
  background-color: #25252a;
  border-color: var(--primary);
}

.custom-sel-arrow {
  font-size: 11px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
  flex-shrink: 0;
  margin-left: 8px;
}

.custom-sel.open .custom-sel-arrow {
  transform: rotate(180deg);
}

.custom-sel-list {
  display: none;
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.97);
  border: 1.5px solid rgba(200, 200, 200, 0.6);
  border-radius: 12px;
  max-height: 220px;
  overflow-y: auto;
  z-index: 2000;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  padding: 4px;
}

.custom-sel.open .custom-sel-list {
  display: block;
}

[data-theme="dark"] .custom-sel-list {
  background: rgba(28, 28, 32, 0.97);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.custom-sel-option {
  padding: 10px 12px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: background 0.15s ease;
}

.custom-sel-option:hover {
  background: rgba(30, 64, 175, 0.1);
}

.custom-sel-option.selected {
  background: var(--primary);
  color: white;
}

[data-theme="dark"] .custom-sel-option {
  color: #ffffff;
}

[data-theme="dark"] .custom-sel-option:hover {
  background: rgba(96, 165, 250, 0.15);
}

[data-theme="dark"] .custom-sel-option.selected {
  background: var(--primary);
  color: white;
}

/* Custom Multi-Select Dropdown */
.custom-multiselect {
  position: relative;
  display: inline-block;
  width: 100%;
}

.multiselect-input {
  width: 100%;
  padding: 12px;
  border: 2px solid var(--border-color);
  border-radius: 12px;
  background-color: var(--bg-primary);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
  transition: all 0.2s ease;
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 500;
}

.multiselect-input:hover {
  border-color: var(--primary);
  background-color: var(--bg-primary);
}

.multiselect-input.active {
  border-color: var(--primary);
  background-color: var(--bg-primary);
}

.dropdown-arrow {
  font-size: 11px;
  color: var(--text-secondary);
  transition: transform 0.2s ease;
}

.multiselect-input.active .dropdown-arrow {
  transform: rotate(180deg);
}

.multiselect-dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: rgba(255, 255, 255, 0.94);
  border: 1.5px solid var(--glass-border);
  border-top: none;
  border-radius: 0 0 16px 16px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.10), var(--glass-inset);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
  background-clip: padding-box;
}

[data-theme="dark"] .multiselect-dropdown {
  background: rgba(28, 28, 32, 0.97);
  border-color: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(30px);
  -webkit-backdrop-filter: blur(30px);
}

.multiselect-dropdown.active {
  display: block;
}

.multiselect-option {
  padding: 12px 16px;
  display: flex;
  align-items: center;
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.multiselect-option:hover {
  background-color: rgba(30, 64, 175, 0.15);
  border-radius: 8px;
  margin: 0 8px;
  padding: 12px 8px;
}

.multiselect-option input[type="checkbox"] {
  margin-right: 12px;
  cursor: pointer;
  width: 16px;
  height: 16px;
}

.multiselect-option label {
  cursor: pointer;
  margin: 0;
  flex: 1;
  font-weight: 600;
  font-size: 14px;
  color: var(--text-primary);
}

#book-classes-display, #book-groups-display {
  flex: 1;
  color: var(--text-secondary);
}

@media (max-width: 768px) {
  .main-container {
    flex-direction: column;
  }

  .sidebar {
    width: 100%;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--gray-2);
  }

  .side-menu {
    flex-direction: row;
    overflow-x: auto;
    padding: 0 12px;
  }

  .menu-item {
    white-space: nowrap;
    flex-shrink: 0;
  }

  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }

  .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }

  .card-grid-responsive {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .auth-box {
    margin: 20px;
    border-radius: 20px;
  }

  .view-header {
    flex-direction: column;
    gap: 16px;
  }

  .view-header .btn {
    width: 100%;
  }

  .content {
    padding: 24px 20px;
  }
}

@media (max-width: 480px) {
  .navbar {
    padding: 12px 16px;
  }

  .navbar-brand {
    font-size: 16px;
  }

  .navbar-menu {
    gap: 12px;
  }

  .sidebar {
    padding: 12px 0;
  }

  .menu-item {
    padding: 8px 12px;
    font-size: 13px;
  }

  .dashboard-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .dashboard-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .stat-card {
    padding: 16px;
  }

  .stat-number {
    font-size: 24px;
  }

  .data-table {
    font-size: 12px;
  }

  .data-table th,
  .data-table td {
    padding: 10px 12px;
  }

  .modal-content {
    width: 95%;
    padding: 24px;
    border-radius: 20px;
  }

  .auth-box {
    padding: 24px 20px;
  }

  .content {
    padding: 16px;
  }

  .assignments-filters {
    flex-direction: column;
    gap: 12px;
  }

  .assignments-filters input,
  .assignments-filters select {
    width: 100%;
  }
}

/* iOS-style Glassmorphic Alert / Confirm */
.ios-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.3);
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}

.ios-overlay.show {
  opacity: 1;
}

.ios-dialog {
  width: 280px;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.72);
  -webkit-backdrop-filter: blur(40px) saturate(180%);
  backdrop-filter: blur(40px) saturate(180%);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 0 0 0.5px rgba(255, 255, 255, 0.3) inset;
  transform: scale(0.85);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.ios-overlay.show .ios-dialog {
  transform: scale(1);
}

[data-theme="dark"] .ios-dialog {
  background: rgba(44, 44, 46, 0.72);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 0 0 0.5px rgba(255, 255, 255, 0.08) inset;
}

.ios-dialog-body {
  padding: 20px 16px 16px;
  text-align: center;
}

.ios-dialog-title {
  font-size: 17px;
  font-weight: 600;
  color: #000;
  margin-bottom: 4px;
  letter-spacing: -0.2px;
}

[data-theme="dark"] .ios-dialog-title {
  color: #fff;
}

.ios-dialog-message {
  font-size: 13px;
  color: rgba(0, 0, 0, 0.56);
  line-height: 1.4;
  margin-top: 2px;
}

[data-theme="dark"] .ios-dialog-message {
  color: rgba(255, 255, 255, 0.56);
}

.ios-dialog-actions {
  display: flex;
  border-top: 0.5px solid rgba(60, 60, 67, 0.12);
}

[data-theme="dark"] .ios-dialog-actions {
  border-top-color: rgba(255, 255, 255, 0.1);
}

.ios-dialog-btn {
  flex: 1;
  padding: 12px 8px;
  border: none;
  background: transparent;
  font-size: 17px;
  cursor: pointer;
  transition: background 0.15s ease;
  color: #007aff;
  letter-spacing: -0.2px;
}

.ios-dialog-btn:active {
  background: rgba(0, 0, 0, 0.06);
}

[data-theme="dark"] .ios-dialog-btn:active {
  background: rgba(255, 255, 255, 0.06);
}

.ios-dialog-btn.primary {
  font-weight: 600;
}

.ios-dialog-btn.destructive {
  color: #ff3b30;
}

.ios-dialog-btn + .ios-dialog-btn {
  border-left: 0.5px solid rgba(60, 60, 67, 0.12);
}

[data-theme="dark"] .ios-dialog-btn + .ios-dialog-btn {
  border-left-color: rgba(255, 255, 255, 0.1);
}

/* ── Chat Widget ─────────────────────────────────────────── */
.chat-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e40af, #7c3aed);
  border: none;
  font-size: 22px;
  cursor: pointer;
  z-index: 1100;
  box-shadow: 0 4px 20px rgba(30,64,175,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s, box-shadow 0.2s;
}
.chat-fab:hover { transform: scale(1.1); box-shadow: 0 6px 28px rgba(30,64,175,0.55); }

.chat-fab-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #e74a3b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  border: 2px solid var(--bg-primary);
}

.chat-panel {
  position: fixed;
  bottom: 94px;
  right: 28px;
  width: 340px;
  height: 480px;
  border-radius: 18px;
  background: var(--glass-modal);
  -webkit-backdrop-filter: blur(28px) saturate(1.8);
  backdrop-filter: blur(28px) saturate(1.8);
  border: 1px solid var(--glass-border);
  box-shadow: 0 20px 60px rgba(0,0,0,0.2), inset 0 1px 0 rgba(255,255,255,0.6);
  display: flex;
  flex-direction: column;
  z-index: 1099;
  overflow: hidden;
  transform: scale(0.92) translateY(16px);
  opacity: 0;
  pointer-events: none;
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.22s;
}
.chat-panel.open {
  transform: scale(1) translateY(0);
  opacity: 1;
  pointer-events: all;
}
[data-theme="dark"] .chat-panel {
  background: rgba(22, 27, 34, 0.94);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow: 0 20px 60px rgba(0,0,0,0.5), inset 0 1px 0 rgba(255,255,255,0.08);
}

.chat-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.06);
  flex-shrink: 0;
}
.chat-header-info {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  font-size: 15px;
  color: var(--text-primary);
}
.chat-user-picker {
  max-width: 130px;
  background: rgba(255,255,255,0.14);
  border: 1px solid var(--glass-border);
  border-radius: 10px;
  color: var(--text-primary);
  font-size: 12px;
  padding: 6px 8px;
  outline: none;
}
[data-theme="dark"] .chat-user-picker {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.16);
  color: #ffffff;
}
[data-theme="dark"] .chat-user-picker option {
  background: #161b22;
  color: #ffffff;
}
.chat-online-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #1cc88a;
  box-shadow: 0 0 5px #1cc88a;
  flex-shrink: 0;
}
.chat-header-actions { display: flex; gap: 6px; }
.chat-icon-btn {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  width: 30px;
  height: 30px;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-primary);
  transition: background 0.15s;
}
.chat-icon-btn:hover { background: rgba(255,255,255,0.2); }
[data-theme="dark"] .chat-icon-btn {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.16);
  color: #ffffff;
}
[data-theme="dark"] .chat-icon-btn:hover { background: rgba(255,255,255,0.14); }

.chat-contacts {
  position: absolute;
  inset: 0;
  background: var(--glass-modal);
  -webkit-backdrop-filter: blur(28px);
  backdrop-filter: blur(28px);
  z-index: 10;
  display: flex;
  flex-direction: column;
  border-radius: 18px;
  overflow: hidden;
}
[data-theme="dark"] .chat-contacts {
  background: rgba(22, 27, 34, 0.96);
}
.chat-contacts-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  font-weight: 700;
  font-size: 14px;
  border-bottom: 1px solid var(--glass-border);
  color: var(--text-primary);
}
.chat-contact-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  cursor: pointer;
  transition: background 0.15s;
  position: relative;
}
.chat-contact-item:hover { background: rgba(255,255,255,0.08); }
[data-theme="dark"] .chat-contact-item:hover { background: rgba(255,255,255,0.06); }
.chat-contact-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e40af, #7c3aed);
  color: #fff;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.chat-contact-name { flex: 1; font-size: 14px; color: var(--text-primary); }
.chat-unread-badge {
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  background: #e74a3b;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  margin-left: auto;
}

.chat-messages {
  flex: 1;
  overflow-y: auto;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  scrollbar-width: thin;
}
.chat-empty {
  text-align: center;
  color: var(--text-secondary);
  font-size: 13px;
  margin: auto;
  padding: 20px;
}
.chat-msg {
  display: flex;
  flex-direction: column;
  max-width: 78%;
}
.chat-msg.mine { align-self: flex-end; align-items: flex-end; }
.chat-msg.theirs { align-self: flex-start; align-items: flex-start; }
.chat-msg-author { font-size: 11px; color: var(--text-secondary); margin-bottom: 2px; }
.chat-bubble {
  padding: 8px 12px;
  border-radius: 14px;
  font-size: 13px;
  line-height: 1.45;
  word-break: break-word;
}
.chat-msg.mine .chat-bubble {
  background: linear-gradient(135deg, #1e40af, #7c3aed);
  color: #fff;
  border-bottom-right-radius: 4px;
}
.chat-msg.theirs .chat-bubble {
  background: rgba(255,255,255,0.14);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  border-bottom-left-radius: 4px;
}
[data-theme="dark"] .chat-msg.theirs .chat-bubble {
  background: rgba(255,255,255,0.10);
  border-color: rgba(255,255,255,0.14);
  color: #f3f6fb;
}
.chat-msg-time { font-size: 10px; color: var(--text-secondary); margin-top: 2px; }

.chat-input-row {
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  border-top: 1px solid var(--glass-border);
  background: rgba(255,255,255,0.04);
  flex-shrink: 0;
}
[data-theme="dark"] .chat-input-row {
  background: rgba(255,255,255,0.03);
  border-top-color: rgba(255,255,255,0.12);
}
.chat-input {
  flex: 1;
  background: rgba(255,255,255,0.12);
  border: 1px solid var(--glass-border);
  border-radius: 20px;
  padding: 8px 14px;
  font-size: 13px;
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.2s;
}
.chat-input:focus { border-color: #1e40af; }
[data-theme="dark"] .chat-input { background: rgba(255,255,255,0.07); }
[data-theme="dark"] .chat-input {
  border-color: rgba(255,255,255,0.16);
  color: #ffffff;
}
[data-theme="dark"] .chat-input::placeholder {
  color: rgba(255,255,255,0.58);
}
.chat-send-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #1e40af, #7c3aed);
  border: none;
  color: #fff;
  font-size: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.15s;
}
.chat-send-btn:hover { transform: scale(1.1); }

/* Toast notifications */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  color: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  transform: translateX(120%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
  opacity: 0;
  pointer-events: auto;
  max-width: 320px;
}

.toast.show {
  transform: translateX(0);
  opacity: 1;
}

.toast.success { background: linear-gradient(135deg, #16a34a, #22c55e); }
.toast.error   { background: linear-gradient(135deg, #dc2626, #ef4444); }
.toast.info    { background: linear-gradient(135deg, #2563eb, #3b82f6); }
.toast.warning { background: linear-gradient(135deg, #d97706, #f59e0b); }

/* View toolbar: search + export row */
.view-toolbar {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 16px;
}

.view-toolbar .search-input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: rgba(255, 255, 255, 0.55);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

[data-theme="dark"] .view-toolbar .search-input {
  background: #1c1c20;
  border-color: rgba(255, 255, 255, 0.12);
  color: #ffffff;
}

[data-theme="dark"] .view-toolbar .search-input::placeholder {
  color: rgba(255, 255, 255, 0.4);
}

.view-toolbar .search-input:focus {
  border-color: var(--primary);
}

.history-titles {
  max-width: 260px;
  font-size: 12px;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Permission toggles */
.perm-toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  width: 100%;
  height: 46px;
  padding: 0 12px;
  background: rgba(255,255,255,0.05);
  border-radius: 10px;
  cursor: pointer;
  box-sizing: border-box;
}
.perm-toggle > span:first-child {
  font-size: 13px;
  color: var(--text-primary);
}
.toggle-switch {
  position: relative;
  width: 52px;
  height: 28px;
  flex-shrink: 0;
  display: inline-block;
}
.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}
.toggle-track {
  position: absolute;
  inset: 0;
  border-radius: 14px;
  background: #e53935 !important;
  transition: background 0.25s ease;
  cursor: pointer;
}
.toggle-switch input:checked ~ .toggle-track {
  background: #34c759 !important;
}
.toggle-track::after {
  content: '';
  position: absolute;
  left: 3px;
  top: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.4);
  transition: transform 0.25s ease;
}
.toggle-switch input:checked ~ .toggle-track::after {
  transform: translateX(24px);
}

/* ── Table Row Stagger Entrance ──────────────────────────────────────────────── */
@keyframes rowFadeIn {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.data-table tbody tr {
  animation: rowFadeIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) both;
}

.data-table tbody tr:nth-child(1)  { animation-delay: 0.02s; }
.data-table tbody tr:nth-child(2)  { animation-delay: 0.04s; }
.data-table tbody tr:nth-child(3)  { animation-delay: 0.06s; }
.data-table tbody tr:nth-child(4)  { animation-delay: 0.08s; }
.data-table tbody tr:nth-child(5)  { animation-delay: 0.10s; }
.data-table tbody tr:nth-child(6)  { animation-delay: 0.12s; }
.data-table tbody tr:nth-child(7)  { animation-delay: 0.14s; }
.data-table tbody tr:nth-child(8)  { animation-delay: 0.16s; }
.data-table tbody tr:nth-child(9)  { animation-delay: 0.18s; }
.data-table tbody tr:nth-child(10) { animation-delay: 0.20s; }
.data-table tbody tr:nth-child(n+11) { animation-delay: 0.22s; }

.data-table tbody tr:hover {
  background: rgba(30, 64, 175, 0.04);
  transition: background 0.2s ease;
}

[data-theme="dark"] .data-table tbody tr:hover {
  background: rgba(255, 255, 255, 0.03);
}

/* ── Skeleton Loading Shimmer ────────────────────────────────────────────────── */
@keyframes shimmer {
  0%   { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.skeleton {
  background: linear-gradient(90deg,
    rgba(200, 200, 200, 0.2) 25%,
    rgba(200, 200, 200, 0.4) 50%,
    rgba(200, 200, 200, 0.2) 75%
  );
  background-size: 200% 100%;
  animation: shimmer 1.5s ease-in-out infinite;
  border-radius: 8px;
  min-height: 18px;
}

[data-theme="dark"] .skeleton {
  background: linear-gradient(90deg,
    rgba(255, 255, 255, 0.04) 25%,
    rgba(255, 255, 255, 0.10) 50%,
    rgba(255, 255, 255, 0.04) 75%
  );
  background-size: 200% 100%;
}

/* ── Dashboard Card Entrance ─────────────────────────────────────────────────── */
@keyframes cardPop {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.96);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

.dash-card,
.dashboard-grid > * {
  animation: cardPop 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

.dashboard-grid > *:nth-child(1) { animation-delay: 0.05s; }
.dashboard-grid > *:nth-child(2) { animation-delay: 0.10s; }
.dashboard-grid > *:nth-child(3) { animation-delay: 0.15s; }
.dashboard-grid > *:nth-child(4) { animation-delay: 0.20s; }
.dashboard-grid > *:nth-child(5) { animation-delay: 0.25s; }

/* ── Smooth Focus Ring ───────────────────────────────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
  border-radius: 4px;
  transition: outline-offset 0.15s ease;
}

/* ── Card Hover Lift ─────────────────────────────────────────────────────────── */
.card {
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1),
              box-shadow 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.card:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 32px rgba(30, 64, 175, 0.12), 0 4px 12px rgba(0, 0, 0, 0.06);
}

/* ── Toast Exit Animation ────────────────────────────────────────────────────── */
.toast.hide {
  transform: translateX(120%) scale(0.9);
  opacity: 0;
}

/* ── Smooth Scrollbar ────────────────────────────────────────────────────────── */
.content::-webkit-scrollbar,
.modal-content::-webkit-scrollbar {
  width: 6px;
}

.content::-webkit-scrollbar-track,
.modal-content::-webkit-scrollbar-track {
  background: transparent;
}

.content::-webkit-scrollbar-thumb,
.modal-content::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

.content::-webkit-scrollbar-thumb:hover,
.modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.22);
}

[data-theme="dark"] .content::-webkit-scrollbar-thumb,
[data-theme="dark"] .modal-content::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.10);
}

[data-theme="dark"] .content::-webkit-scrollbar-thumb:hover,
[data-theme="dark"] .modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.20);
}

/* ── Status Badge Pulse (overdue / low stock) ────────────────────────────────── */
@keyframes subtlePulse {
  0%, 100% { opacity: 1; }
  50%      { opacity: 0.7; }
}

.status-overdue {
  animation: subtlePulse 2s ease-in-out infinite;
}

/* ── iOS Dialog Backdrop Transition ──────────────────────────────────────────── */
.ios-dialog-overlay {
  transition: opacity 0.25s ease, backdrop-filter 0.25s ease;
}

.ios-dialog-overlay.closing {
  opacity: 0 !important;
  pointer-events: none;
}
