@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
  /* Light Theme Colors */
  --bg-primary: #f8fafc;        /* Off-white background */
  --bg-secondary: #ffffff;      /* White sidebar & cards */
  --bg-card: #ffffff;
  --border-color: #e2e8f0;      /* Light gray border */
  --border-focus: #3b82f6;      /* Blue border focus */
  
  --text-primary: #1e293b;
  --text-secondary: #64748b;
  --text-muted: var(--text-secondary);
  
  --color-primary: #2563eb;     /* Blue (Primary) */
  --color-primary-hover: #1d4ed8;
  --color-accent: #f97316;      /* Orange (Accent) */
  --color-accent-hover: #ea580c;
  --color-success: #10b981;     /* Green */
  --color-warning: #f59e0b;     /* Amber */
  --color-danger: #ef4444;      /* Red */
  --color-info: #06b6d4;        /* Cyan */
  
  --gradient-brand: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #f97316 100%);
  --gradient-card-active: linear-gradient(135deg, rgba(37, 99, 235, 0.05) 0%, rgba(249, 115, 22, 0.02) 100%);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.05), 0 4px 6px -2px rgba(0, 0, 0, 0.03);
  
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-size-page: 1.75rem;
  --font-size-section: 1.125rem;
  --font-size-modal: 1.25rem;
  --font-size-body: 0.875rem;
  --font-size-support: 0.8125rem;
  --font-size-caption: 0.75rem;
  --font-weight-regular: 400;
  --font-weight-medium: 500;
  --font-weight-semibold: 600;
  --font-weight-bold: 700;
  --line-height-body: 1.5;
  --line-height-heading: 1.3;
  --sidebar-motion-duration: 320ms;
  --sidebar-motion-easing: cubic-bezier(0.22, 1, 0.36, 1);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --radius-xl: 30px;
  
  --transition-fast: background-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.15s cubic-bezier(0.4, 0, 0.2, 1), color 0.15s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.15s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-normal: background-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), border-color 0.25s cubic-bezier(0.4, 0, 0.2, 1), color 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Reset & Base Styles */
html {
  font-size: 100%;
}

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

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-body);
  background-color: var(--bg-primary);
  color: var(--text-primary);
  min-height: 100vh;
  display: flex;
  overflow-x: hidden;
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.04) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(249, 115, 22, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
}

body.modal-open {
  overflow: hidden;
}

/* Native controls and dialogs do not consistently inherit the body font. */
:where(button, input, select, textarea, dialog) {
  font-family: inherit;
  font-size: inherit;
  line-height: var(--line-height-body);
}

:where(h1, h2, h3) {
  line-height: var(--line-height-heading);
  overflow-wrap: anywhere;
}

:where(input, textarea)::placeholder {
  color: var(--text-secondary);
  opacity: 1;
}

/* Background Wave Elements (GPU Accelerated) */
.bg-wave-container {
  position: fixed;
  top: 0;
  right: 0;
  width: 400px;
  height: 400px;
  z-index: -1;
  pointer-events: none;
  opacity: 0.85;
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.bg-wave-container svg {
  transform: translate3d(0, 0, 0);
  will-change: transform;
}

.bg-wave-container svg path {
  filter: drop-shadow(-4px 4px 8px rgba(0, 0, 0, 0.1));
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}
::-webkit-scrollbar-track {
  background: var(--bg-primary);
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.1);
  border-radius: 4px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.2);
}

/* Sidebar Layout */
aside {
  width: 280px;
  background-color: var(--bg-secondary);
  border-right: 1px solid var(--border-color);
  padding: 2rem 1.5rem;
  display: flex;
  flex-direction: column;
  position: fixed;
  height: 100vh;
  left: 0;
  top: 0;
  z-index: 100;
  transition: transform var(--sidebar-motion-duration) var(--sidebar-motion-easing),
    opacity var(--sidebar-motion-duration) var(--sidebar-motion-easing),
    visibility 0s linear var(--sidebar-motion-duration);
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.02);
}

.logo-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  gap: 0.75rem;
  margin-bottom: 3rem;
}

.logo-container > div {
  min-width: 0;
}

.logo-icon {
  width: 40px;
  height: 40px;
  background: var(--gradient-brand);
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.2);
}

.logo-brand-container {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.logo-text {
  font-size: 1.25rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.5px;
  line-height: 1.1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.logo-subtext {
  font-size: 0.58rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  letter-spacing: -0.1px;
  margin-top: 2px;
  text-transform: uppercase;
}

.nav-menu {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.sidebar-nav {
  width: 100%;
  min-width: 0;
}

.nav-item a {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 0.85rem 1rem;
  color: var(--text-secondary);
  text-decoration: none;
  border-radius: var(--radius-md);
  font-weight: var(--font-weight-medium);
  font-size: var(--font-size-body);
  transition: var(--transition-fast);
  min-height: 44px;
}

.nav-item a:hover {
  color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.05);
}

.nav-item.active a {
  color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.08);
  border: 1px solid rgba(37, 99, 235, 0.15);
  font-weight: var(--font-weight-semibold);
}

.sidebar-footer {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-color);
  font-size: 0.75rem;
  color: var(--text-muted);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

/* Main Content Area */
main {
  margin-left: 280px;
  flex: 1;
  min-width: 0;
  padding: 2.5rem;
  max-width: 100%;
  transition: var(--transition-normal),
    margin-left var(--sidebar-motion-duration) var(--sidebar-motion-easing);
}

/* Header */
header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2.5rem;
}

.header-title h1 {
  font-size: var(--font-size-page);
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.5px;
  margin-bottom: 0.25rem;
  color: var(--text-primary);
  overflow-wrap: anywhere;
  line-height: var(--line-height-heading);
}

.header-title,
.header-title > div {
  min-width: 0;
}

