:root, body.theme-dark {
  --bg-color: #080d16;
  --bg-gradient: linear-gradient(135deg, #080d16 0%, #101c30 100%);
  --surface-color: rgba(15, 23, 42, 0.7);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --accent-color: #3b82f6;
  --accent-hover: #2563eb;
  --danger-color: #ef4444;
  --input-bg: rgba(8, 13, 22, 0.6);
  --input-border: rgba(255, 255, 255, 0.15);
  --input-focus: rgba(59, 130, 246, 0.5);
  
  --font-family: 'Inter', system-ui, -apple-system, sans-serif;
}

body.theme-light {
  --bg-color: #f1f5f9;
  --bg-gradient: linear-gradient(135deg, #f1f5f9 0%, #e2e8f0 100%);
  --surface-color: rgba(255, 255, 255, 0.8);
  --surface-border: rgba(15, 23, 42, 0.1);
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --accent-color: #2563eb;
  --accent-hover: #1d4ed8;
  --input-bg: rgba(255, 255, 255, 0.9);
  --input-border: rgba(15, 23, 42, 0.2);
  --input-focus: rgba(37, 99, 235, 0.4);
}

body.theme-slate {
  --bg-color: #0b0f19;
  --bg-gradient: linear-gradient(135deg, #0b0f19 0%, #111827 100%);
  --surface-color: rgba(17, 24, 39, 0.75);
  --surface-border: rgba(255, 255, 255, 0.08);
  --text-primary: #f9fafb;
  --text-secondary: #9ca3af;
  --accent-color: #6366f1;
  --accent-hover: #4f46e5;
  --input-bg: rgba(17, 24, 39, 0.6);
  --input-border: rgba(255, 255, 255, 0.15);
  --input-focus: rgba(99, 102, 241, 0.5);
}

/* Base structural adjustments for Theme Adaptations */
body.theme-light .sidebar {
  background: rgba(255, 255, 255, 0.95);
  border-right: 1px solid var(--surface-border);
}
body.theme-light .top-bar {
  background: rgba(255, 255, 255, 0.95);
}
body.theme-light .top-bar-links a:hover {
  background: rgba(15, 23, 42, 0.05);
}
body.theme-light .nav-item:hover {
  background: rgba(15, 23, 42, 0.05);
}
body.theme-light .btn-secondary {
  color: var(--text-primary);
}
body.theme-light .data-table th {
  background: rgba(15, 23, 42, 0.03);
}
body.theme-light .data-table tr:hover td {
  background: rgba(15, 23, 42, 0.02);
}
body.theme-light .switch-container {
  background: rgba(0, 0, 0, 0.02);
  border-color: rgba(0, 0, 0, 0.06);
}
body.theme-light .switch-container:hover {
  background: rgba(0, 0, 0, 0.04);
}

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

body {
  font-family: var(--font-family);
  background: var(--bg-gradient);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  position: relative;
}

/* Background Decorations */
.bg-shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  z-index: 0;
}

.shape-1 {
  width: 400px;
  height: 400px;
  background: rgba(59, 130, 246, 0.2);
  top: -100px;
  left: -100px;
}

.shape-2 {
  width: 500px;
  height: 500px;
  background: rgba(139, 92, 246, 0.15);
  bottom: -200px;
  right: -100px;
}

/* Container Wrapper */
#app-container {
  width: 100%;
  height: 100vh;
  position: relative;
  z-index: 1;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Glassmorphism Card */
.glass-card {
  background: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: 24px;
  padding: 24px;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
  width: 100%;
  transform: translateY(0);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

#login-view.glass-card {
  max-width: 420px;
  padding: 40px;
}

/* Login View */
#login-view {
  display: none;
}

#login-view.hidden {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.95);
  position: absolute;
}

.brand-header {
  text-align: center;
  margin-bottom: 16px;
}

.brand-icon {
  font-size: 48px;
  margin-bottom: 16px;
  color: var(--accent-color);
}

.brand-title {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
}

.brand-subtitle {
  font-size: 14px;
  color: var(--text-secondary);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.form-label {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  padding: 14px 16px;
  color: var(--text-primary);
  font-family: var(--font-family);
  font-size: 15px;
  transition: all 0.2s ease;
  outline: none;
}

.form-input:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 4px var(--input-focus);
}

.form-input::placeholder {
  color: #64748b;
}

.btn-primary {
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 12px;
  padding: 14px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 100%;
  margin-top: 8px;
}

.btn-primary:hover {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(59, 130, 246, 0.5);
}

.btn-primary:active {
  transform: translateY(0);
}

/* Dashboard View */
#dashboard-view {
  display: none;
  width: 100vw;
  height: 100vh;
  opacity: 0;
  pointer-events: none;
  position: relative;
}

