/* Modern Flat Day Mode Design System - Professional Clean Layout */
:root {
  --font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
  --bg-main: #f4f6f9;
  --bg-surface: #ffffff;
  --bg-subtle: #f8fafc;
  --border-color: #e2e8f0;
  --border-hover: #cbd5e1;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --primary-light: #eff6ff;
  --primary-text: #1e40af;

  --success: #10b981;
  --success-light: #ecfdf5;
  --success-text: #065f46;

  --warning: #f59e0b;
  --warning-light: #fffbeb;
  --warning-text: #92400e;

  --danger: #ef4444;
  --danger-light: #fef2f2;
  --danger-text: #991b1b;

  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 10px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md: 0 3px 8px rgba(0,0,0,0.05);
  --shadow-lg: 0 8px 20px rgba(0,0,0,0.08);
}

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

body {
  font-family: var(--font-sans);
  background-color: var(--bg-main);
  color: var(--text-primary);
  line-height: 1.4;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--primary);
  text-decoration: none;
}
a:hover {
  text-decoration: underline;
}

/* Professional App Bar */
.navbar {
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-color);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.6rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none !important;
  letter-spacing: -0.01em;
}

.brand-icon {
  width: 32px;
  height: 32px;
  background: #2563eb;
  color: white;
  border-radius: var(--radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 800;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

/* Horizontal Nav Menu for Desktop */
.nav-menu-wrapper {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  flex: 1;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  list-style: none;
}

.nav-link {
  color: var(--text-secondary);
  font-weight: 500;
  font-size: 0.88rem;
  padding: 0.4rem 0.75rem;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background-color: var(--primary-light);
  font-weight: 600;
  text-decoration: none;
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* Academic Year Pill Selector */
.year-selector-form select {
  background-color: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 0.3rem 0.75rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  cursor: pointer;
  outline: none;
  transition: border-color 0.15s ease;
}

.year-selector-form select:hover {
  border-color: var(--primary);
}

/* Mobile Hamburger Toggle */
.mobile-toggle {
  display: none;
  background: var(--bg-subtle);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.6rem;
  font-size: 1.1rem;
  color: var(--text-primary);
  cursor: pointer;
}

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

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.85rem;
  padding: 0.45rem 0.9rem;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none !important;
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}
.btn-primary:hover {
  background-color: var(--primary-hover);
}

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

.btn-danger {
  background-color: var(--danger);
  color: white;
}
.btn-danger:hover {
  background-color: #dc2626;
}

.btn-sm {
  padding: 0.28rem 0.65rem;
  font-size: 0.78rem;
  border-radius: var(--radius-sm);
}

/* Cards & Panels - Compact */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 1rem 1.15rem;
  margin-bottom: 1rem;
}

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

.card-title {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text-primary);
}

/* Badges - Compact */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.18rem 0.55rem;
  border-radius: 10px;
  font-size: 0.72rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-primary { background: var(--primary-light); color: var(--primary-text); }
.badge-success { background: var(--success-light); color: var(--success-text); }
.badge-warning { background: var(--warning-light); color: var(--warning-text); }
.badge-danger { background: var(--danger-light); color: var(--danger-text); }

/* Tables - Compact padding */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-color);
  background: var(--bg-surface);
}

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

.table th {
  background: var(--bg-subtle);
  color: var(--text-secondary);
  font-weight: 600;
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  white-space: nowrap;
}

.table td {
  padding: 0.5rem 0.75rem;
  border-bottom: 1px solid var(--border-color);
  color: var(--text-primary);
}

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

.table-row-clickable {
  cursor: pointer;
  transition: background-color 0.15s ease;
}

.table-row-clickable:hover {
  background-color: #f1f5f9 !important;
}

/* Mobile Candidate Cards - Compact */
.mobile-cards {
  display: none;
  flex-direction: column;
  gap: 0.65rem;
}

.candidate-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  padding: 0.65rem 0.85rem;
  box-shadow: var(--shadow-sm);
}

.candidate-card-clickable {
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.candidate-card-clickable:hover {
  border-color: var(--primary);
  background-color: var(--bg-subtle);
}

.candidate-card-header {
  margin-bottom: 0.4rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-color);
}

.candidate-card-name {
  font-weight: 700;
  font-size: 0.95rem;
  color: var(--text-primary);
}

.candidate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.35rem 0.75rem;
  font-size: 0.8rem;
}

.candidate-field-label {
  color: var(--text-muted);
  font-weight: 500;
}

/* Forms - Compact */
.form-group {
  margin-bottom: 0.85rem;
}

.form-label {
  display: block;
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--text-primary);
  margin-bottom: 0.25rem;
}

.form-control {
  width: 100%;
  padding: 0.45rem 0.7rem;
  font-size: 0.85rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background-color: var(--bg-surface);
  color: var(--text-primary);
  outline: none;
  transition: border-color 0.15s ease;
}

.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
}

/* Alert messages */
.alert {
  padding: 0.65rem 1rem;
  border-radius: var(--radius-md);
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.alert-success { background: var(--success-light); color: var(--success-text); border: 1px solid #a7f3d0; }
.alert-error { background: var(--danger-light); color: var(--danger-text); border: 1px solid #fecaca; }

/* Drag & Drop File Zone */
.dropzone {
  border: 2px dashed #93c5fd;
  background-color: #eff6ff;
  border-radius: var(--radius-lg);
  padding: 2rem 1.25rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  background-color: #dbeafe;
  border-color: var(--primary);
}

.dropzone-icon {
  font-size: 2rem;
  color: var(--primary);
  margin-bottom: 0.5rem;
}

/* Modal */
.modal-backdrop {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(15, 23, 42, 0.5);
  backdrop-filter: blur(3px);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.modal-backdrop.active {
  display: flex;
}

.modal {
  background: var(--bg-surface);
  border-radius: var(--radius-lg);
  max-width: 580px;
  width: 100%;
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}

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

.modal-body {
  padding: 1.25rem;
  max-height: 75vh;
  overflow-y: auto;
}

.modal-footer {
  padding: 0.75rem 1.25rem;
  background: var(--bg-subtle);
  border-top: 1px solid var(--border-color);
  display: flex;
  justify-content: flex-end;
  gap: 0.5rem;
}

/* Pagination Control */
nav[role="navigation"] {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin-top: 1rem;
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .mobile-toggle {
    display: inline-block;
  }

  .nav-menu-wrapper {
    position: relative;
    flex: initial;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 220px;
    background: var(--bg-surface);
    flex-direction: column;
    align-items: stretch;
    padding: 0.5rem;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-lg);
    z-index: 150;
  }

  .nav-links.show {
    display: flex;
  }

  .table-responsive {
    display: none;
  }

  .mobile-cards {
    display: flex;
  }
}
