:root {
  --primary: #6366f1;
  --primary-gradient: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --primary-dark: #4338ca;
  --bg: #f8fafc;
  --card: #ffffff;
  --card-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.08);
  --text: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --success: #10b981;
  --warning: #f59e0b;
  --danger: #ef4444;
  --sidebar-bg: #090d16;
  --sidebar-text: #94a3b8;
  --sidebar-hover: rgba(255, 255, 255, 0.08);
  --modal-bg: #ffffff;
}

body.dark-theme {
  --bg: #090d16;
  --card: #131b2e;
  --card-shadow: 0 10px 35px -5px rgba(0, 0, 0, 0.5);
  --text: #f8fafc;
  --muted: #94a3b8;
  --border: #1e293b;
  --sidebar-bg: #050810;
  --sidebar-text: #94a3b8;
  --sidebar-hover: rgba(99, 102, 241, 0.15);
  --modal-bg: #131b2e;
}

* { box-sizing: border-box; }
body { margin: 0; font-family: Inter, system-ui, -apple-system, sans-serif; background: var(--bg); color: var(--text); transition: background 0.25s, color 0.25s; letter-spacing: -0.01em; }
button, input, select, textarea { font: inherit; }
.hidden { display: none !important; }

/* Login Screen - 100% Exact match to novixis.in/login */
.login-container {
  background: #f8fafc;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  font-family: Inter, system-ui, -apple-system, sans-serif;
  display: flex;
  position: relative;
  overflow: hidden;
  padding: 20px;
}
body.dark-theme .login-container {
  background: #050810;
}

.orb {
  filter: blur(80px);
  z-index: 1;
  border-radius: 50%;
  position: absolute;
}
.orb-1 {
  background: #2563eb66;
  width: 400px;
  height: 400px;
  animation: 8s ease-in-out infinite float;
  top: -100px;
  left: -100px;
}
.orb-2 {
  background: #0e2b9e80;
  width: 300px;
  height: 300px;
  animation: 10s ease-in-out infinite reverse float;
  bottom: -50px;
  right: -50px;
}
.orb-3 {
  background: #06b6d44d;
  width: 250px;
  height: 250px;
  animation: 6s ease-in-out infinite pulse;
  top: 40%;
  left: 50%;
  transform: translate(-50%, -50%);
}

.glass-card {
  z-index: 2;
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.5);
  border-radius: 24px;
  width: 100%;
  max-width: 420px;
  padding: 3rem;
  position: relative;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.05);
}
body.dark-theme .glass-card {
  background: rgba(17, 24, 39, 0.8);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
}

.glass-card .logo img {
  width: 260px;
  max-width: 100%;
  height: auto;
  margin: 0 auto 1.5rem;
  display: block;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  padding: 0 !important;
  border-radius: 0 !important;
}

.glass-card h2 {
  color: #0f172a;
  margin-bottom: 0.5rem;
  font-size: 1.8rem;
  font-weight: 700;
}
body.dark-theme .glass-card h2 {
  color: #f8fafc;
}

.glass-card p {
  color: #475569;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}
body.dark-theme .glass-card p {
  color: #94a3b8;
}

.input-group {
  text-align: left;
  margin-bottom: 1.5rem;
}
.input-group label {
  color: #334155;
  margin-bottom: 0.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  display: block;
}
body.dark-theme .input-group label {
  color: #cbd5e1;
}

.input-group input {
  color: #0f172a;
  background: #edf2fc;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  width: 100%;
  padding: 0.75rem 1rem;
  font-size: 1rem;
  transition: all 0.3s;
  box-sizing: border-box;
  outline: none;
}
body.dark-theme .input-group input {
  color: #f8fafc;
  background: #1e293b;
  border-color: #334155;
}

.input-group input:focus {
  border-color: #3b82f6;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
}
body.dark-theme .input-group input:focus {
  background: #0f172a;
}

.login-btn {
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, #2563eb, #0e2b9e);
  border: none;
  border-radius: 12px;
  width: 100%;
  margin-top: 1rem;
  padding: 0.85rem;
  font-size: 1rem;
  font-weight: 600;
  transition: all 0.3s;
  box-shadow: 0 10px 20px -10px rgba(37, 99, 235, 0.5);
}
.login-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 20px -10px rgba(37, 99, 235, 0.5);
}