#dashboard-view.active {
  opacity: 1;
  pointer-events: all;
  transform: scale(1);
}

.sidebar {
  width: 280px;
  background: rgba(15, 23, 42, 0.8);
  backdrop-filter: blur(20px);
  border-right: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  padding: 24px 0;
}

.sidebar-header {
  padding: 0 24px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 12px;
}

.sidebar-header .brand-icon {
  font-size: 28px;
  margin: 0;
}

.sidebar-header .brand-title {
  font-size: 18px;
  margin: 0;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 0 12px;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: 12px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--accent-color);
  color: white;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: rgba(15, 23, 42, 0.4);
}

.topbar {
  height: 80px;
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 32px;
  backdrop-filter: blur(10px);
}

.workspace {
  flex: 1;
  padding: 32px;
  overflow-y: auto;
  width: 100%;
}

.workspace-header {
  margin-bottom: 32px;
  max-width: 100%;
}

.workspace-title {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 8px;
}

.workspace-subtitle {
  color: var(--text-secondary);
}

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
}

.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 12px;
  margin-bottom: 12px;
  text-align: center;
  font-weight: 600;
  color: var(--text-secondary);
  font-size: 14px;
}

.calendar-day {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  min-height: 100px;
  padding: 12px;
  transition: all 0.2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.calendar-day:hover {
  border-color: var(--accent-color);
  background: rgba(30, 41, 59, 0.9);
}

.calendar-day.empty {
  background: transparent;
  border-color: transparent;
  cursor: default;
}

.calendar-day.today {
  border-color: var(--accent-color);
  box-shadow: inset 0 0 0 1px var(--accent-color);
}

.day-number {
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}

/* Event Types */
.event-badge {
  font-size: 11px;
  padding: 4px 6px;
  border-radius: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-weight: 500;
}

.event-wizytacja { background: rgba(139, 92, 246, 0.2); border-left: 2px solid #8b5cf6; color: #ddd6fe; }
.event-rada { background: rgba(59, 130, 246, 0.2); border-left: 2px solid #3b82f6; color: #bfdbfe; }
.event-alarm { background: rgba(239, 68, 68, 0.2); border-left: 2px solid #ef4444; color: #fecaca; }
.event-spotkanie { background: rgba(245, 158, 11, 0.2); border-left: 2px solid #f59e0b; color: #fde68a; }
.event-dokumenty { background: rgba(16, 185, 129, 0.2); border-left: 2px solid #10b981; color: #a7f3d0; }
.event-notatka { background: rgba(100, 116, 139, 0.3); border-left: 2px solid #94a3b8; color: #e2e8f0; }

/* Modals */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 1;
  transition: all 0.3s;
}

.modal-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.modal-content {
  width: 100%;
  max-width: 500px;
  transform: translateY(0);
}

.modal-overlay.hidden .modal-content {
  transform: translateY(20px);
}

/* Secondary Button */
.btn-secondary {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--surface-border);
  border-radius: 12px;
  padding: 10px 16px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
}

/* Utility classes */
.hidden-step {
  display: none !important;
}

.hidden-workspace {
  display: none !important;
}

.active-workspace {
  display: block !important;
}

/* Staff Grid */
/* TOP BAR STYLES */
.top-bar {
  height: 60px;
  background: rgba(15, 23, 42, 0.9);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--surface-border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
}

.top-bar-left .app-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--accent-color);
  display: flex;
  align-items: center;
  gap: 10px;
}

.top-bar-links {
  display: flex;
  gap: 20px;
  margin: 0 40px;
}

.top-bar-links a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 13px;
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s;
  padding: 6px 12px;
  border-radius: 8px;
}

.top-bar-links a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 24px;
}

.quick-stats {
  display: flex;
  gap: 16px;
}

.quick-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: help;
}

.quick-stats .count {
  background: var(--accent-color);
  color: white;
  padding: 2px 6px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-initials {
  width: 32px;
  height: 32px;
  background: var(--accent-color);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
}

.user-name {
  font-size: 14px;
  font-weight: 500;
}

/* DATA TABLE ENHANCEMENTS */
.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table th {
  background: rgba(255, 255, 255, 0.03);
  padding: 14px 20px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border-bottom: 1px solid var(--surface-border);
}

.data-table td {
  padding: 14px 20px;
  font-size: 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  vertical-align: middle;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.02);
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 600;
}

