/* CSS Design System for Psychology Report App */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=Outfit:wght@400;500;600;700;800&display=swap');

:root {
  --primary: #7D317B;
  --primary-light: #ab47bc;
  --primary-dark: #4a148c;
  --primary-rgb: 125, 49, 123;
  --secondary: #29253C;
  --secondary-rgb: 41, 37, 60;
  --bg-dark: #12101b;
  --bg-dashboard: #181524;
  --card-bg: rgba(41, 37, 60, 0.45);
  --card-border: rgba(125, 49, 123, 0.2);
  --text-color: #f3f3f6;
  --text-muted: #a5a2b8;
  --white: #ffffff;
  --shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
  --radius: 16px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Global Reset & Typography */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-dashboard);
  color: var(--text-color);
  min-height: 100vh;
  line-height: 1.6;
}

h1, h2, h3, h4, h5, h6 {
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  color: var(--white);
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--white);
}

/* --- APP LAYOUT & SIDEBAR --- */
.app-layout {
  display: flex;
  min-height: 100vh;
}

.app-sidebar {
  width: 260px;
  background: linear-gradient(180deg, #181427 0%, #0d0b16 100%);
  border-right: 1px solid rgba(125, 49, 123, 0.12);
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
  flex-shrink: 0;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 2.5rem;
  padding: 0.5rem;
}

.sidebar-logo i {
  font-size: 1.8rem;
  color: var(--primary);
  text-shadow: 0 0 10px rgba(125, 49, 123, 0.2);
}

.sidebar-logo span {
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  background: linear-gradient(to right, var(--primary-dark), var(--primary-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-grow: 1;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0.85rem 1.15rem;
  color: var(--text-muted);
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-item i {
  font-size: 1.1rem;
  width: 20px;
  text-align: center;
}

.nav-item:hover, .nav-item.active {
  background: rgba(125, 49, 123, 0.15);
  color: var(--white);
  box-shadow: inset 3px 0 0 var(--primary-light);
}

.sidebar-footer {
  padding-top: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 0.8rem;
  color: var(--text-muted);
  text-align: center;
}

.app-content {
  flex-grow: 1;
  padding: 2rem;
  margin-left: 260px; /* offset fixed sidebar */
  overflow-y: auto;
}

/* --- DASHBOARD STYLES --- */
.dashboard-container {
  max-width: 1400px;
  margin: 0 auto;
}


header.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
  background: linear-gradient(135deg, rgba(125, 49, 123, 0.15) 0%, rgba(41, 37, 60, 0.4) 100%);
  padding: 1.5rem 2rem;
  border-radius: var(--radius);
  border: 1px solid var(--card-border);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
}

header.dash-header h1 {
  font-size: 2rem;
  background: linear-gradient(to right, #fff, #f3a3ff);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

header.dash-header p {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-top: 0.2rem;
}

.header-actions {
  display: flex;
  gap: 1rem;
}

/* Button Component */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 10px;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: var(--transition);
  border: none;
  color: var(--white);
  outline: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary) 0%, #a23da2 100%);
  box-shadow: 0 4px 15px rgba(125, 49, 123, 0.4);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(125, 49, 123, 0.6);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--white);
}

.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--white);
  transform: translateY(-2px);
}

.btn-danger {
  background: linear-gradient(135deg, #d32f2f 0%, #f44336 100%);
  box-shadow: 0 4px 15px rgba(244, 67, 54, 0.3);
}

.btn-danger:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(244, 67, 54, 0.5);
}

.btn-sm {
  padding: 0.5rem 1rem;
  font-size: 0.85rem;
  border-radius: 8px;
}

/* Statistics Widgets */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 1.5rem;
  border-radius: var(--radius);
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  display: flex;
  align-items: center;
  gap: 1.25rem;
  position: relative;
  overflow: hidden;
}

.stat-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 4px;
  height: 100%;
  background: var(--primary);
}

.stat-icon {
  background: rgba(125, 49, 123, 0.2);
  width: 50px;
  height: 50px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--primary-light);
  font-size: 1.5rem;
}

.stat-info h3 {
  font-size: 0.9rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-info .stat-value {
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--white);
  font-family: 'Outfit', sans-serif;
  margin-top: 0.2rem;
}

