/* ==========================================================================
   CGPA Goal Planner - Modern Premium Design System
   ========================================================================== */

:root,
[data-theme="dark"],
[data-theme="light"] {
  /* Complete Deep Dark Palette */
  --bg-primary: #07090e;
  --bg-secondary: #0d111a;
  --bg-card: rgba(13, 17, 26, 0.9);
  --bg-card-hover: rgba(22, 29, 44, 0.95);
  --bg-input: #131824;
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-focus: #6366f1;

  --text-primary: #f8fafc;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;

  --accent-primary: #6366f1;
  --accent-primary-hover: #4f46e5;
  --accent-gradient: linear-gradient(135deg, #6366f1 0%, #a855f7 50%, #ec4899 100%);
  --accent-cyan-gradient: linear-gradient(135deg, #06b6d4 0%, #3b82f6 100%);
  --card-glass: backdrop-filter: blur(16px);

  --success: #10b981;
  --success-bg: rgba(16, 185, 129, 0.12);
  --warning: #f59e0b;
  --warning-bg: rgba(245, 158, 11, 0.12);
  --danger: #ef4444;
  --danger-bg: rgba(239, 68, 68, 0.12);
  --info: #06b6d4;
  --info-bg: rgba(6, 182, 212, 0.12);

  --chart-grid: rgba(255, 255, 255, 0.07);
  --chart-bar-bg: rgba(255, 255, 255, 0.03);

  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 8px 24px -4px rgba(0, 0, 0, 0.6);
  --shadow-lg: 0 16px 36px -6px rgba(0, 0, 0, 0.75);
  --shadow-glow: 0 0 24px rgba(99, 102, 241, 0.25);

  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;

  --font-family: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Base Styles & Reset
   ========================================================================== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-family);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(99, 102, 241, 0.07) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(236, 72, 153, 0.05) 0%, transparent 40%);
  background-attachment: fixed;
  transition: background-color 0.3s ease, color 0.3s ease;
}

/* Container */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 1.5rem 1.25rem 4rem;
}

/* ==========================================================================
   Header & Navigation
   ========================================================================== */
.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  margin-bottom: 2rem;
  gap: 1rem;
}

.brand-wrapper {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.brand-icon {
  width: 44px;
  height: 44px;
  background: var(--accent-gradient);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  font-size: 1.35rem;
  box-shadow: var(--shadow-glow);
}

.brand-title-group h1 {
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
}

.brand-subtitle {
  font-size: 0.88rem;
  color: var(--text-secondary);
  font-style: italic;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1.15rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: var(--transition);
  text-decoration: none;
}

.btn:active {
  transform: scale(0.98);
}

.btn-primary {
  background: var(--accent-gradient);
  color: #ffffff;
  box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
  box-shadow: var(--shadow-glow);
  filter: brightness(1.1);
}

.btn-secondary {
  background: var(--bg-card);
  color: var(--text-primary);
  border-color: var(--border-subtle);
}

.btn-secondary:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-focus);
}

.btn-outline-danger {
  background: transparent;
  color: var(--danger);
  border-color: rgba(239, 68, 68, 0.3);
}

.btn-outline-danger:hover {
  background: var(--danger-bg);
}

.btn-icon {
  width: 40px;
  height: 40px;
  padding: 0;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  font-size: 1.1rem;
}

.btn-icon:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

/* ==========================================================================
   Layout Grid
   ========================================================================== */
.main-layout {
  display: grid;
  grid-template-columns: 410px 1fr;
  gap: 1.75rem;
  align-items: start;
}

@media (max-width: 992px) {
  .main-layout {
    grid-template-columns: 1fr;
  }
}

/* Cards */
.card {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  position: relative;
  overflow: hidden;
}

.card:hover {
  border-color: rgba(99, 102, 241, 0.25);
}

.card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.card-title {
  font-size: 1.15rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text-primary);
}

.card-title .icon {
  color: var(--accent-primary);
}