.status-pill.success { background: rgba(16, 185, 129, 0.15); color: #10b981; }
.status-pill.warning { background: rgba(245, 158, 11, 0.15); color: #f59e0b; }
.status-pill.danger { background: rgba(239, 68, 68, 0.15); color: #ef4444; }
.status-pill.info { background: rgba(59, 130, 246, 0.15); color: #3b82f6; }

/* REVISED APP STRUCTURE */
.app-container {
  display: flex;
  flex-direction: column;
  height: 100vh;
  width: 100vw;
  overflow: hidden;
}

#dashboard-view {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.dashboard-body {
  display: flex;
  flex: 1;
  overflow: hidden;
  width: 100%;
  position: relative;
}

.sidebar {
  width: 280px;
  background: var(--sidebar-bg);
  backdrop-filter: blur(20px);
  border-left: 1px solid var(--surface-border);
  display: flex;
  flex-direction: column;
  transition: all 0.3s ease;
  z-index: 100;
  flex-shrink: 0;
}

.main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 30px;
}

/* SEARCH BOX */
.search-box {
  position: relative;
}

.search-box i {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
  font-size: 14px;
  pointer-events: none;
}

.search-box input {
  padding-left: 36px !important;
}

/* SCROLLBARS */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: rgba(255, 255, 255, 0.1);
  border-radius: 10px;
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(255, 255, 255, 0.2);
}

.staff-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.staff-card {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  transition: all 0.2s ease;
}

.staff-card:hover {
  transform: translateY(-4px);
  border-color: var(--surface-border);
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.5);
}

.staff-header {
  display: flex;
  gap: 16px;
  align-items: center;
}

.staff-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(15, 23, 42, 0.8);
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 18px;
  font-weight: 600;
  color: white;
  border: 2px solid var(--surface-border);
}

.staff-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
  font-weight: 600;
}

.staff-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