/* Main Content Card / Table Styles */
.content-card {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 2rem;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow);
  margin-bottom: 2rem;
}

.content-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid rgba(125, 49, 123, 0.1);
  padding-bottom: 1rem;
}

.content-card-header h2 {
  font-size: 1.4rem;
}

/* Table */
.table-responsive {
  width: 100%;
  overflow-x: auto;
}

.student-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
}

.student-table th {
  padding: 1rem;
  border-bottom: 2px solid rgba(125, 49, 123, 0.15);
  color: var(--text-muted);
  font-weight: 600;
  font-family: 'Outfit', sans-serif;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.student-table td {
  padding: 1rem 0.8rem;
  border-bottom: 1px solid rgba(125, 49, 123, 0.08);
  color: var(--text-color);
  font-size: 0.95rem;
}

.student-table tr:hover td {
  background-color: rgba(125, 49, 123, 0.04);
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  border-radius: 6px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.badge-visual { background: rgba(255, 193, 7, 0.15); color: #ffca28; border: 1px solid rgba(255, 193, 7, 0.3); }
.badge-auditorial { background: rgba(3, 169, 244, 0.15); color: #29b6f6; border: 1px solid rgba(3, 169, 244, 0.3); }
.badge-kinestetik { background: rgba(76, 175, 80, 0.15); color: #66bb6a; border: 1px solid rgba(76, 175, 80, 0.3); }

.badge-quitter { background: rgba(244, 67, 54, 0.15); color: #ef5350; border: 1px solid rgba(244, 67, 54, 0.3); }
.badge-camper { background: rgba(255, 152, 0, 0.15); color: #ffa726; border: 1px solid rgba(255, 152, 0, 0.3); }
.badge-climber { background: rgba(76, 175, 80, 0.15); color: #66bb6a; border: 1px solid rgba(76, 175, 80, 0.3); }
.badge-mi { background: rgba(156, 39, 176, 0.15); color: #ba68c8; border: 1px solid rgba(156, 39, 176, 0.3); }
.badge-coping-high { background: rgba(76, 175, 80, 0.15); color: #66bb6a; border: 1px solid rgba(76, 175, 80, 0.3); }
.badge-coping-mid { background: rgba(3, 169, 244, 0.15); color: #29b6f6; border: 1px solid rgba(3, 169, 244, 0.3); }
.badge-coping-low { background: rgba(244, 67, 54, 0.15); color: #ef5350; border: 1px solid rgba(244, 67, 54, 0.3); }

/* Form Layout */
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 1.5rem;
  margin-bottom: 2rem;
}

.form-section {
  border: 1px solid var(--card-border);
  background: rgba(41, 37, 60, 0.25);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 2rem;
}

.form-section-title {
  font-family: 'Outfit', sans-serif;
  font-size: 1.15rem;
  margin-bottom: 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid rgba(125, 49, 123, 0.3);
  color: #f3a3ff;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}

.form-group label {
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-control {
  background: rgba(18, 16, 27, 0.6);
  border: 1px solid rgba(125, 49, 123, 0.45);
  color: var(--white);
  padding: 0.75rem 1rem;
  border-radius: 8px;
  font-family: 'Inter', sans-serif;
  font-size: 0.95rem;
  transition: var(--transition);
  width: 100%;
}

.form-control:focus {
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(171, 71, 188, 0.25);
  outline: none;
  background: rgba(18, 16, 27, 0.8);
}

.text-danger {
  color: #ef5350;
  font-size: 0.8rem;
  margin-top: 0.25rem;
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 4rem 2rem;
  color: var(--text-muted);
}

.empty-state i {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: rgba(125, 49, 123, 0.4);
}

/* Configuration Page Layout */
.config-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 2rem;
}

.config-sidebar {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  border-radius: var(--radius);
  padding: 1.5rem;
  height: fit-content;
}

.config-nav-item {
  display: block;
  padding: 0.75rem 1rem;
  color: var(--text-muted);
  border-radius: 8px;
  margin-bottom: 0.5rem;
  font-family: 'Outfit', sans-serif;
  font-weight: 500;
  transition: var(--transition);
}

.config-nav-item:hover, .config-nav-item.active {
  background: rgba(125, 49, 123, 0.2);
  color: var(--white);
}

/* --- REPORT SCREEN DISPLAY STYLES --- */
.report-view-body {
  background-color: #12101b;
  color: #f3f3f6;
}

.report-controls {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(24, 21, 36, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(125, 49, 123, 0.15);
  padding: 1rem 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.37);
  color: var(--white);
}

.report-controls h2 {
  font-size: 1.25rem;
}

.report-pages-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  padding: 30px 20px;
  max-width: 100%;
}

/* A4 Page Formatting on Screen */
.report-page {
  width: 210mm;
  height: 297mm;
  background-color: var(--white);
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  position: relative;
  overflow: hidden;
  padding: 20mm 18mm;
  display: flex;
  flex-direction: column;
  color: #333333;
  font-size: 10.5pt;
  font-family: 'Inter', sans-serif;
  box-sizing: border-box;
}

/* COVER PAGE SPECIFICS */
.report-page.cover-page {
  padding: 0;
  justify-content: space-between;
  align-items: center;
}

.cover-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

.cover-header {
  position: absolute;
  top: 30mm;
  left: 0;
  width: 100%;
  z-index: 2;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: radial-gradient(circle, rgba(24, 21, 36, 0.6) 0%, rgba(24, 21, 36, 0) 80%);
  padding: 8mm 0;
}

.cover-logo {
  height: 25mm;
  margin-bottom: 5mm;
  object-fit: contain;
}

.cover-title-main {
  font-family: 'Outfit', sans-serif;
  font-size: 32pt;
  font-weight: 800;
  color: #ffcc00;
  text-shadow: -2px -2px 0 #181524, 2px -2px 0 #181524, -2px 2px 0 #181524, 2px 2px 0 #181524, 0 4px 12px rgba(0,0,0,0.8);
  line-height: 1.0;
  margin-top: 4mm;
  letter-spacing: 2px;
}

.cover-title-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 20pt;
  font-weight: 700;
  color: #ffcc00;
  text-shadow: -1.5px -1.5px 0 #181524, 1.5px -1.5px 0 #181524, -1.5px 1.5px 0 #181524, 1.5px 1.5px 0 #181524, 0 3px 10px rgba(0,0,0,0.8);
  line-height: 1.1;
  margin-top: 2mm;
  letter-spacing: 1px;
}

.cover-school {
  font-family: 'Outfit', sans-serif;
  font-size: 24pt;
  font-weight: 700;
  color: #ffcc00;
  text-shadow: -2px -2px 0 #181524, 2px -2px 0 #181524, -2px 2px 0 #181524, 2px 2px 0 #181524, 0 4px 10px rgba(0,0,0,0.8);
  line-height: 1.1;
  margin-top: 3mm;
  letter-spacing: 1.5px;
}

.cover-subtitle {
  font-family: 'Outfit', sans-serif;
  font-size: 13pt;
  font-weight: 600;
  color: #ffcc00;
  text-shadow: -1px -1px 0 #181524, 1px -1px 0 #181524, -1px 1px 0 #181524, 1px 1px 0 #181524, 0 2px 6px rgba(0,0,0,0.8);
  margin-top: 3mm;
  letter-spacing: 0.5px;
}

.cover-illustration {
  position: absolute;
  top: 110mm;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  height: 85mm;
  object-fit: contain;
}

.cover-student-card {
  position: absolute;
  bottom: 30mm;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  background: rgba(255, 255, 255, 0.82);
  backdrop-filter: blur(15px);
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 16px;
  width: 75%;
  padding: 8mm 10mm;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.cover-student-card table {
  width: 100%;
  border-collapse: collapse;
}

.cover-student-card td {
  padding: 4px 6px;
  font-size: 11pt;
  color: #29253C;
}

.cover-student-card td.label {
  font-weight: 600;
  width: 30%;
}

.cover-student-card td.val {
  font-weight: 400;
}

/* REGULAR PAGE HEADER & FOOTER */
.page-header-banner {
  background: linear-gradient(135deg, var(--primary) 0%, #a23da2 100%);
  height: 12mm;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  display: flex;
  align-items: center;
  padding: 0 18mm;
}

.page-header-banner span {
  color: var(--white);
  font-family: 'Outfit', sans-serif;
  font-weight: 600;
  font-size: 10pt;
  letter-spacing: 0.5px;
}

.page-footer {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  padding: 8mm 18mm;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
}

.page-footer span.footer-text {
  font-size: 8pt;
  color: #888888;
}

.page-footer span.page-number {
  background: var(--primary);
  color: var(--white);
  width: 8mm;
  height: 8mm;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 9pt;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
}

.page-body {
  margin-top: 4mm;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding-bottom: 12mm;
}

/* Page Layout Components inside Report */
.report-title-section {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  border-bottom: 2.5px solid var(--primary);
  padding-bottom: 4px;
  margin-bottom: 14px;
}

.report-title-section h2 {
  color: var(--primary);
  font-size: 16pt;
  font-family: 'Outfit', sans-serif;
  font-weight: 700;
  text-transform: uppercase;
}

.report-title-section .subtitle-tag {
  background: var(--secondary);
  color: var(--white);
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 8.5pt;
  font-weight: 600;
  text-transform: uppercase;
}

.report-card-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}

.report-card {
  border: 1px solid rgba(125, 49, 123, 0.15);
  border-radius: 8px;
  padding: 12px 14px;
  background-color: #faf9fb;
}

.report-card.highlighted-style {
  border: 2px solid var(--primary);
  background-color: rgba(125, 49, 123, 0.03);
  box-shadow: 0 4px 12px rgba(125, 49, 123, 0.05);
}

.report-card h3 {
  color: var(--secondary);
  font-size: 11pt;
  font-weight: 700;
  margin-bottom: 6px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.report-card h3 i {
  color: var(--primary);
}

.report-card ul {
  padding-left: 14px;
}

.report-card li {
  margin-bottom: 5px;
  font-size: 9.5pt;
  color: #444;
  text-align: justify;
}

/* Style for Graph Containers */
.report-graph-box {
  display: flex;
  gap: 20px;
  align-items: center;
  margin-bottom: 12px;
  background-color: rgba(41, 37, 60, 0.02);
  border-radius: 10px;
  padding: 12px;
  border: 1px solid rgba(0,0,0,0.04);
}

.graph-canvas-container {
  width: 140px;
  height: 140px;
  flex-shrink: 0;
}

.graph-legend {
  flex: 1;
}

.legend-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 4px 0;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

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

.legend-color-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 9.5pt;
  font-weight: 500;
}

.legend-color-box {
  width: 12px;
  height: 12px;
  border-radius: 3px;
}

.legend-val {
  font-weight: 700;
  font-size: 9.5pt;
}

/* AQ Levels Styling */
.aq-level-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 8px;
  margin-bottom: 14px;
}

.aq-level-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 10px;
  background-color: #fafafa;
  text-align: center;
  transition: var(--transition);
}

.aq-level-card.active {
  border: 2px solid var(--primary);
  background-color: rgba(125, 49, 123, 0.04);
  box-shadow: 0 4px 15px rgba(125, 49, 123, 0.1);
}

.aq-level-card .score-range {
  font-size: 8pt;
  color: #666;
  font-weight: 600;
  margin-bottom: 4px;
}

.aq-level-card h4 {
  font-size: 11pt;
  color: #333;
  margin-bottom: 6px;
}

.aq-level-card.active h4 {
  color: var(--primary);
  font-weight: 700;
}

.aq-level-card p {
  font-size: 8.5pt;
  color: #555;
  text-align: justify;
}

/* CORE Profile Grid */
.core-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-top: 10px;
}

.core-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 8px;
  padding: 10px 12px;
  background-color: #fcfcfc;
}

.core-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1.5px solid rgba(125, 49, 123, 0.15);
  padding-bottom: 4px;
  margin-bottom: 6px;
}

.core-card-header h4 {
  color: var(--secondary);
  font-size: 10.5pt;
  font-weight: 700;
}

.core-card-header .core-score-badge {
  background: var(--primary);
  color: var(--white);
  font-size: 8.5pt;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
}

.core-card p {
  font-size: 8.5pt;
  color: #555;
  text-align: justify;
  margin-bottom: 4px;
}

.core-desc-row {
  margin-top: 4px;
  font-size: 8pt;
  line-height: 1.3;
}

.core-desc-row strong {
  color: var(--primary-dark);
}

/* Multiple Intelligences Bar Chart and Styles */
.mi-graph-container {
  background-color: #faf9fb;
  border: 1px solid rgba(0,0,0,0.05);
  border-radius: 10px;
  padding: 10px;
  margin-bottom: 12px;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 160px;
}

.mi-list-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mi-card {
  border: 1px solid rgba(0, 0, 0, 0.06);
  background-color: #fafafa;
  border-radius: 6px;
  padding: 8px 10px;
}

.mi-card.top-intelligence {
  border: 1.5px solid var(--primary);
  background-color: rgba(125, 49, 123, 0.02);
}

.mi-card h4 {
  font-size: 9.5pt;
  color: var(--secondary);
  font-weight: 700;
  margin-bottom: 3px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.mi-card h4 span.score-badge {
  font-size: 8pt;
  background: rgba(125, 49, 123, 0.1);
  color: var(--primary);
  padding: 1px 4px;
  border-radius: 3px;
}

.mi-card.top-intelligence h4 span.score-badge {
  background: var(--primary);
  color: var(--white);
}

.mi-card p {
  font-size: 8pt;
  color: #555;
  text-align: justify;
  line-height: 1.3;
}

/* Kemampuan Mengatasi Masalah Styles */
.coping-gauge-container {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 8px;
  margin-bottom: 12px;
  background-color: rgba(0, 0, 0, 0.02);
  border-radius: 8px;
  padding: 10px;
  border: 1px solid rgba(0,0,0,0.03);
}

.coping-bar-labels {
  display: flex;
  justify-content: space-between;
  font-size: 8pt;
  color: #666;
  font-weight: 600;
}

.coping-bar-bg {
  height: 8mm;
  background-color: #e0e0e0;
  border-radius: 4px;
  position: relative;
  overflow: hidden;
  display: flex;
}

.coping-segment {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-size: 8pt;
  font-weight: 600;
}

.coping-segment.s1 { background-color: #f44336; width: 50%; } /* Kurang Tenang: <30 (0-30/60 = 50%) */
.coping-segment.s2 { background-color: #ff9800; width: 23.33%; } /* Cukup Tenang: 31-44 (14/60 = 23.33%) */
.coping-segment.s3 { background-color: #4caf50; width: 26.67%; } /* Sangat Tenang: 45-60 (16/60 = 26.67%) */

.coping-marker {
  position: absolute;
  top: -2px;
  width: 4px;
  height: calc(100% + 4px);
  background-color: #000;
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
}

.coping-marker-label {
  position: absolute;
  top: -12px;
  transform: translateX(-50%);
  background: #000;
  color: #fff;
  font-size: 6.5pt;
  font-weight: 700;
  padding: 0px 4px;
  border-radius: 3px;
}

.coping-desc-box {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}

.coping-desc-card {
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 6px;
  padding: 8px;
  background-color: #fafafa;
  text-align: center;
}

.coping-desc-card.active {
  border: 2px solid var(--primary);
  background-color: rgba(125, 49, 123, 0.04);
}

.coping-desc-card h4 {
  font-size: 9.5pt;
  color: #333;
  margin-bottom: 4px;
}

.coping-desc-card.active h4 {
  color: var(--primary);
  font-weight: 700;
}

.coping-desc-card p {
  font-size: 8pt;
  color: #555;
  text-align: justify;
}

/* Page Spacing and Adjustments */
.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 12px; }
.mb-4 { margin-bottom: 16px; }

/* --- MOBILE VIEWPORT RESPONSIVE PREVIEW & LAYOUTS --- */
@media screen and (max-width: 794px) {
  /* Layout adjustments for Admin & Portal Dashboard */
  .app-layout {
    flex-direction: column !important;
  }
  
  .app-sidebar {
    position: static !important;
    width: 100% !important;
    height: auto !important;
    padding: 1.25rem !important;
    border-right: none !important;
    border-bottom: 1px solid rgba(125, 49, 123, 0.15) !important;
  }
  
  .sidebar-logo {
    margin-bottom: 1.5rem !important;
    justify-content: center !important;
  }
  
  .sidebar-nav {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
    gap: 6px !important;
  }
  
  .nav-item {
    padding: 0.5rem 0.85rem !important;
    font-size: 0.85rem !important;
    border-radius: 8px !important;
  }
  
  .sidebar-footer {
    display: none !important;
  }
  
  .app-content {
    margin-left: 0 !important;
    padding: 1.25rem 1rem !important;
    width: 100% !important;
  }
  
  header.dash-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1.25rem !important;
    padding: 1.25rem !important;
  }
  
  header.dash-header .header-actions {
    width: 100% !important;
    flex-direction: column !important;
    gap: 0.75rem !important;
  }
  
  header.dash-header .header-actions .btn {
    width: 100% !important;
  }
  
  .stats-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .content-card {
    padding: 1.25rem 1rem !important;
  }
  
  .content-card-header {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 1rem !important;
  }
  
  .content-card-header div, 
  .content-card-header h2 {
    width: 100% !important;
  }
  
  /* Student Portal Specifics */
  .portal-container {
    padding: 1.5rem 0.75rem !important;
  }
  
  .profile-card {
    padding: 1.5rem 1.25rem !important;
  }
  
  .profile-grid {
    grid-template-columns: 1fr !important;
    gap: 12px !important;
  }
  
  /* Config Page Specifics */
  .config-layout {
    grid-template-columns: 1fr !important;
    gap: 1.5rem !important;
  }
  
  .config-sidebar {
    width: 100% !important;
  }
  
  .config-sidebar .config-nav-item {
    display: inline-block !important;
    margin-right: 0.5rem !important;
    margin-bottom: 0.5rem !important;
    padding: 0.55rem 0.85rem !important;
    font-size: 0.85rem !important;
  }
  
  /* Form Grids & Sections */
  .form-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  
  .form-section {
    padding: 1.25rem 1rem !important;
  }

  /* Filter Grid (master_siswa.php) */
  .filter-grid {
    grid-template-columns: 1fr !important;
    gap: 1rem !important;
  }
  .filter-grid .filter-group {
    grid-column: span 1 !important;
  }

  /* Report Pages Preview scaling on mobile */
  .report-pages-container {
    padding: 15px 0 !important;
    width: 100% !important;
    overflow-x: auto !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
  }
  
  .report-page {
    margin: 0 0 15px 0 !important;
    box-shadow: 0 5px 20px rgba(0,0,0,0.15) !important;
  }
  
  .report-controls {
    padding: 0.75rem 1rem !important;
    flex-direction: column !important;
    gap: 10px !important;
    text-align: center !important;
  }
  
  .report-controls h2 {
    font-size: 1rem !important;
  }
  
  .report-controls .header-actions {
    width: 100% !important;
    justify-content: center !important;
  }
  
  .report-controls .btn {
    padding: 0.5rem 1rem !important;
    font-size: 0.85rem !important;
    flex: 1 !important;
  }
}

/* --- PRINT MEDIA STYLES --- */
@media print {
  @page {
    size: A4;
    margin: 0;
  }
  
  html, body {
    margin: 0 !important;
    padding: 0 !important;
    background: #FFFFFF !important;
    color: #000000 !important;
    width: 210mm !important;
    height: auto !important;
  }
  
  .no-print {
    display: none !important;
  }
  
  .report-pages-container {
    padding: 0 !important;
    gap: 0 !important;
    margin: 0 !important;
    width: 210mm !important;
    display: block !important;
  }
  
  .report-page {
    margin: 0 !important;
    border: none !important;
    box-shadow: none !important;
    page-break-after: always !important;
    page-break-inside: avoid !important;
    break-after: page !important;
    break-inside: avoid !important;
    width: 210mm !important;
    height: 297mm !important;
    padding: 20mm 18mm !important;
    background-color: #FFFFFF !important;
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
    overflow: hidden !important;
    box-sizing: border-box !important;
    zoom: 1 !important;
  }
  
  .report-page.cover-page {
    padding: 0 !important;
  }
  
  /* Ensure backgrounds and colors are printed exactly */
  * {
    -webkit-print-color-adjust: exact !important;
    print-color-adjust: exact !important;
  }
}