.header-title p {
  color: var(--text-secondary);
  font-size: var(--font-size-support);
}

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

.realtime-clock {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  padding: 0.6rem 1.2rem;
  border-radius: var(--radius-md);
  font-size: var(--font-size-support);
  color: var(--text-secondary);
  font-weight: var(--font-weight-regular);
  display: flex;
  align-items: center;
  gap: 0.5rem;
  box-shadow: var(--shadow-sm);
  line-height: var(--line-height-body);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--color-success);
  border-radius: 50%;
  box-shadow: 0 0 8px var(--color-success);
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
  70% { transform: scale(1); box-shadow: 0 0 0 6px rgba(16, 185, 129, 0); }
  100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

/* View Visibility & Animations */
.view-section {
  display: none;
  animation: viewFadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.view-section.active {
  display: block;
}

.padded-view {
  padding: 1.5rem;
}

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

/* Stats Cards Grid */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.stat-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  transition: var(--transition-normal);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.stat-card:hover {
  transform: translateY(-4px);
  border-color: rgba(37, 99, 235, 0.2);
  box-shadow: var(--shadow-md);
  background: var(--gradient-card-active);
}

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

.stat-card.total::after { background: var(--color-primary); }
.stat-card.active::after { background: var(--color-accent); }
.stat-card.completed::after { background: var(--color-success); }
.stat-card.universities::after { background: var(--color-info); }

.stat-info {
  min-width: 0;
}

.stat-info h3 {
  font-size: var(--font-size-section);
  text-transform: none;
  color: var(--text-secondary);
  letter-spacing: normal;
  margin-bottom: 0.5rem;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-heading);
}

.stat-number {
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-primary);
  line-height: 1;
}

.stat-icon-wrapper {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  transition: var(--transition-normal);
}

.stat-card:hover .stat-icon-wrapper {
  transform: scale(1.1);
}

.stat-card.total .stat-icon-wrapper { color: var(--color-primary); background: rgba(37, 99, 235, 0.06); }
.stat-card.active .stat-icon-wrapper { color: var(--color-accent); background: rgba(249, 115, 22, 0.06); }
.stat-card.completed .stat-icon-wrapper { color: var(--color-success); background: rgba(16, 185, 129, 0.06); }
.stat-card.universities .stat-icon-wrapper { color: var(--color-info); background: rgba(6, 182, 212, 0.06); }

/* Dashboard Widgets */
#view-dashboard {
  --dashboard-stat-size: 2rem;
  --dashboard-panel-title-size: 1.125rem;
  --dashboard-campus-count-size: 1.125rem;
  --dashboard-placement-count-size: 1.75rem;
  --dashboard-heading-line-height: 1.25;
}

main:has(> #view-dashboard.active) #view-title {
  line-height: 1.25;
}

#view-dashboard .stat-info h3 {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-body);
}

#view-dashboard .stat-number {
  font-size: var(--dashboard-stat-size);
  font-weight: var(--font-weight-bold);
  line-height: var(--dashboard-heading-line-height);
  font-variant-numeric: tabular-nums;
  overflow-wrap: anywhere;
}

#view-dashboard .widget-header h3 {
  font-size: var(--dashboard-panel-title-size);
  line-height: var(--dashboard-heading-line-height);
}

/* Keep white panel titles readable across each gradient. */
#view-dashboard .widget-header.header-green {
  background: linear-gradient(135deg, #047857, #065f46);
}

#view-dashboard .widget-header.header-orange {
  background: linear-gradient(135deg, #c2410c, #9a3412);
}

#view-dashboard .univ-progress-info {
  align-items: flex-start;
  gap: 1rem;
  margin-bottom: 0;
  font-weight: var(--font-weight-medium);
}

#view-dashboard :is(.univ-progress-name, .placement-name) {
  min-width: 0;
  overflow-wrap: anywhere;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  line-height: var(--line-height-body);
  color: var(--text-primary);
}

#view-dashboard :is(.univ-student-count, .placement-student-count) {
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
  line-height: var(--dashboard-heading-line-height);
}

#view-dashboard .univ-student-count {
  color: var(--color-primary);
  font-size: var(--dashboard-campus-count-size);
  font-weight: var(--font-weight-semibold);
}

#view-dashboard .placement-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
}

#view-dashboard .placement-item:not(:last-child) {
  border-bottom: 1px solid var(--border-color);
}

#view-dashboard .placement-student-count {
  color: var(--color-accent);
  font-size: var(--dashboard-placement-count-size);
  font-weight: var(--font-weight-bold);
}

#view-dashboard .recent-item {
  gap: 0.75rem;
}

.dashboard-widgets-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr));
  gap: 1.5rem;
  margin-top: 1.5rem;
  align-items: start;
}

.dashboard-widgets-grid > *,
.widget-body {
  min-width: 0;
}

.widget-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.widget-header {
  padding: 1rem 1.5rem;
  text-align: center;
  border-bottom: 1px solid var(--border-color);
}

.widget-header.header-blue {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
}

.widget-header.header-green {
  background: linear-gradient(135deg, #10b981 0%, #059669 100%);
}

.widget-header.header-orange {
  background: linear-gradient(135deg, #f97316 0%, #ea580c 100%);
}

.widget-header h3 {
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-semibold);
  color: #ffffff;
  margin: 0;
  line-height: var(--line-height-heading);
}

.widget-body {
  flex: 1;
  padding: 1.5rem;
}

/* University progress items */
.univ-progress-item {
  margin-bottom: 1.25rem;
}

.univ-progress-item:last-child {
  margin-bottom: 0;
}

.univ-progress-info {
  display: flex;
  justify-content: space-between;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.5rem;
  color: var(--text-secondary);
}

.univ-progress-name {
  color: var(--text-primary);
}

.univ-progress-bar-bg {
  height: 8px;
  background-color: #f1f5f9;
  border-radius: 4px;
  overflow: hidden;
}

.univ-progress-bar-fill {
  height: 100%;
  background: var(--color-primary);
  border-radius: 4px;
  transition: width 0.6s ease-in-out;
}

/* Recent active list */
.recent-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background-color: #f8fafc;
  transition: var(--transition-fast);
}