.staff-status {
  display: inline-block;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.status-active { background: rgba(16, 185, 129, 0.15); color: #34d399; }
.status-l4 { background: rgba(239, 68, 68, 0.15); color: #f87171; }
.status-urlop { background: rgba(245, 158, 11, 0.15); color: #fbbf24; }

.staff-actions {
  display: flex;
  gap: 8px;
  margin-top: auto;
  border-top: 1px solid var(--surface-border);
  padding-top: 16px;
}

.staff-actions button {
  flex: 1;
  padding: 6px 0;
  font-size: 12px;
}

/* Schedule Table */
.schedule-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 800px;
}

.schedule-table th {
  padding: 16px;
  text-align: left;
  border-bottom: 2px solid var(--surface-border);
  color: var(--text-secondary);
  font-weight: 600;
  font-size: 14px;
}

.schedule-table td {
  padding: 12px;
  border-bottom: 1px solid var(--surface-border);
  vertical-align: top;
}

.time-col {
  width: 120px;
  font-weight: 500;
  color: var(--text-secondary);
  font-size: 13px;
  padding-top: 20px !important;
}

.lesson-cell {
  background: var(--surface-color);
  border: 1px solid var(--surface-border);
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: pointer;
}

.lesson-cell:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.lesson-cell small {
  display: block;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
  font-weight: 400;
}

/* Lesson Colors */
.lesson-math { border-left: 3px solid #ef4444; }
.lesson-pol { border-left: 3px solid #3b82f6; }
.lesson-eng { border-left: 3px solid #10b981; }
.lesson-wf { border-left: 3px solid #f59e0b; }
.lesson-hist { border-left: 3px solid #8b5cf6; }
.lesson-geo { border-left: 3px solid #06b6d4; }
.lesson-phys { border-left: 3px solid #ec4899; }
.lesson-bio { border-left: 3px solid #84cc16; }
.lesson-inf { border-left: 3px solid #6366f1; }

/* Editable Cell */
.editable-cell {
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: 8px;
  padding: 12px;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.2s ease;
  cursor: text;
  color: var(--text-primary);
  min-height: 48px;
  white-space: pre-wrap;
  outline: none;
}

.editable-cell:hover {
  background: rgba(15, 23, 42, 0.8);
  border-color: var(--surface-border);
}

.editable-cell:focus {
  border-color: var(--accent-color);
  box-shadow: 0 0 0 2px var(--input-focus);
  background: var(--surface-color);
}

/* Documents Grid */
.documents-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 24px;
}

.doc-card {
  padding: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.doc-card:hover {
  transform: translateY(-4px);
  border-color: var(--accent-color);
  background: rgba(30, 41, 59, 0.9);
}

.doc-icon {
  font-size: 32px;
}

.doc-info h3 {
  font-size: 16px;
  margin-bottom: 4px;
}

.doc-info p {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Settings Grid */
.settings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
  gap: 24px;
  align-items: start;
}

.setting-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--surface-border);
}

.setting-toggle:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Toggle Switch Styles */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.slider {
  position: absolute;
  cursor: pointer;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(255, 255, 255, 0.1);
  transition: .4s;
  border: 1px solid var(--surface-border);
}

.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: var(--text-secondary);
  transition: .4s;
}

input:checked + .slider {
  background-color: var(--accent-color);
  border-color: var(--accent-color);
}

input:focus + .slider {
  box-shadow: 0 0 1px var(--accent-color);
}

input:checked + .slider:before {
  transform: translateX(20px);
  background-color: white;
}

.slider.round {
  border-radius: 24px;
}

.slider.round:before {
  border-radius: 50%;
}
/* Staff Tabs Styling */
.staff-tabs {
  display: flex;
  gap: 12px;
  margin-bottom: 32px;
  border-bottom: 1px solid var(--surface-border);
  padding-bottom: 0;
}

.staff-tab {
  background: transparent;
  border: none;
  color: var(--text-secondary);
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
  position: relative;
  border-radius: 12px 12px 0 0;
}

.staff-tab:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.05);
}

.staff-tab.active {
  color: var(--accent-color);
}

.staff-tab.active::after {
  content: "";
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--accent-color);
  border-radius: 3px 3px 0 0;
  box-shadow: 0 -4px 10px rgba(59, 130, 246, 0.5);
}

.staff-tab .tab-icon {
  font-size: 18px;
}

.staff-folder.hidden {
  display: none !important;
}

.school-wide-table {
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--surface-border);
}

.school-wide-table th {
  background: var(--surface-secondary) !important;
  color: var(--accent-primary) !important;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-bottom: 2px solid var(--accent-primary) !important;
}

.school-wide-table td {
  border-right: 1px solid rgba(255,255,255,0.05);
  border-bottom: 1px solid rgba(255,255,255,0.05);
  transition: background 0.2s;
}

.school-wide-table tr:hover td {
  background: rgba(255,255,255,0.02);
}

.staff-folder {
  animation: fadeIn 0.4s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- PRINT STYLES --- */
@media print {
  body {
    background: white !important;
    color: black !important;
  }
  .sidebar, .topbar, .inventory-controls, #btn-add-inventory, #btn-inventory-rollover, #btn-inventory-pdf, .btn-delete-inv {
    display: none !important;
  }
  .main-content {
    margin-left: 0 !important;
    padding: 0 !important;
    width: 100% !important;
  }
  .workspace {
    display: none !important;
  }
  #view-inventory.active-workspace, #view-inventory:not(.hidden-workspace) {
    display: block !important;
  }
  .glass-card {
    border: none !important;
    background: none !important;
    box-shadow: none !important;
    padding: 0 !important;
  }
  .schedule-table {
    width: 100% !important;
    border-collapse: collapse !important;
  }
  .schedule-table th, .schedule-table td {
    border: 1px solid #ddd !important;
    padding: 8px !important;
    color: black !important;
    font-size: 10pt !important;
  }
  .schedule-table th {
    background: #f5f5f5 !important;
  }
  .workspace-header {
    text-align: center;
    margin-bottom: 30px;
    border-bottom: 2px solid black;
    padding-bottom: 10px;
  }
  .workspace-title {
    color: black !important;
    font-size: 24pt !important;
  }
  .print-only {
    display: block !important;
  }
  /* Footer for signatures */
  #inventory-tbody::after {
    content: "Podpis Dyrektora: _______________________      Podpis Komisji: _______________________";
    display: block;
    margin-top: 50px;
    font-size: 10pt;
    white-space: pre;
  }
}

/* ==========================================
   PREMIUM E-DZIENNIK STYLES
   ========================================== */

/* Role Buttons */
.btn-role {
  padding: 8px 16px;
  font-size: 13px;
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--surface-border);
  background: rgba(255, 255, 255, 0.03);
  color: var(--text-secondary);
  cursor: pointer;
}

.btn-role:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
  border-color: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}

.btn-role.active {
  background: rgba(59, 130, 246, 0.15);
  border-color: var(--accent-color);
  color: white;
  box-shadow: 0 0 15px rgba(59, 130, 246, 0.3);
}

/* KPI Cards */
.edziennik-stats-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-bottom: 24px;
}

.edziennik-kpi-card {
  background: var(--surface-color);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  position: relative;
  overflow: hidden;
  transition: all 0.3s ease;
}

.edziennik-kpi-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 4px;
}