@keyframes float {
  0% { transform: translate(0) scale(1); }
  33% { transform: translate(30px, -50px) scale(1.1); }
  66% { transform: translate(-20px, 20px) scale(0.9); }
  100% { transform: translate(0) scale(1); }
}

@keyframes pulse {
  0% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
  50% { opacity: 1; transform: translate(-50%, -50%) scale(1.1); }
  100% { opacity: 0.8; transform: translate(-50%, -50%) scale(1); }
}

/* App Layout */
.app { display: flex; min-height: 100vh; }
.sidebar { width: 260px; background: var(--sidebar-bg); color: var(--sidebar-text); padding: 24px 16px; display: flex; flex-direction: column; position: fixed; inset: 0 auto 0 0; z-index: 20; border-right: 1px solid rgba(255,255,255,0.06); }
.sidebar .logo { display: flex; align-items: center; justify-content: center; padding: 12px 14px 20px; border-bottom: 1px solid rgba(255,255,255,0.08); margin-bottom: 18px; width: 100%; box-sizing: border-box; }
.sidebar .logo img { width: 100%; max-width: 185px; height: auto; max-height: 42px; object-fit: contain; display: block; margin: 0 auto; }
.sidebar .logo b { display: block; color: #ffffff; font-size: 16px; font-weight: 800; letter-spacing: 0.2px; line-height: 1.2; }
.sidebar .logo small { color: #94a3b8; font-size: 11px; font-weight: 600; display: block; margin-top: 2px; }

.nav-item { width: 100%; border: 0; background: transparent; color: #94a3b8; text-align: left; padding: 12px 16px; border-radius: 12px; cursor: pointer; margin: 3px 0; display: flex; gap: 12px; align-items: center; font-size: 14px; font-weight: 600; transition: all 0.2s; }
.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active { background: var(--primary-gradient) !important; color: #ffffff !important; box-shadow: 0 8px 24px rgba(99, 102, 241, 0.35); font-weight: 700; }
.logout { margin-top: auto; border: 0; background: rgba(255,255,255,0.05); color: #94a3b8; padding: 13px; border-radius: 12px; cursor: pointer; display: flex; gap: 10px; align-items: center; font-weight: 700; font-size: 14px; transition: all 0.2s; }
.logout:hover { background: rgba(239, 68, 68, 0.2); color: #fca5a5; }

.main { margin-left: 260px; width: calc(100% - 260px); }
.topbar { height: 76px; background: var(--card); border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; padding: 0 32px; position: sticky; top: 0; z-index: 10; backdrop-filter: blur(12px); }
.topbar h2 { margin: 0; font-size: 20px; font-weight: 800; }
.topbar span { font-size: 12px; color: var(--muted); font-weight: 500; }
.top-actions { display: flex; align-items: center; gap: 16px; }
.icon-btn { border: 1px solid var(--border); background: var(--bg); color: var(--text); border-radius: 12px; width: 40px; height: 40px; cursor: pointer; display: grid; place-items: center; font-size: 16px; transition: all 0.2s; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.profile { display: flex; align-items: center; gap: 12px; background: var(--bg); padding: 6px 14px 6px 8px; border-radius: 30px; border: 1px solid var(--border); }
.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--primary-gradient); color: #ffffff; font-weight: 800; font-size: 14px; box-shadow: 0 4px 12px rgba(99, 102, 241, 0.3); }
.profile small { display: block; color: var(--muted); font-size: 11px; font-weight: 600; }
.menu-btn { display: none; }

.content { padding: 32px; max-width: 1500px; margin: auto; }
.welcome { margin-bottom: 24px; }
.welcome h1 { margin: 0 0 6px; font-size: 28px; font-weight: 800; letter-spacing: -0.02em; }
.welcome p { margin: 0; color: var(--muted); font-size: 15px; }

.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin-bottom: 24px; }
.stat, .panel { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 22px; box-shadow: var(--card-shadow); transition: all 0.25s ease-in-out; }
.stat:hover, .panel:hover { transform: translateY(-2px); box-shadow: 0 16px 35px -5px rgba(99, 102, 241, 0.12); }
.stat { display: flex; justify-content: space-between; align-items: center; }
.stat h3 { margin: 4px 0; font-size: 30px; font-weight: 800; }
.stat p { margin: 0; color: var(--muted); font-size: 13px; font-weight: 600; }
.stat-icon { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: linear-gradient(135deg, rgba(99, 102, 241, 0.12), rgba(79, 70, 229, 0.2)); color: var(--primary); font-size: 22px; border: 1px solid rgba(99, 102, 241, 0.2); }

.grid2 { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.panel h3 { margin: 0; font-size: 17px; font-weight: 800; }
.muted { color: var(--muted); font-size: 13px; }

table { width: 100%; border-collapse: separate; border-spacing: 0; }
th, td { padding: 14px 12px; text-align: left; font-size: 13px; border-bottom: 1px solid var(--border); }
th { color: var(--muted); font-weight: 700; background: var(--bg); text-transform: uppercase; font-size: 11px; letter-spacing: 0.05em; }
th:first-child { border-top-left-radius: 10px; border-bottom-left-radius: 10px; }
th:last-child { border-top-right-radius: 10px; border-bottom-right-radius: 10px; }
tr:last-child td { border-bottom: 0; }
tr:hover td { background: rgba(99, 102, 241, 0.02); }

.badge { padding: 6px 12px; border-radius: 20px; font-size: 11px; font-weight: 700; display: inline-flex; align-items: center; gap: 4px; }
.green { background: rgba(16, 185, 129, 0.15); color: #10b981; border: 1px solid rgba(16, 185, 129, 0.3); }
.yellow { background: rgba(245, 158, 11, 0.15); color: #f59e0b; border: 1px solid rgba(245, 158, 11, 0.3); }
.red { background: rgba(239, 68, 68, 0.15); color: #ef4444; border: 1px solid rgba(239, 68, 68, 0.3); }
.blue { background: rgba(99, 102, 241, 0.15); color: #6366f1; border: 1px solid rgba(99, 102, 241, 0.3); }

.progress { height: 8px; background: var(--border); border-radius: 20px; overflow: hidden; }
.progress i { display: block; height: 100%; background: var(--primary-gradient); border-radius: 20px; }

.page-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.page-head h1 { margin: 0; font-size: 24px; font-weight: 800; }
.btn { border: 0; background: var(--primary-gradient); color: #fff; border-radius: 12px; padding: 11px 20px; font-weight: 700; cursor: pointer; transition: all 0.2s; box-shadow: 0 6px 20px rgba(99, 102, 241, 0.3); }
.btn:hover { transform: translateY(-1px); box-shadow: 0 10px 25px rgba(99, 102, 241, 0.45); }
.btn.secondary { background: rgba(99, 102, 241, 0.1); color: var(--primary); border: 1px solid rgba(99, 102, 241, 0.2); box-shadow: none; }
.btn.secondary:hover { background: rgba(99, 102, 241, 0.2); }
.btn.success-btn { background: linear-gradient(135deg, #10b981 0%, #059669 100%); box-shadow: 0 6px 20px rgba(16, 185, 129, 0.3); }

.toolbar { display: flex; gap: 12px; margin-bottom: 18px; }
.toolbar input, .toolbar select { border: 1px solid var(--border); background: var(--card); color: var(--text); border-radius: 12px; padding: 11px 14px; outline: 0; font-size: 14px; transition: all 0.2s; }
.toolbar input:focus, .toolbar select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.15); }
.toolbar input { min-width: 260px; }

.cards3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.info-card { background: var(--card); border: 1px solid var(--border); border-radius: 18px; padding: 24px; display: flex; flex-direction: column; justify-content: space-between; box-shadow: var(--card-shadow); transition: all 0.25s ease-in-out; }
.info-card:hover { transform: translateY(-2px); box-shadow: 0 16px 35px -5px rgba(99, 102, 241, 0.12); }
.info-card h3 { margin: 0 0 8px; font-size: 17px; font-weight: 800; }
.info-card p { color: var(--muted); margin: 6px 0 18px; font-size: 13px; line-height: 1.6; }

.empty { padding: 48px; text-align: center; color: var(--muted); }
.toast { position: fixed; right: 24px; bottom: 24px; background: #0f172a; color: white; padding: 14px 20px; border-radius: 14px; opacity: 0; transform: translateY(10px); transition: all 0.25s ease-in-out; z-index: 1000; box-shadow: 0 12px 35px rgba(0,0,0,0.3); border: 1px solid rgba(255,255,255,0.1); font-weight: 600; font-size: 14px; }
.toast.show { opacity: 1; transform: translateY(0); }

/* Modal Overlay */
.modal-overlay { position: fixed; inset: 0; background: rgba(15, 23, 42, 0.65); backdrop-filter: blur(8px); display: grid; place-items: center; z-index: 500; padding: 20px; }
.modal-card { width: min(580px, 100%); background: var(--modal-bg); border: 1px solid var(--border); border-radius: 24px; padding: 28px; box-shadow: 0 25px 70px rgba(0,0,0,0.4); max-height: 90vh; overflow-y: auto; }
.modal-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--border); }
.modal-header h3 { margin: 0; font-size: 18px; }
.close-btn { border: 0; background: transparent; font-size: 18px; color: var(--muted); cursor: pointer; }
.modal-body label { display: block; font-size: 13px; font-weight: 700; margin: 12px 0 6px; }
.modal-body input, .modal-body select, .modal-body textarea { width: 100%; padding: 11px 13px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); color: var(--text); outline: 0; }

/* Responsive adjustments */
@media(max-width: 950px) {
  .stats { grid-template-columns: repeat(2, 1fr); }
  .grid2 { grid-template-columns: 1fr; }
  .cards3 { grid-template-columns: 1fr 1fr; }
}

/* Portal Selection Hub */
.portal-selection-container {
  max-width: 980px;
  width: 100%;
  margin: auto;
  text-align: center;
}
.brand-header {
  margin-bottom: 36px;
}
.brand-header .brand-mark {
  margin: 0 auto 16px;
}
.brand-header h1 {
  font-size: 32px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.02em;
}
.brand-header p {
  color: var(--muted);
  font-size: 16px;
  margin: 0;
}

.portal-cards-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}

.portal-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 28px 20px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  box-shadow: var(--card-shadow);
  cursor: pointer;
  transition: all 0.25s ease-in-out;
  position: relative;
  overflow: hidden;
}
.portal-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.2);
  border-color: var(--primary);
}

.portal-icon {
  width: 64px;
  height: 64px;
  border-radius: 20px;
  font-size: 30px;
  display: grid;
  place-items: center;
  margin-bottom: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  transition: all 0.25s ease-in-out;
}
.portal-card:hover .portal-icon {
  transform: scale(1.1);
  background: rgba(99, 102, 241, 0.1);
}

.portal-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: 800;
}
.portal-card p {
  margin: 0 0 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.5;
  flex-grow: 1;
}

.portal-btn {
  width: 100%;
  padding: 10px 14px;
  border: 0;
  border-radius: 12px;
  background: var(--bg);
  color: var(--text);
  font-weight: 700;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
  border: 1px solid var(--border);
}
.portal-card:hover .portal-btn {
  background: var(--primary-gradient);
  color: white;
  border-color: transparent;
  box-shadow: 0 6px 18px rgba(99, 102, 241, 0.35);
}

.back-link-btn {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 0;
  margin-bottom: 12px;
  transition: color 0.2s;
}
.back-link-btn:hover {
  color: var(--primary);
}

@media(max-width: 900px) {
  .portal-cards-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media(max-width: 540px) {
  .portal-cards-grid {
    grid-template-columns: 1fr;
  }
}

/* Sidebar Mobile Backdrop Overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 99;
}
.sidebar-overlay.show {
  display: block;
}

@media(max-width: 720px) {
  .sidebar { transform: translateX(-100%); transition: transform 0.25s ease-in-out; z-index: 100; }
  .sidebar.open { transform: translateX(0); box-shadow: 10px 0 30px rgba(0,0,0,0.5); }
  .main { margin-left: 0; width: 100%; }
  .topbar { position: sticky; top: 0; z-index: 90; background: var(--nav-bg); backdrop-filter: blur(8px); padding: 0 16px; height: 60px; }
  .menu-btn { display: block; border: 0; background: transparent; font-size: 22px; color: var(--text); cursor: pointer; padding: 4px 8px; }
  .content { padding: 12px; }
  .profile > div:last-child { display: none; }
  .stats { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .stat-card { padding: 14px; }
  .stat-card h3 { font-size: 20px; }
  .cards3 { grid-template-columns: 1fr; }
  .toolbar { flex-wrap: wrap; gap: 8px; }
  .toolbar input, .toolbar select { width: 100% !important; min-width: 0; }
  .panel { padding: 14px; border-radius: 12px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  table { min-width: 580px; font-size: 13px; }
  th, td { padding: 10px 12px; }
  .page-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .page-head h1 { font-size: 19px; }
  .login-card { padding: 22px 16px; border-radius: 16px; width: 92vw; }
  .modal-card { width: 95vw; padding: 16px; max-height: 88vh; }
  
  /* Mobile Responsive Live Classroom Stage */
  .live-stage-grid { grid-template-columns: 1fr !important; min-height: auto !important; }
  .live-chat-panel { height: 320px !important; border-left: none !important; border-top: 1px solid rgba(255,255,255,0.1) !important; }
  .live-control-bar { flex-direction: column; gap: 12px; }
  .live-control-bar > div { width: 100%; justify-content: center; flex-wrap: wrap; gap: 8px; }
  
  /* Mobile Modals Input Grids */
  div[style*="grid-template-columns:1fr 1fr"], div[style*="grid-template-columns: 1fr 1fr"] {
    grid-template-columns: 1fr !important;
  }
}

/* Printable Receipt & Professional A4 Invoice CSS */
.receipt-box { border: 2px dashed var(--primary); padding: 24px; border-radius: 14px; background: var(--bg); margin-top: 15px; }
.receipt-header { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--border); padding-bottom: 12px; margin-bottom: 15px; }
.receipt-row { display: flex; justify-content: space-between; padding: 6px 0; font-size: 13px; }

/* Settings Logo Preview */
.logo-preview { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; padding-bottom: 18px; border-bottom: 1px solid var(--border); }
.logo-preview img { width: 64px !important; height: 64px !important; max-width: 64px !important; max-height: 64px !important; object-fit: contain; border: 1px solid var(--border); border-radius: 12px; background: #ffffff; padding: 4px; flex-shrink: 0; }
.logo-preview h3 { margin: 0 0 4px; font-size: 16px; }

/* Professional A4 Document Print Stylesheet */
@media print {
  body, html {
    background: #ffffff !important;
    color: #0f172a !important;
    margin: 0 !important;
    padding: 0 !important;
    width: 100% !important;
    height: auto !important;
  }
  
  .sidebar, .topbar, .modal-close, .modal-head, .no-print, #toast, .modal-bg {
    display: none !important;
  }

  .modal {
    position: static !important;
    background: #ffffff !important;
    padding: 0 !important;
    margin: 0 !important;
    box-shadow: none !important;
    border: none !important;
    display: block !important;
  }

  .modal-card {
    box-shadow: none !important;
    border: none !important;
    padding: 0 !important;
    max-width: 100% !important;
    width: 100% !important;
    background: #ffffff !important;
  }

  #printableInvoiceArea {
    border: none !important;
    box-shadow: none !important;
    padding: 10mm !important;
    margin: 0 !important;
    width: 100% !important;
    color: #0f172a !important;
  }
}