.recent-item:hover {
  transform: translateX(4px);
  border-color: rgba(37, 99, 235, 0.2);
  background-color: #f1f5f9;
}

.recent-item-info {
  min-width: 0;
  overflow-wrap: anywhere;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.recent-item-name {
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-body);
  color: var(--text-primary);
}

.recent-item-univ {
  font-size: var(--font-size-support);
  color: var(--text-secondary);
}

/* Dashboard Controls (Search & Filters) */
.controls-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  margin-bottom: 2rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.25rem;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--shadow-sm);
}

.search-wrapper {
  position: relative;
  flex: 1;
  min-width: 280px;
}

.search-icon {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
}

.search-input {
  width: 100%;
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem 0.75rem 2.75rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-body);
  transition: var(--transition-fast);
  font-weight: var(--font-weight-regular);
}

.search-input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: #ffffff;
}

.filters-wrapper {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
}

.filter-select {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-body);
  cursor: pointer;
  outline: none;
  transition: var(--transition-fast);
  font-weight: var(--font-weight-regular);
}

.filter-select:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-select option {
  background-color: #ffffff;
  color: var(--text-primary);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  border: 1px solid transparent;
  transition: var(--transition-fast);
  white-space: normal;
  overflow-wrap: anywhere;
}

.btn-primary {
  background: var(--color-primary);
  color: white;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
  transform: translateY(-1px);
}

.btn-secondary {
  background: #f1f5f9;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
}

.btn-secondary:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

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

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

.table-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  margin-bottom: 2rem;
  width: 100%;
  max-width: 100%;
}

.table-header-bar {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fafafa;
}

.table-header-bar h2 {
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-heading);
}

.table-header-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.5rem 1rem;
  margin-left: auto;
  color: var(--text-secondary);
  font-size: var(--font-size-support);
}

.page-size-label {
  font-size: var(--font-size-support);
  font-weight: var(--font-weight-regular);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  white-space: nowrap;
}

.page-size-label .filter-select {
  min-width: 4.75rem;
  padding: 0.4rem 0.55rem;
}

.table-pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--border-color);
  color: var(--text-secondary);
  font-size: var(--font-size-support);
}

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

.pagination-actions .btn {
  font-size: var(--font-size-support);
  font-weight: var(--font-weight-regular);
}

#table-page-info {
  min-width: 6.5rem;
  text-align: center;
  white-space: nowrap;
}

.table-wrapper {
  overflow-x: auto;
  overflow-y: auto;
  max-height: calc(100vh - 200px);
  width: 100%;
  -webkit-overflow-scrolling: touch;
}

/* Custom Horizontal Scrollbar */
.table-wrapper::-webkit-scrollbar {
  height: 18px;
}

.table-wrapper::-webkit-scrollbar-track {
  background: #f8fafc;
  border-radius: 9px;
  border: 1px solid rgba(249, 115, 22, 0.15);
}

.table-wrapper::-webkit-scrollbar-thumb {
  background: linear-gradient(to right, var(--color-primary), var(--color-accent));
  border-radius: 9px;
  border: 4px solid #f8fafc;
}

.table-wrapper::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to right, var(--color-primary-hover), var(--color-accent-hover));
}

.table-wrapper table {
  min-width: 1200px;
}

.scroll-helper {
  display: none;
  font-size: var(--font-size-support);
  color: var(--text-secondary);
}

.mobile-export-select {
  display: none;
  align-items: center;
  gap: 0.5rem;
  font-size: var(--font-size-support);
  color: var(--text-secondary);
}

.select-student-checkbox,
.mobile-export-select input {
  width: 20px;
  height: 20px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.suket-config-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: clamp(1rem, 3vw, 1.5rem);
  margin-bottom: 1.25rem;
}

.suket-print-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

#suket-mailing-dialog {
  width: min(760px, calc(100% - 2rem));
  max-height: calc(100vh - 2rem);
  padding: 0;
  border: 0;
  border-radius: var(--radius-lg);
  overflow: auto;
}

#suket-mailing-dialog::backdrop { background: rgb(15 23 42 / 60%); }
#suket-mailing-dialog .suket-config-card { margin: 0; }

#suket-mailing-dialog h2 {
  font-size: var(--font-size-modal);
  font-weight: var(--font-weight-semibold);
}

.suket-config-card h2 {
  font-size: var(--font-size-section);
  margin-bottom: 0.35rem;
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-heading);
}

.suket-config-card p {
  color: var(--text-secondary);
  font-size: var(--font-size-body);
  margin-bottom: 1.25rem;
}

#suket-print-summary {
  display: block;
  margin-top: 0.4rem;
  color: var(--text-secondary);
  overflow-wrap: anywhere;
}

.suket-table-header {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.suket-table-header > span {
  color: var(--text-secondary);
  font-size: var(--font-size-support);
}

#suket-table {
  min-width: 950px;
}

.select-all-label {
  font-size: inherit;
  font-weight: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  color: #fff;
  cursor: pointer;
}

#suket-table input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--color-primary);
  cursor: pointer;
}

.suket-print-note {
  display: block;
  margin-top: 0.5rem;
  color: var(--text-secondary);
}

table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
}

#view-settings table {
  min-width: 22rem;
}

#view-settings td .btn {
  white-space: nowrap;
}

thead {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--gradient-brand);
}

thead tr {
  background: transparent;
}