.edziennik-kpi-card.kpi-average::before { background: linear-gradient(90deg, #3b82f6, #6366f1); }
.edziennik-kpi-card.kpi-attendance::before { background: linear-gradient(90deg, #10b981, #34d399); }
.edziennik-kpi-card.kpi-threats::before { background: linear-gradient(90deg, #ef4444, #f43f5e); }
.edziennik-kpi-card.kpi-stripes::before { background: linear-gradient(90deg, #f59e0b, #eab308); }

.edziennik-kpi-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(0, 0, 0, 0.4);
  border-color: rgba(255, 255, 255, 0.15);
}

.kpi-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-secondary);
}

.kpi-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--text-primary);
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.kpi-desc {
  font-size: 12px;
  color: var(--text-secondary);
}

/* Oceny - Grade Badge Capsules */
.grade-badge-capsule {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  height: 28px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  margin-right: 4px;
  margin-bottom: 4px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: help;
  transition: all 0.2s ease;
  position: relative;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.3);
}

.grade-badge-capsule:hover {
  transform: scale(1.15) translateY(-2px);
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  z-index: 10;
}

/* Red Stripe and Warning Badges */
.student-name-container {
  display: flex;
  align-items: center;
  gap: 8px;
}

.stripe-badge {
  background: linear-gradient(180deg, #ffffff 50%, #e11d48 50%);
  border: 1px solid rgba(0,0,0,0.2);
  width: 24px;
  height: 14px;
  border-radius: 3px;
  box-shadow: 0 2px 4px rgba(0,0,0,0.2);
  display: inline-block;
  vertical-align: middle;
}

.threat-pulse {
  background: rgba(239, 68, 68, 0.2);
  border: 1px solid #ef4444;
  color: #ef4444;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  animation: pulseRed 2s infinite ease-in-out;
}

@keyframes pulseRed {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.4); }
  50% { transform: scale(1.03); box-shadow: 0 0 8px 2px rgba(239, 68, 68, 0.2); }
  100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); }
}

/* SMARTPHONE SIMULATOR */
.phone-simulator-wrapper {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 40px;
  align-items: start;
}

.phone-frame {
  width: 350px;
  height: 680px;
  background: #090d16;
  border: 12px solid #1e293b;
  border-radius: 44px;
  box-shadow: 0 30px 60px -15px rgba(0, 0, 0, 0.8), 
              inset 0 0 25px rgba(255, 255, 255, 0.05);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  margin: 0 auto;
  border-top-width: 14px;
  border-bottom-width: 14px;
}

.phone-notch {
  width: 130px;
  height: 22px;
  background: #1e293b;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: center;
}

.phone-notch::after {
  content: '';
  width: 50px;
  height: 4px;
  background: #090d16;
  border-radius: 2px;
}

.phone-screen {
  flex: 1;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #090d16 0%, #111827 100%);
  color: #f8fafc;
  overflow: hidden;
  position: relative;
}

.phone-status-bar {
  height: 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 18px 24px 0 24px;
  font-size: 11px;
  font-weight: 600;
  color: rgba(248, 250, 252, 0.8);
  z-index: 99;
}

.phone-status-right {
  display: flex;
  gap: 6px;
  align-items: center;
}

.phone-app-header {
  padding: 12px 18px;
  background: rgba(17, 24, 39, 0.8);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 98;
}

.phone-app-title {
  font-size: 16px;
  font-weight: 700;
  background: linear-gradient(90deg, #3b82f6, #8b5cf6);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.phone-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  padding-bottom: 70px; /* space for nav */
}

/* Mobile Cards */
.phone-card {
  background: rgba(255, 255, 255, 0.03);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

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

/* Phone bottom navigation */
.phone-bottom-nav {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgba(17, 24, 39, 0.95);
  backdrop-filter: blur(15px);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 99;
  padding-bottom: 8px;
}

.phone-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-secondary);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  width: 60px;
  height: 100%;
}

.phone-nav-item i {
  font-size: 18px;
  margin-bottom: 3px;
}

.phone-nav-item.active {
  color: var(--accent-color);
}

/* Chat container inside phone */
.phone-chat-box {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.phone-chat-messages {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 8px 4px;
}

.phone-msg-bubble {
  max-width: 80%;
  padding: 10px 14px;
  border-radius: 16px;
  font-size: 12.5px;
  line-height: 1.4;
  word-wrap: break-word;
}

.phone-msg-bubble.sent {
  align-self: flex-end;
  background: #2563eb;
  color: white;
  border-bottom-right-radius: 4px;
}

.phone-msg-bubble.received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.08);
  color: #f8fafc;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.phone-chat-input-row {
  display: flex;
  gap: 8px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  margin: 8px -16px -16px -16px;
  border-bottom-left-radius: 16px;
  border-bottom-right-radius: 16px;
}

.phone-chat-input {
  flex: 1;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  padding: 8px 12px;
  color: white;
  font-size: 12px;
  outline: none;
}

.phone-chat-send-btn {
  background: var(--accent-color);
  color: white;
  border: none;
  border-radius: 12px;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.phone-chat-send-btn:hover {
  background: var(--accent-hover);
}

/* Detail view modal for grading */
.grading-detail-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.grades-summary-scroller {
  max-height: 250px;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.2);
  padding: 12px;
  border-radius: 12px;
  border: 1px solid var(--surface-border);
}

.excuse-absence-btn {
  padding: 4px 8px;
  font-size: 10px;
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.2s;
}