/* ==========================================================================
   Form & Input Controls
   ========================================================================== */
.form-group {
  margin-bottom: 1.25rem;
}

.form-label {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.45rem;
}

.form-label .helper {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 400;
}

.form-control {
  width: 100%;
  padding: 0.7rem 0.95rem;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text-primary);
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition);
  outline: none;
}

.form-control:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.25);
}

select.form-control {
  cursor: pointer;
}

.input-suffix-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.input-suffix-wrapper .form-control {
  padding-right: 3rem;
}

.input-suffix {
  position: absolute;
  right: 0.85rem;
  color: var(--text-muted);
  font-size: 0.85rem;
  pointer-events: none;
  font-weight: 600;
}

/* Semester inputs grid */
.semesters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 0.75rem;
  max-height: 290px;
  overflow-y: auto;
  padding-right: 0.35rem;
  margin-top: 0.5rem;
}

.semesters-grid::-webkit-scrollbar {
  width: 6px;
}
.semesters-grid::-webkit-scrollbar-thumb {
  background: var(--border-subtle);
  border-radius: 4px;
}

.semester-input-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  transition: var(--transition);
}

[data-theme="light"] .semester-input-card {
  background: rgba(0, 0, 0, 0.02);
}

.semester-input-card:focus-within {
  border-color: var(--border-focus);
  background: rgba(99, 102, 241, 0.05);
}

.sem-card-title {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
  display: flex;
  justify-content: space-between;
}

.sem-card-title .badge-completed {
  font-size: 0.68rem;
  color: var(--accent-primary);
  background: rgba(99, 102, 241, 0.12);
  padding: 0.1rem 0.4rem;
  border-radius: 4px;
}

.sem-inputs-row {
  display: flex;
  gap: 0.4rem;
}

.sem-inputs-row input {
  padding: 0.45rem 0.6rem;
  font-size: 0.88rem;
}

/* Toggle Switch */
.toggle-wrapper {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(255, 255, 255, 0.02);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  margin-bottom: 1.25rem;
}

.toggle-info h4 {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
}

.toggle-info p {
  font-size: 0.76rem;
  color: var(--text-muted);
}

.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 24px;
  flex-shrink: 0;
}

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

.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
  transition: 0.3s;
  border-radius: 34px;
}

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

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

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

/* Error message */
.validation-banner {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.3);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1rem;
  display: none;
}

[data-theme="light"] .validation-banner {
  color: #b91c1c;
}

/* ==========================================================================
   Dashboard Metrics
   ========================================================================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin-bottom: 1.5rem;
}

@media (max-width: 1200px) {
  .dashboard-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 576px) {
  .dashboard-grid {
    grid-template-columns: 1fr;
  }
}

.metric-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.metric-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 3px;
  background: var(--border-subtle);
}

.metric-card.highlight::before {
  background: var(--accent-gradient);
}
.metric-card.success::before {
  background: var(--success);
}
.metric-card.warning::before {
  background: var(--warning);
}
.metric-card.danger::before {
  background: var(--danger);
}

.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.4rem;
}

.metric-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.metric-icon {
  font-size: 1.1rem;
  opacity: 0.75;
}

.metric-value {
  font-size: 2rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.metric-sub {
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* Feasibility Banner */
.feasibility-box {
  border-radius: var(--radius-md);
  padding: 1.1rem 1.35rem;
  margin-bottom: 1.5rem;
  border: 1px solid transparent;
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  transition: var(--transition);
}

.feasibility-box.status-achievable {
  background: var(--success-bg);
  border-color: rgba(16, 185, 129, 0.35);
  color: #a7f3d0;
}
[data-theme="light"] .feasibility-box.status-achievable {
  color: #065f46;
}

.feasibility-box.status-impossible {
  background: var(--danger-bg);
  border-color: rgba(239, 68, 68, 0.35);
  color: #fecaca;
}
[data-theme="light"] .feasibility-box.status-impossible {
  color: #991b1b;
}