th {
  background-color: transparent;
  padding: 1rem 1.125rem;
  font-weight: var(--font-weight-semibold);
  color: #ffffff;
  border-bottom: none;
  font-size: var(--font-size-caption);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* Align headers to match their contents */
th { text-align: center !important; }
th:nth-child(1) { width: 70px; } /* Pilih */

td {
  padding: 1rem 1.125rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
  vertical-align: middle;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-regular);
  overflow-wrap: anywhere;
  white-space: normal;
}

tr {
  transition: var(--transition-fast);
}

tbody tr:hover {
  background-color: #f8fafc;
}

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

/* Status Badges */
.badge {
  white-space: nowrap;
  overflow-wrap: normal;
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.3rem 0.75rem;
  border-radius: var(--radius-xl);
  font-size: var(--font-size-caption);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

.badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

.badge-active {
  background-color: rgba(249, 115, 22, 0.1);
  color: var(--color-accent);
  border: 1px solid rgba(249, 115, 22, 0.2);
}
.badge-active::before { background-color: var(--color-accent); }

.badge-completed {
  background-color: rgba(16, 185, 129, 0.1);
  color: var(--color-success);
  border: 1px solid rgba(16, 185, 129, 0.2);
}
.badge-completed::before { background-color: var(--color-success); }

.badge-upcoming {
  background-color: rgba(37, 99, 235, 0.1);
  color: var(--color-primary);
  border: 1px solid rgba(37, 99, 235, 0.2);
}
.badge-upcoming::before { background-color: var(--color-primary); }

/* Table Columns Specific Style */
.student-name-cell {
  min-width: 10rem;
  font-weight: var(--font-weight-semibold);
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-size: var(--font-size-body);
}

.student-nim {
  font-size: var(--font-size-support);
  color: var(--text-muted);
  font-weight: var(--font-weight-regular);
}

.univ-cell {
  min-width: 11rem;
  font-weight: var(--font-weight-regular);
  color: var(--text-secondary);
}

.date-cell {
  font-size: var(--font-size-body);
  color: var(--text-secondary);
  white-space: normal;
  min-width: 13rem;
}

.date-cell strong {
  font-weight: var(--font-weight-medium);
}

.letter-number-cell,
.placement-cell {
  min-width: 11rem;
  max-width: 18rem;
}

.actions-cell {
  display: flex;
  gap: 0.5rem;
}

.action-btn {
  white-space: nowrap;
  overflow-wrap: normal;
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-semibold);
  background: transparent;
  border: 1px solid var(--border-color);
  color: var(--text-secondary);
  cursor: pointer;
  padding: 0.5rem;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  min-width: 40px;
  min-height: 40px;
}

.action-btn:hover {
  color: var(--text-primary);
  border-color: #cbd5e1;
}

.action-btn.edit:hover {
  color: var(--color-primary);
  border-color: rgba(37, 99, 235, 0.3);
  background-color: rgba(37, 99, 235, 0.05);
}

.action-btn.delete:hover {
  color: var(--color-danger);
  border-color: rgba(239, 68, 68, 0.3);
  background-color: rgba(239, 68, 68, 0.05);
}

.action-btn.view:hover {
  color: var(--color-accent);
  border-color: rgba(249, 115, 22, 0.3);
  background-color: rgba(249, 115, 22, 0.05);
}

.empty-state {
  padding: 4rem 2rem;
  text-align: center;
  color: var(--text-secondary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.empty-icon {
  font-size: 3rem;
  color: var(--text-muted);
}

/* Modals (Form & Details) */
.modal-backdrop {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(15, 23, 42, 0.45);
  z-index: 10005;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity var(--transition-normal), visibility 0s linear 0.25s;
}

.modal-backdrop.show {
  opacity: 1;
  visibility: visible;
  pointer-events: all;
  transition: opacity var(--transition-normal);
}

.modal-content {
  background: #ffffff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 650px;
  max-height: calc(100dvh - 2rem);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition-normal);
}

.student-data-modal {
  max-width: 960px;
}

.modal-backdrop.show .modal-content {
  transform: translateY(0) scale(1);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #f8fafc;
}

.modal-header h2 {
  font-size: var(--font-size-modal);
  font-weight: var(--font-weight-semibold);
  color: var(--text-primary);
  min-width: 0;
  overflow-wrap: anywhere;
}

.modal-close-btn {
  background: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 1.5rem;
  transition: var(--transition-fast);
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex-shrink: 0;
  border-radius: 50%;
}

.modal-close-btn:hover {
  color: var(--text-primary);
  background-color: rgba(0, 0, 0, 0.05);
}

.modal-body {
  padding: 1.75rem;
}

/* Forms styling */
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.25rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  min-width: 0;
}

.form-group.full-width {
  grid-column: span 2;
}

label {
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-medium);
  color: var(--text-secondary);
}

.required-star {
  color: var(--color-danger);
}

.form-control {
  background-color: #f8fafc;
  border: 1px solid var(--border-color);
  color: var(--text-primary);
  padding: 0.75rem 1rem;
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: var(--font-size-body);
  transition: var(--transition-fast);
  width: 100%;
  min-width: 0;
  max-width: 100%;
  font-weight: var(--font-weight-regular);
}

.register-feedback {
  display: grid;
  grid-template-columns: 2.5rem minmax(0, 1fr);
  gap: 0.875rem;
  margin-top: 1.25rem;
  padding: 1.125rem;
  border: 1px solid #fecaca;
  border-radius: var(--radius-md);
  background: #fef2f2;
  color: #991b1b;
  overflow-wrap: anywhere;
}

.register-feedback[hidden] { display: none; }

.register-feedback[data-state="duplicate"] {
  background: #fffbeb;
  border-color: #fde68a;
  color: #92400e;
}

.register-feedback-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 50%;
  background: #fff;
}

.register-feedback h3 {
  margin: 0 0 0.375rem;
  font-size: 1rem;
  font-weight: var(--font-weight-bold);
  color: inherit;
}