.excuse-absence-btn:hover {
  background: #10b981;
  color: white;
}

.excused-text {
  font-size: 10px;
  font-weight: 700;
  color: #10b981;
  background: rgba(16, 185, 129, 0.08);
  padding: 2px 6px;
  border-radius: 4px;
}

/* Custom switch for attendance toggle */
.attendance-switch-group {
  display: flex;
  gap: 4px;
}

.attendance-opt {
  padding: 6px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 6px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: all 0.2s;
  background: rgba(255,255,255,0.02);
  color: var(--text-secondary);
}

.attendance-opt.opt-present:hover, .attendance-opt.opt-present.active {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

.attendance-opt.opt-absent:hover, .attendance-opt.opt-absent.active {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}

.attendance-opt.opt-late:hover, .attendance-opt.opt-late.active {
  background: rgba(245, 158, 11, 0.15);
  color: #f59e0b;
  border-color: rgba(245, 158, 11, 0.3);
}

/* Progress circle chart mock */
.progress-circle-wrapper {
  position: relative;
  width: 90px;
  height: 90px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}

.progress-circle-value {
  font-size: 18px;
  font-weight: 800;
  color: #10b981;
}

/* ── DYNAMIC NAVIGATION BAR LAYOUTS ───────────────────────────── */
.dashboard-body.nav-left {
  flex-direction: row-reverse;
}

.dashboard-body.nav-right {
  flex-direction: row;
}

.dashboard-body.nav-right .sidebar {
  border-left: 1px solid var(--surface-border);
  border-right: none;
}

.dashboard-body.nav-top {
  flex-direction: column-reverse;
}

.dashboard-body.nav-top .sidebar {
  width: 100%;
  height: auto;
  border-right: none;
  border-bottom: 1px solid var(--surface-border);
  flex-direction: row;
  padding: 8px 32px;
  align-items: center;
  justify-content: space-between;
}

.dashboard-body.nav-top .sidebar .sidebar-header {
  margin-bottom: 0;
  padding: 0;
}

.dashboard-body.nav-top .sidebar .nav-menu {
  flex-direction: row;
  gap: 8px;
  padding: 0;
}

.dashboard-body.nav-top .sidebar .nav-item {
  padding: 8px 14px;
  font-size: 13px;
}

/* ── SUB-DASHBOARD INNER SIDEBAR STYLING ───────────────────────── */
.sub-dashboard-body {
  display: flex;
  gap: 24px;
  width: 100%;
}

.sub-dashboard-body.nav-left {
  flex-direction: row-reverse;
}

.sub-dashboard-body.nav-right {
  flex-direction: row;
}

.sub-dashboard-body.nav-top {
  flex-direction: column-reverse;
}

.sub-sidebar {
  width: 240px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  padding: 16px 12px;
  flex-shrink: 0;
  height: max-content;
}

.sub-nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.sub-nav-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  color: var(--text-secondary);
  text-decoration: none;
  font-weight: 600;
  font-size: 13px;
  border-radius: 10px;
  transition: all 0.2s ease;
}

.sub-nav-item:hover, .sub-nav-item.active {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.04);
}

.sub-nav-item.active {
  background: var(--accent-color) !important;
  color: white !important;
  box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.sub-main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* Sub-dashboard nav-top overrides */
.sub-dashboard-body.nav-top .sub-sidebar {
  width: 100%;
  flex-direction: row;
  padding: 8px 16px;
  align-items: center;
  justify-content: flex-start;
  gap: 16px;
}

.sub-dashboard-body.nav-top .sub-nav-menu {
  flex-direction: row;
  gap: 8px;
}

.sub-dashboard-body.nav-top .sub-nav-item {
  padding: 8px 14px;
}

.hidden {
  display: none !important;
}

/* ==========================================
   📚 PREMIUM LIBRARY & MOBILE SCANNER STYLES
   ========================================== */

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

.book-cover-cell {
  width: 44px;
  height: 58px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.3);
  transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  background: #1e293b;
  display: inline-block;
  vertical-align: middle;
}
.book-cover-cell:hover {
  transform: scale(1.25) rotate(2deg);
  box-shadow: 0 8px 16px rgba(0,0,0,0.5);
  z-index: 10;
}

.scanner-container {
  position: relative;
  width: 100%;
  height: 280px;
  background: #020617;
  border-radius: 20px;
  overflow: hidden;
  border: 2px solid rgba(255, 255, 255, 0.05);
  box-shadow: inset 0 0 30px rgba(0,0,0,0.9);
}