.feasibility-box.status-already_achieved {
  background: var(--info-bg);
  border-color: rgba(6, 182, 212, 0.35);
  color: #a5f3fc;
}
[data-theme="light"] .feasibility-box.status-already_achieved {
  color: #155e75;
}

.feasibility-icon {
  font-size: 1.75rem;
  line-height: 1;
  flex-shrink: 0;
}

.feasibility-content h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 0.2rem;
}

.feasibility-content p {
  font-size: 0.88rem;
  line-height: 1.45;
  opacity: 0.95;
}

/* Visual Progress Bar */
.progress-card {
  margin-bottom: 1.5rem;
  padding: 1.25rem;
  border-radius: var(--radius-md);
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
}

.progress-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
}

.progress-track {
  height: 10px;
  background: var(--bg-input);
  border-radius: var(--radius-full);
  overflow: hidden;
  position: relative;
}

.progress-fill {
  height: 100%;
  width: 0%;
  background: var(--accent-gradient);
  border-radius: var(--radius-full);
  transition: width 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ==========================================================================
   Chart & Visual Section
   ========================================================================== */
.chart-container-card {
  margin-bottom: 1.5rem;
}

.chart-wrapper {
  width: 100%;
  overflow-x: auto;
}

.cgpa-svg-chart {
  width: 100%;
  height: auto;
  min-width: 500px;
  display: block;
}

.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  justify-content: center;
  margin-top: 0.75rem;
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.legend-dot {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}
.legend-dot.actual {
  background: #6366f1;
}
.legend-dot.planned {
  background: #06b6d4;
  border: 1px dashed #22d3ee;
}
.legend-dot.target {
  background: #f59e0b;
}
.legend-dot.required {
  background: #10b981;
}

/* ==========================================================================
   Semester Planning Section
   ========================================================================== */
.planner-section {
  margin-bottom: 1.5rem;
}

.planner-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.btn-pill {
  padding: 0.35rem 0.75rem;
  font-size: 0.78rem;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  font-weight: 500;
  transition: var(--transition);
}

.btn-pill:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
}

.planner-table-container {
  overflow-x: auto;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  margin-bottom: 1rem;
}

.planner-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
  text-align: left;
}