.register-feedback p {
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.6;
  color: inherit;
}

.register-feedback:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.register-actions {
  display: flex;
  gap: 1rem;
  margin-top: 2rem;
}

.register-actions .btn:first-child { flex: 1; }
.register-actions .btn:last-child { flex: 2; }

.form-control:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
  background-color: #ffffff;
}

textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

.modal-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 1rem;
  background: #f8fafc;
}

/* Detail Card Specific layout */
.detail-profile-header {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex-wrap: wrap;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 1.5rem;
}

.detail-avatar {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-lg);
  background: var(--gradient-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 2rem;
  font-weight: var(--font-weight-bold);
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.2);
}

.detail-profile-title h3 {
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.25rem;
  line-height: var(--line-height-heading);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

.detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.detail-item.full-width {
  grid-column: span 2;
}

.detail-label {
  font-size: var(--font-size-body);
  text-transform: none;
  letter-spacing: normal;
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
}

.detail-value {
  font-size: var(--font-size-body);
  color: var(--text-primary);
  font-weight: var(--font-weight-regular);
  overflow-wrap: anywhere;
}

.detail-value-highlight {
  color: var(--color-primary);
  font-weight: var(--font-weight-semibold);
}

/* Login Page Styles */
.login-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: safe center;
  overflow-y: auto;
  padding: 1rem;
  z-index: 9999;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(249, 115, 22, 0.05) 0%, transparent 40%);
}

.login-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 2.5rem;
  width: 100%;
  max-width: 420px;
  box-shadow: var(--shadow-lg);
  animation: viewFadeIn 0.5s ease-out;
}

.login-header {
  text-align: center;
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.login-header .logo-icon {
  margin-bottom: 0.5rem;
}

.login-brand {
  font-size: 1.6rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.5px;
  line-height: 1.1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.login-subtext {
  font-size: 0.75rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  margin-top: 4px;
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.login-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
  margin-top: 6px;
}

.login-info-box {
  background-color: #f1f5f9;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
  text-align: left;
}

/* Conditional view hiding when logged out */
#view-login,
#view-register {
  display: none;
}

body.logged-out aside,
body.logged-out main {
  display: none !important;
}

body:not(.logged-out) #portal-view,
body:not(.logged-out) #view-login,
body:not(.logged-out) #view-register {
  display: none !important;
}

/* Portal View & Welcome Page Styles */
.portal-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: safe center;
  overflow-y: auto;
  padding: 1rem;
  z-index: 9999;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(249, 115, 22, 0.05) 0%, transparent 40%);
}

.portal-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 3rem 2.5rem;
  width: 100%;
  max-width: 460px;
  box-shadow: var(--shadow-lg);
  text-align: center;
  animation: viewFadeIn 0.5s ease-out;
}

.portal-header {
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.portal-brand {
  font-size: 1.8rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.5px;
  line-height: 1.1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.portal-subtext {
  font-size: 0.8rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

.portal-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
  margin-top: 8px;
  line-height: 1.4;
}

.portal-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.portal-btn svg {
  transition: transform var(--transition-fast);
}

.portal-btn:hover svg {
  transform: scale(1.1);
}

#login-session-notice {
  margin: 0 0 1.25rem;
  padding: 0.75rem 1rem;
  border: 1px solid #fde68a;
  border-radius: var(--radius-md);
  background: #fffbeb;
  color: #92400e;
  font-size: 0.9rem;
  line-height: 1.5;
}

/* Register View Styles */
.register-wrapper {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  z-index: 9999;
  overflow-y: auto;
  padding: clamp(1rem, 3vw, 2.5rem) 1rem;
  background-color: var(--bg-primary);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(37, 99, 235, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 90% 80%, rgba(249, 115, 22, 0.05) 0%, transparent 40%);
}

.register-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: clamp(1.25rem, 4vw, 2.5rem);
  width: 100%;
  max-width: 760px;
  box-shadow: var(--shadow-lg);
  animation: viewFadeIn 0.5s ease-out;
  margin-bottom: 1rem;
}

#register-form .form-grid {
  gap: 1.1rem 1.25rem;
}

#register-form .form-control {
  min-height: 48px;
  font-size: 0.95rem;
}

#reg-surat-file {
  padding: 0.4rem;
  font-size: 0.85rem;
}

#reg-surat-file::file-selector-button {
  margin-right: 0.75rem;
  padding: 0.55rem 0.75rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: #eaf1ff;
  color: var(--color-primary-hover);
  font: inherit;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
}

.register-univ-picker {
  position: relative;
  min-width: 0;
}

.register-univ-native {
  display: none;
}

.register-univ-options {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.35rem);
  left: 0;
  right: 0;
  max-height: min(16rem, 40dvh);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0.35rem;
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
}

.register-univ-options[hidden] {
  display: none;
}

.register-univ-options.opens-up {
  top: auto;
  bottom: calc(100% + 0.35rem);
}

.register-univ-option {
  display: block;
  width: 100%;
  padding: 0.7rem 0.8rem;
  border: 0;
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-primary);
  font: inherit;
  font-size: var(--font-size-body);
  text-align: left;
  overflow-wrap: anywhere;
  cursor: pointer;
  font-weight: var(--font-weight-regular);
}

.register-univ-option:hover,
.register-univ-option.is-active {
  background: #eff6ff;
  color: var(--color-primary-hover);
}

.register-univ-empty {
  padding: 0.75rem 0.8rem;
  color: var(--text-secondary);
  font-size: var(--font-size-support);
}

.register-header {
  text-align: center;
  margin-bottom: 1.75rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
}

.register-header .logo-icon {
  margin-bottom: 0.5rem;
}