.scanner-laser {
  position: absolute;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, transparent, #ef4444, transparent);
  box-shadow: 0 0 10px #ef4444, 0 0 20px #ef4444;
  animation: scanLine 2.5s infinite ease-in-out;
  z-index: 10;
}
.scanner-laser.ocr-mode {
  background: linear-gradient(90deg, transparent, #10b981, transparent);
  box-shadow: 0 0 10px #10b981, 0 0 20px #10b981;
}

@keyframes scanLine {
  0% { top: 10%; }
  50% { top: 90%; }
  100% { top: 10%; }
}

.scanner-corner {
  position: absolute;
  width: 24px;
  height: 24px;
  border: 4px solid #ef4444;
  z-index: 12;
  transition: border-color 0.3s;
}
.scanner-corner.ocr-mode {
  border-color: #10b981;
}
.scanner-corner-tl { top: 24px; left: 24px; border-right: none; border-bottom: none; border-top-left-radius: 8px; }
.scanner-corner-tr { top: 24px; right: 24px; border-left: none; border-bottom: none; border-top-right-radius: 8px; }
.scanner-corner-bl { bottom: 24px; left: 24px; border-right: none; border-top: none; border-bottom-left-radius: 8px; }
.scanner-corner-br { bottom: 24px; right: 24px; border-left: none; border-top: none; border-bottom-right-radius: 8px; }

.scanner-target-box {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 170px;
  height: 170px;
  border: 1px dashed rgba(255, 255, 255, 0.25);
  border-radius: 12px;
  z-index: 5;
  box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.55);
}
.scanner-target-box.ocr-mode {
  width: 220px;
  height: 140px;
}

.scanner-overlay-status {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  background: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  padding: 6px 16px;
  border-radius: 20px;
  font-size: 11px;
  font-weight: 700;
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
  display: flex;
  align-items: center;
  gap: 6px;
  z-index: 15;
  white-space: nowrap;
  letter-spacing: 0.5px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  transition: all 0.3s;
}
.scanner-overlay-status.ocr-mode {
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}

.sample-books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 12px;
  max-height: 380px;
  overflow-y: auto;
  padding-right: 6px;
}
.sample-book-card {
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
  border-radius: 12px;
  padding: 8px;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.sample-book-card:hover {
  background: rgba(59, 130, 246, 0.08);
  border-color: rgba(59, 130, 246, 0.3);
  transform: translateY(-4px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
}
.sample-book-cover {
  width: 70px;
  height: 96px;
  object-fit: cover;
  border-radius: 6px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.4);
  border: 1px solid rgba(255, 255, 255, 0.12);
  transition: transform 0.25s ease;
  background: #1e293b;
}
.sample-book-card:hover .sample-book-cover {
  transform: scale(1.06);
}
.sample-book-title {
  font-size: 11px;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  height: 28px;
}
.sample-book-author {
  font-size: 9.5px;
  color: var(--text-secondary);
  margin: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%;
}

.scanned-item-card-preview {
  display: flex;
  gap: 16px;
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.05);
  border-radius: 12px;
  padding: 12px;
  margin-top: 10px;
}
.scanned-preview-cover {
  width: 60px;
  height: 82px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 4px 8px rgba(0,0,0,0.3);
  border: 1px solid rgba(255,255,255,0.1);
  background: #1e293b;
}
.scanned-preview-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 4px;
}

/* ==========================================
   🏫 PREMIUM DZIENNIK / PLAN LEKCJI STYLES
   ========================================== */

/* Glowing Active Lesson */
.glowing-active-lesson {
  position: relative;
  border: 1px solid #3b82f6 !important;
  box-shadow: 0 0 12px rgba(59, 130, 246, 0.4) !important;
  animation: pulseActiveBorder 2s infinite ease-in-out;
}

@keyframes pulseActiveBorder {
  0% { box-shadow: 0 0 12px rgba(59, 130, 246, 0.4); border-color: rgba(59, 130, 246, 0.6); }
  50% { box-shadow: 0 0 20px rgba(59, 130, 246, 0.8); border-color: rgba(59, 130, 246, 1); }
  100% { box-shadow: 0 0 12px rgba(59, 130, 246, 0.4); border-color: rgba(59, 130, 246, 0.6); }
}

.pulsing-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background-color: #3b82f6;
  border-radius: 50%;
  margin-right: 6px;
  box-shadow: 0 0 8px #3b82f6;
  animation: pulseDot 1.5s infinite ease-in-out;
}

@keyframes pulseDot {
  0% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.5; }
  100% { transform: scale(1); opacity: 1; }
}

/* Topic Status Badges */
.badge-topic-status {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  font-size: 11px;
  font-weight: 700;
  border-radius: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  border: 1px solid transparent;
}
.badge-topic-filled {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border-color: rgba(16, 185, 129, 0.3);
}
.badge-topic-missing {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border-color: rgba(239, 68, 68, 0.3);
}
.badge-topic-in-progress {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border-color: rgba(59, 130, 246, 0.3);
}