.planner-table th {
  background: rgba(0, 0, 0, 0.2);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

[data-theme="light"] .planner-table th {
  background: rgba(0, 0, 0, 0.03);
}

.planner-table td {
  padding: 0.6rem 1rem;
  border-bottom: 1px solid var(--border-subtle);
}

.planner-table tr:last-child td {
  border-bottom: none;
}

.planner-input {
  width: 90px;
  padding: 0.4rem 0.6rem;
  border-radius: 6px;
  border: 1px solid var(--border-subtle);
  background: var(--bg-input);
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.9rem;
}

.planner-input:focus {
  outline: none;
  border-color: var(--border-focus);
}

.planner-projection-banner {
  padding: 0.85rem 1.15rem;
  background: rgba(6, 182, 212, 0.08);
  border: 1px solid rgba(6, 182, 212, 0.25);
  border-radius: var(--radius-sm);
  font-size: 0.86rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ==========================================================================
   Details / Explanations & Accordion
   ========================================================================== */
.accordion {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  margin-bottom: 1.5rem;
  background: var(--bg-card);
}

.accordion-item {
  border-bottom: 1px solid var(--border-subtle);
}

.accordion-item:last-child {
  border-bottom: none;
}

.accordion-header {
  width: 100%;
  padding: 1rem 1.25rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  color: var(--text-primary);
  font-family: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  text-align: left;
}

.accordion-header:hover {
  background: rgba(255, 255, 255, 0.02);
}

.accordion-content {
  padding: 0 1.25rem 1.25rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: none;
}

.accordion-content.show {
  display: block;
}

.formula-block {
  background: var(--bg-input);
  border-left: 3px solid var(--accent-primary);
  padding: 0.75rem 1rem;
  margin: 0.75rem 0;
  border-radius: 0 6px 6px 0;
  font-family: monospace;
  font-size: 0.88rem;
  color: var(--text-primary);
}

.step-card {
  background: rgba(0, 0, 0, 0.15);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  padding: 0.85rem;
  margin: 0.75rem 0;
}

[data-theme="light"] .step-card {
  background: rgba(0, 0, 0, 0.02);
}

/* University Disclaimer */
.disclaimer-card {
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  background: rgba(245, 158, 11, 0.06);
  border: 1px solid rgba(245, 158, 11, 0.2);
  color: var(--text-secondary);
  font-size: 0.82rem;
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.disclaimer-card .icon {
  color: var(--warning);
  font-size: 1.2rem;
  flex-shrink: 0;
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  padding: 1rem;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-card {
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  max-width: 500px;
  width: 100%;
  padding: 1.5rem;
  box-shadow: var(--shadow-lg);
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.modal-title {
  font-size: 1.2rem;
  font-weight: 700;
}

.modal-body {
  margin-bottom: 1.5rem;
}

.saved-plans-list {
  max-height: 250px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.saved-plan-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.75rem 0.9rem;
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  transition: var(--transition);
}

.saved-plan-item:hover {
  border-color: var(--border-focus);
}

.plan-info-title {
  font-weight: 600;
  font-size: 0.9rem;
}
.plan-info-sub {
  font-size: 0.75rem;
  color: var(--text-muted);
}

/* Toast Notifications */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  pointer-events: none;
}

.toast {
  pointer-events: auto;
  background: var(--bg-secondary);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  padding: 0.75rem 1.15rem;
  border-radius: var(--radius-sm);
  font-size: 0.88rem;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 0.65rem;
  animation: slideIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  max-width: 380px;
}

@keyframes slideIn {
  from { transform: translateX(100%); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}

/* ==========================================================================
   B.Tech Semester Selector Pills & Target Chips
   ========================================================================== */
.sem-selector-group {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.5rem;
  margin-top: 0.35rem;
}

@media (max-width: 480px) {
  .sem-selector-group {
    grid-template-columns: repeat(2, 1fr);
  }
}

.sem-pill-btn {
  padding: 0.6rem 0.5rem;
  font-size: 0.82rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-sm);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
  text-align: center;
}

.sem-pill-btn:hover {
  color: var(--text-primary);
  border-color: var(--border-focus);
  background: rgba(99, 102, 241, 0.08);
}

.sem-pill-btn.active {
  background: var(--accent-gradient);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 0 12px rgba(99, 102, 241, 0.35);
}

.btn-chip {
  padding: 0.25rem 0.65rem;
  font-size: 0.78rem;
  font-weight: 600;
  font-family: inherit;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.btn-chip:hover {
  background: var(--accent-primary);
  color: #ffffff;
  border-color: var(--accent-primary);
}

/* ==========================================================================
   Login Page Styles
   ========================================================================== */
.login-container {
  min-height: 80vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem 1rem;
}

.login-card {
  width: 100%;
  max-width: 440px;
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 2.25rem 2rem;
  box-shadow: var(--shadow-lg);
  position: relative;
  overflow: hidden;
}

.login-card::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 4px;
  background: var(--accent-gradient);
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
}

.login-institute-logo {
  width: 90px;
  height: auto;
  max-height: 98px;
  object-fit: contain;
  margin: 0 auto 1.25rem;
  display: block;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 4px 18px rgba(0, 0, 0, 0.7));
  transition: transform 0.3s ease;
}

.login-institute-logo:hover {
  transform: scale(1.04);
}

.header-brand-logo {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: transparent !important;
  background-color: transparent !important;
  border: none !important;
  border-radius: 0 !important;
  box-shadow: none !important;
  filter: drop-shadow(0 2px 10px rgba(0, 0, 0, 0.5));
}

.login-title {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.35rem;
}

.login-subtitle {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.login-error-banner {
  background: var(--danger-bg);
  border: 1px solid rgba(239, 68, 68, 0.4);
  color: #fca5a5;
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.85rem;
  margin-bottom: 1.25rem;
  display: none;
  align-items: center;
  gap: 0.5rem;
}

[data-theme="light"] .login-error-banner {
  color: #991b1b;
}

.password-input-group {
  position: relative;
  display: flex;
  align-items: center;
}

.password-input-group .form-control {
  padding-right: 2.75rem;
}

.btn-toggle-pwd {
  position: absolute;
  right: 0.75rem;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1.1rem;
  padding: 0.25rem;
}

.btn-toggle-pwd:hover {
  color: var(--text-primary);
}

.student-user-badge {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.35rem 0.85rem 0.35rem 0.45rem;
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  font-size: 0.82rem;
}

.student-avatar-wrapper {
  position: relative;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
}

.student-user-avatar-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-primary);
  box-shadow: 0 0 10px rgba(99, 102, 241, 0.35);
  display: block;
}

.student-user-avatar-fallback {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--accent-gradient);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #ffffff;
  font-weight: 700;
}

/* ==========================================================================
   Student Welcome Banner with Official Photo
   ========================================================================== */
.student-welcome-banner {
  background: var(--bg-card);
  backdrop-filter: blur(14px);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 1.25rem 1.5rem;
  margin-bottom: 1.75rem;
  box-shadow: var(--shadow-md);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.student-welcome-banner::before {
  content: '';
  position: absolute;
  top: 0; left: 0; bottom: 0;
  width: 4px;
  background: var(--accent-gradient);
}

.student-banner-left {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.student-photo-frame {
  position: relative;
  width: 68px;
  height: 68px;
  flex-shrink: 0;
}

.student-profile-photo {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  object-fit: cover;
  border: 2.5px solid var(--accent-primary);
  box-shadow: var(--shadow-glow);
  display: block;
  background: var(--bg-input);
}

.student-photo-fallback {
  width: 68px;
  height: 68px;
  border-radius: var(--radius-md);
  background: var(--accent-gradient);
  display: none;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  color: #ffffff;
}

.student-banner-details {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.student-welcome-title {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.01em;
}

.student-welcome-title span {
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.student-badges-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.student-badge {
  font-size: 0.78rem;
  font-weight: 600;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: var(--bg-input);
  border: 1px solid var(--border-subtle);
  color: var(--text-secondary);
}

.student-badge.highlight {
  background: rgba(16, 185, 129, 0.12);
  border-color: rgba(16, 185, 129, 0.3);
  color: var(--success);
}

/* ==========================================================================
   Print Stylesheet (PDF & Print Report Optimization)
   ========================================================================== */
@media print {
  body {
    background: #ffffff !important;
    color: #000000 !important;
  }
  .site-header .header-actions,
  .form-actions-row,
  .planner-toolbar,
  .accordion,
  .btn,
  .toggle-wrapper,
  .toast-container,
  .modal-overlay {
    display: none !important;
  }
  .container {
    max-width: 100% !important;
    padding: 0 !important;
  }
  .main-layout {
    display: block !important;
  }
  .card {
    background: #ffffff !important;
    border: 1px solid #cccccc !important;
    box-shadow: none !important;
    page-break-inside: avoid;
    margin-bottom: 1.5rem !important;
  }
  .print-banner {
    display: block !important;
    margin-bottom: 1rem;
    border-bottom: 2px solid #333;
    padding-bottom: 0.5rem;
  }
  .dashboard-grid {
    grid-template-columns: repeat(4, 1fr) !important;
  }
  .metric-card {
    border: 1px solid #ccc !important;
    box-shadow: none !important;
  }
  .metric-value {
    color: #000000 !important;
  }
}