.register-brand {
  font-size: 1.6rem;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.5px;
  line-height: 1.1;
  background: var(--gradient-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.register-subtext {
  font-size: 0.8rem;
  font-weight: var(--font-weight-bold);
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.2px;
}

@media (min-width: 640px) and (max-width: 1024px) {
  #register-form .form-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  #register-form .form-group.full-width {
    grid-column: span 2;
  }
}

.register-tagline {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: var(--font-weight-medium);
  margin-top: 6px;
  line-height: 1.4;
}

/* Responsive Styles */
@media (max-width: 1024px) {
  aside {
    width: 80px;
    padding: 2rem 0.5rem;
  }
  
  .logo-text, .nav-item-text {
    display: none;
  }
  
  .logo-container {
    justify-content: center;
    flex-direction: column;
    gap: 0.5rem;
    margin-bottom: 2.5rem;
  }

  .nav-item a {
    justify-content: center;
    padding: 1rem;
    font-size: var(--font-size-body);
  }
  
  main {
    margin-left: 80px;
    padding: 2rem;
  }
  
  /* Show logout button on tablet but hide copyright and button text */
  .sidebar-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }
  
  .sidebar-footer div {
    display: none;
  }
  
  .logout-text {
    display: none;
  }
  
  #btn-logout {
    width: 44px !important;
    height: 44px !important;
    padding: 0 !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0 !important;
  }
}

@media (max-width: 768px) {
  :root { --font-size-page: 1.5rem; }

  #view-dashboard {
    --dashboard-stat-size: 1.75rem;
    --dashboard-panel-title-size: 1rem;
  }

  .form-control, .search-input, .filter-select, .register-univ-option {
    font-size: 1rem;
  }

  body {
    flex-direction: column;
  }
  
  aside {
    width: 100%;
    height: auto;
    position: sticky;
    top: 0;
    z-index: 100;
    border-right: none;
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 1rem 0.5rem;
    box-shadow: var(--shadow-sm);
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .logo-container {
    margin-bottom: 0;
    width: 100%;
    display: flex;
    justify-content: flex-start;
    align-items: center;
    padding-right: 3rem;
  }

  .logo-text {
    display: block;
    font-size: 1.15rem;
  }
  
  .sidebar-footer {
    display: block;
    margin-top: 0;
    padding-top: 0;
    border-top: none;
    position: absolute;
    right: 1rem;
    top: 0.75rem;
    width: auto;
  }
  
  .sidebar-footer div {
    display: none;
  }
  
  .logout-text {
    display: none;
  }
  
  #btn-logout {
    margin-bottom: 0 !important;
    padding: 0 !important;
    width: 44px !important;
    height: 44px !important;
    border-radius: 50% !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  .nav-menu {
    flex-direction: row;
    justify-content: flex-start;
    margin-top: 0;
    width: 100%;
    gap: 0.5rem;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    padding: 0.2rem 0 0.45rem;
  }
  
  .nav-item {
    flex: 1 0 116px;
    scroll-snap-align: start;
  }
  
  .nav-item a {
    flex-direction: column;
    gap: 0.2rem;
    padding: 0.5rem 0.35rem;
    min-height: 66px;
    border-radius: var(--radius-sm);
    justify-content: center;
    align-items: center;
    font-size: var(--font-size-body);
  }
  
  .nav-item a svg {
    width: 18px;
    height: 18px;
  }
  
  .nav-item-text {
    display: block !important;
    font-size: var(--font-size-body);
    line-height: var(--line-height-body);
    text-align: center;
    white-space: normal;
    overflow-wrap: normal;
  }

  #btn-toggle-sidebar {
    display: none;
  }

  .bg-wave-container {
    opacity: 0.28;
    width: min(45vw, 220px);
    height: auto;
  }
  
  main {
    margin-left: 0;
    padding: 1rem;
  }

  .header-title h1 {
    font-size: var(--font-size-page);
    line-height: var(--line-height-heading);
  }
  
  header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
  }
  
  .header-actions {
    width: auto;
    max-width: 100%;
  }
  
  .realtime-clock {
    width: auto;
    max-width: 100%;
    padding: 0.55rem 0.8rem;
    line-height: var(--line-height-body);
    font-size: var(--font-size-support);
    font-weight: var(--font-weight-regular);
  }
  
  /* Adjust other dashboard elements */
  .stats-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    margin-bottom: 1.5rem;
  }
  
  .stat-card {
    padding: 1rem;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
  }
  
  .stat-icon-wrapper {
    order: -1;
    width: 40px;
    height: 40px;
  }
  
  .stat-number {
    font-size: 1.5rem;
  }
  
  .dashboard-widgets-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  /* Tables and forms */
  .controls-card {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.75rem;
  }
  
  .search-wrapper {
    min-width: 100%;
  }
  
  .filters-wrapper {
    flex-direction: column;
    align-items: stretch;
    width: 100%;
    gap: 0.5rem;
  }
  
  .controls-card .filter-select,
  .controls-card .btn,
  .modal-footer .btn,
  #btn-generate-suket-word { width: 100%; }
  
  .form-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 0.75rem;
  }
  
  .form-group.full-width {
    grid-column: span 1;
  }
  
  .detail-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }
  
  .detail-item.full-width {
    grid-column: span 1;
  }
  
  /* Modals */
  .modal-content {
    margin: 0;
    max-height: calc(100dvh - 1.5rem);
  }

  .modal-backdrop {
    padding: 0.75rem;
  }

  #view-settings,
  #view-suket-print {
    padding: 0;
  }
  
  .modal-body {
    padding: 1.25rem;
  }
  
  .modal-footer {
    padding: 1rem;
    flex-direction: column;
    align-items: stretch;
  }

  /* Authentication pages responsive styling */
  .login-card {
    padding: 1.5rem;
    margin: 0;
    max-width: 100%;
  }
  
  .portal-card {
    padding: 1.75rem 1.25rem;
    margin: 0;
    max-width: 100%;
  }
  
  .register-wrapper {
    padding: 1rem 0.75rem;
  }
  
  .register-card {
    padding: 1.5rem;
    margin-bottom: 0;
  }
  
  .register-header {
    margin-bottom: 1.5rem;
  }

  #register-form .form-grid {
    gap: 0.9rem;
  }

  .scroll-helper {
    display: block !important;
    margin-top: 4px;
    animation: pulse-helper 2.5s infinite;
    font-size: var(--font-size-support);
  }

  #view-students .scroll-helper {
    display: none !important;
  }

  .mobile-export-select {
    display: flex;
    width: 100%;
    min-height: 44px;
    font-size: var(--font-size-support);
  }

  #view-students .table-wrapper {
    max-height: none;
    overflow: visible;
  }

  #interns-table {
    display: block;
    min-width: 0;
  }

  #interns-table thead {
    display: none;
  }

  #interns-table tbody {
    display: grid;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  #interns-table tbody tr {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 0.65rem;
    padding: 1rem;
    background: var(--bg-card);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    min-width: 0;
  }

  #interns-table tbody td {
    display: none;
    min-width: 0;
    padding: 0;
    border: 0;
    overflow-wrap: anywhere;
  }

  #interns-table tbody td:nth-child(1) {
    display: block;
    grid-column: 2;
    grid-row: 1;
  }

  #interns-table tbody td:nth-child(2) {
    display: block;
    grid-column: 1;
    grid-row: 1;
  }

  #interns-table tbody td:nth-child(3) {
    display: block;
    grid-column: 1 / -1;
    grid-row: 2;
    font-size: var(--font-size-body);
  }

  #interns-table tbody td:nth-child(7) {
    display: block;
    grid-column: 1 / -1;
    grid-row: 4;
  }

  #interns-table tbody td:nth-child(7)::before {
    content: 'Disposisi';
    display: block;
    margin-bottom: 0.35rem;
    color: var(--text-secondary);
    font-size: 0.75rem;
    font-weight: var(--font-weight-semibold);
  }

  #interns-table tbody td:nth-child(7) > div {
    justify-content: flex-start !important;
  }

  #interns-table tbody td:nth-child(8) {
    display: block;
    grid-column: 1 / -1;
    grid-row: 3;
    text-align: left !important;
  }

  #interns-table tbody td:nth-child(9) {
    display: block;
    grid-column: 1 / -1;
    grid-row: 5;
  }

  #interns-table .actions-cell {
    flex-wrap: wrap;
    justify-content: flex-start !important;
  }

  #interns-table tbody tr.empty-row {
    display: block;
  }

  #interns-table tbody tr.empty-row td {
    display: block;
  }

  @keyframes pulse-helper {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; color: var(--color-primary); }
  }
}