/* Timeline Cards */
.timeline-container {
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.timeline-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 20px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--surface-border);
  border-radius: 16px;
  transition: all 0.25s ease;
  align-items: center;
}
.timeline-card:hover {
  background: rgba(255, 255, 255, 0.04);
  transform: translateY(-2px);
  border-color: rgba(255,255,255,0.15);
}
.timeline-time {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.timeline-period-number {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent-color);
}
.timeline-content {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.timeline-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.timeline-subject {
  font-size: 16px;
  font-weight: 800;
  color: var(--text-primary);
}
.timeline-meta {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: var(--text-secondary);
}
.timeline-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.attendance-pills {
  display: flex;
  gap: 6px;
}
.attendance-pill {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: bold;
  border-radius: 20px;
  cursor: pointer;
  border: 1px solid rgba(255,255,255,0.08);
  background: rgba(255,255,255,0.02);
  color: var(--text-secondary);
  transition: all 0.2s ease;
}
.attendance-pill.active-o {
  background: rgba(16, 185, 129, 0.2);
  color: #10b981;
  border-color: #10b981;
}
.attendance-pill.active-n {
  background: rgba(239, 68, 68, 0.2);
  color: #ef4444;
  border-color: #ef4444;
}
.attendance-pill.active-s {
  background: rgba(245, 158, 11, 0.2);
  color: #f59e0b;
  border-color: #f59e0b;
}
.grade-input-field {
  width: 50px;
  text-align: center;
  padding: 6px;
  font-weight: bold;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  background: var(--input-bg);
  color: white;
}
.grade-input-field:focus {
  border-color: var(--accent-color);
  outline: none;
}
.grade-comment-field {
  width: 100%;
  padding: 6px 12px;
  border-radius: 8px;
  border: 1px solid var(--surface-border);
  background: var(--input-bg);
  color: white;
}
.grade-comment-field:focus {
  border-color: var(--accent-color);
  outline: none;
}
.monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}
.monitor-class-card {
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.monitor-class-name {
  font-size: 16px;
  font-weight: 800;
  color: var(--accent-color);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  padding-bottom: 8px;
  margin-bottom: 4px;
}
.monitor-period-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border-radius: 8px;
  background: rgba(255,255,255,0.01);
  font-size: 13px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.2s ease;
}
.monitor-period-row:hover {
  background: rgba(255,255,255,0.04);
  border-color: rgba(255,255,255,0.08);
}
.monitor-period-num {
  font-weight: bold;
  color: var(--text-secondary);
}
.monitor-period-subject {
  font-weight: 600;
  color: var(--text-primary);
}

/* --- PREMIUM UI/UX UPGRADES --- */

/* Premium Glassmorphism Cards */
.glass-card-premium {
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  border-radius: 16px;
  transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s ease;
}

.glass-card-premium:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 40px 0 rgba(0, 0, 0, 0.45);
  border-color: rgba(255, 255, 255, 0.15);
}

/* Phone Simulator Slide-in Tab Transitions */
@keyframes phoneScreenSlideIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.phone-screen-animated {
  animation: phoneScreenSlideIn 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* Real-Time Collision Notification Toast System */
#apexedu-toast-container {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast-warning {
  background: rgba(245, 158, 11, 0.15);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid rgba(245, 158, 11, 0.3);
  border-left: 5px solid #f59e0b;
  border-radius: 8px;
  padding: 16px 20px;
  color: #fef08a;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px 0 rgba(245, 158, 11, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-width: 320px;
  max-width: 450px;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-warning button {
  transition: color 0.2s ease, transform 0.2s ease;
}

.toast-warning button:hover {
  color: #ffffff !important;
  transform: scale(1.1);
}

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

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

/* Premium Phone Message Bubbles */
.phone-msg-bubble.sent {
  align-self: flex-end;
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  color: white;
  border-bottom-right-radius: 4px;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.phone-msg-bubble.received {
  align-self: flex-start;
  background: rgba(255, 255, 255, 0.04);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  color: #f8fafc;
  border-bottom-left-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.toast-success {
  background: rgba(16, 185, 129, 0.15);
  backdrop-filter: blur(16px) saturate(120%);
  -webkit-backdrop-filter: blur(16px) saturate(120%);
  border: 1px solid rgba(16, 185, 129, 0.3);
  border-left: 5px solid #10b981;
  border-radius: 8px;
  padding: 16px 20px;
  color: #ecfdf5;
  font-size: 13.5px;
  font-weight: 500;
  box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.5), 0 0 15px 0 rgba(16, 185, 129, 0.2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  min-width: 320px;
  max-width: 450px;
  animation: toastSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.toast-success button {
  transition: color 0.2s ease, transform 0.2s ease;
}

.toast-success button:hover {
  color: #ffffff !important;
  transform: scale(1.1);
}