@media (max-width: 480px) {
  .register-card {
    padding: 1.25rem;
  }

  .register-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .register-actions .btn {
    flex: none;
  }

  .modal-header h2 {
    font-size: var(--font-size-modal);
    font-weight: var(--font-weight-semibold);
  }
}

/* Global Loader Overlay */
.global-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(15, 23, 42, 0.6);
  backdrop-filter: blur(4px);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  color: #ffffff;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition-normal);
}

.global-loader.show {
  opacity: 1;
  pointer-events: all;
}

.loader-spinner {
  width: 50px;
  height: 50px;
  border: 4px solid rgba(255, 255, 255, 0.15);
  border-top-color: #3b82f6;
  border-radius: 50%;
  animation: spin-loader 0.8s linear infinite;
  box-shadow: var(--shadow-md);
}

.loader-text {
  font-weight: var(--font-weight-bold);
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

@keyframes spin-loader {
  to { transform: rotate(360deg); }
}

/* Sidebar Hide / Toggle Styles */
.btn-toggle-sidebar {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-secondary);
  transition: var(--transition-fast);
  box-shadow: var(--shadow-sm);
  flex-shrink: 0;
  min-width: 44px;
  min-height: 44px;
}

.btn-toggle-sidebar:hover {
  color: var(--color-primary);
  border-color: var(--color-primary);
  background-color: rgba(37, 99, 235, 0.08);
}

#btn-open-sidebar {
  display: none;
}

body.sidebar-collapsed #btn-open-sidebar {
  display: inline-flex;
}

body.sidebar-collapsed aside {
  transform: translateX(-100%);
  opacity: 0;
  pointer-events: none;
}

body.sidebar-collapsed main {
  margin-left: 0;
}

:is(a, button, input, select, textarea, [tabindex]):focus-visible {
  outline: 3px solid var(--color-primary);
  outline-offset: 3px;
}

.btn:disabled,
.action-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

#btn-preview-download[aria-disabled="true"] {
  opacity: 0.5;
  pointer-events: none;
}

.preview-document-frame {
  width: 100%;
  height: min(70vh, 550px);
  border: 0;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.preview-image-wrapper {
  width: 100%;
  max-height: min(70vh, 550px);
  display: flex;
  justify-content: center;
  overflow: auto;
}

.preview-image-wrapper img {
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
}

.mobile-nav-backdrop {
  display: none;
}

@media (max-width: 768px) {
  body.mobile-nav-open {
    overflow: hidden;
  }

  .table-header-controls {
    width: 100%;
    justify-content: space-between;
    margin-left: 0;
    font-size: var(--font-size-support);
  }

  .table-pagination {
    padding: 1rem;
    font-size: var(--font-size-support);
  }

  .pagination-actions {
    width: 100%;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  #table-page-info {
    flex-basis: 100%;
    order: -1;
  }

  .pagination-actions .btn {
    min-width: 5.5rem;
    padding: 0.6rem;
    flex: 1;
    white-space: nowrap;
  }

  #view-settings .widget-body {
    padding: 0;
  }

  body aside,
  body.sidebar-collapsed aside {
    display: flex;
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 111;
    width: min(84vw, 320px);
    height: 100vh;
    height: 100dvh;
    padding: 1.25rem;
    border-right: 1px solid var(--border-color);
    border-bottom: 0;
    border-radius: 0 1rem 1rem 0;
    box-shadow: var(--shadow-lg);
    overflow-y: auto;
    transform: translateX(-105%);
    opacity: 1;
    visibility: hidden;
    pointer-events: none;
  }

  body.mobile-nav-open aside,
  body.mobile-nav-open.sidebar-collapsed aside {
    transform: translateX(0);
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .mobile-nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 110;
    background: rgba(15, 23, 42, 0.48);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity var(--sidebar-motion-duration) var(--sidebar-motion-easing),
      visibility 0s linear var(--sidebar-motion-duration);
  }

  body.mobile-nav-open .mobile-nav-backdrop {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transition-delay: 0s;
  }

  .logo-container {
    margin-bottom: 1.5rem;
    padding-right: 0;
    flex-direction: row;
    justify-content: space-between;
  }

  .nav-menu {
    flex-direction: column;
    gap: 0.35rem;
    overflow: visible;
    scroll-snap-type: none;
    padding: 0;
  }

  .nav-item {
    flex: none;
  }

  .nav-item a {
    flex-direction: row;
    justify-content: flex-start;
    gap: 0.85rem;
    min-height: 48px;
    padding: 0.8rem 0.9rem;
    font-size: var(--font-size-body);
  }

  .nav-item-text {
    font-size: var(--font-size-body);
    text-align: left;
    line-height: var(--line-height-body);
  }

  .sidebar-footer {
    position: static;
    width: 100%;
    margin-top: auto;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
  }

  .sidebar-footer .logout-text {
    display: inline;
  }

  #btn-logout {
    width: 100% !important;
    height: auto !important;
    min-height: 48px;
    padding: 0.65rem 0.9rem !important;
    border-radius: var(--radius-sm) !important;
    justify-content: flex-start;
  }

  #btn-toggle-sidebar {
    display: inline-flex;
  }

  #btn-open-sidebar {
    display: inline-flex;
  }

  .header-title {
    width: 100%;
    gap: 0.75rem !important;
  }

  .header-title > div {
    flex: 1;
  }

  .header-title h1 {
    font-size: var(--font-size-page);
    line-height: var(--line-height-heading);
  }

  .portal-card,
  .portal-options,
  .portal-btn {
    min-width: 0;
  }

  .portal-btn {
    white-space: normal;
    overflow-wrap: anywhere;
  }
}

/* Public registration: letter-number help stays outside the scrolling form. */
.form-guides-settings {
  margin-bottom: 2rem;
}

.form-guides-settings > h2 {
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-semibold);
}

.form-guides-intro {
  margin: 0.5rem 0 1.25rem;
  color: var(--text-secondary);
}

.form-guides-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  gap: 1.5rem;
  align-items: start;
}

.form-guide-card {
  min-width: 0;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.form-guide-card h3 {
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-semibold);
  margin-bottom: 0.5rem;
}

.form-guide-card > p {
  color: var(--text-secondary);
}

.form-guide-image {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 12rem;
  padding: 0.75rem;
  margin-top: 1rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: #f8fafc;
  color: var(--text-secondary);
}

.form-guide-image img {
  display: block;
  max-width: 100%;
  max-height: 18rem;
  object-fit: contain;
}

.form-guide-image img[hidden],
.letter-number-help-trigger[hidden] {
  display: none;
}

.form-guide-file {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}

.form-guide-preview-label {
  margin-top: 0.5rem;
  font-size: var(--font-size-support);
}

.form-guide-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.form-guide-status {
  margin-top: 0.75rem;
  overflow-wrap: anywhere;
}

.form-guide-status[data-state="error"] { color: #b91c1c; }
.form-guide-status[data-state="success"] { color: #047857; }

.letter-number-label {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.letter-number-help-trigger {
  touch-action: manipulation;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 1.75rem;
  height: 1.75rem;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--color-primary);
  background: transparent;
  cursor: pointer;
}

.letter-number-help-trigger:hover,
.letter-number-help-trigger:focus-visible {
  background: #eff6ff;
}

.letter-number-help-popover {
  position: fixed;
  z-index: 10004;
  width: 25rem;
  max-width: calc(100vw - 1.5rem);
  padding: 1rem;
  overflow-y: auto;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-primary);
  box-shadow: var(--shadow-lg);
  font-size: var(--font-size-body);
  line-height: var(--line-height-body);
}

.letter-number-help-popover[hidden] {
  display: none;
}

.letter-number-help-popover h3 {
  margin-bottom: 0.75rem;
  font-size: var(--font-size-section);
  font-weight: var(--font-weight-semibold);
}

.letter-number-help-popover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 15rem;
  object-fit: contain;
  border: 1px solid var(--border-color);
  background: #f8fafc;
  margin-bottom: 0.75rem;
}

.letter-number-help-hint {
  margin-top: 0.375rem;
  color: var(--text-secondary);
  font-size: var(--font-size-support);
}

#letter-number-help-modal {
  transition: opacity 0.18s ease, visibility 0s linear 0.18s;
}

#letter-number-help-modal.show {
  transition-delay: 0s;
}

.letter-number-help-dialog {
  max-width: 52rem;
  transition: transform 0.18s ease;
}

.letter-number-help-dialog img {
  display: block;
  width: 100%;
  height: auto;
  border: 1px solid var(--border-color);
}

#letter-number-help-caption {
  margin-top: 1rem;
  color: var(--text-secondary);
}

.letter-number-help-popover > p:first-of-type,
#letter-number-help-caption {
  white-space: pre-line;
}

@media (pointer: coarse) {
  .letter-number-help-trigger {
    min-height: 2.75rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  :root {
    --sidebar-motion-duration: 0ms;
  }

  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
