.logo-link {
  display: flex; align-items: center; gap: 10px;
  text-decoration: none; color: inherit;
}

.header-actions a.btn { text-decoration: none; }

/* Layout */
.select-layout {
  display: grid;
  grid-template-columns: 280px 1fr 260px;
  gap: 0;
  max-width: 1600px;
  margin: 0 auto;
  min-height: calc(100vh - var(--header-height));
  position: relative;
  z-index: 1;
}

/* Filter Panel */
.filter-panel {
  background: var(--bg-card);
  border-right: 1px solid var(--border-color);
  padding: 20px 16px;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-height));
  position: sticky;
  top: var(--header-height);
}

.filter-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}

.filter-header h2 { font-size: 0.95rem; font-weight: 600; }

.btn-text {
  background: none; border: none; color: var(--text-accent);
  font-size: 0.78rem; cursor: pointer; font-family: inherit;
}

.btn-text:hover { text-decoration: underline; }

.filter-group { margin-bottom: 14px; }

.filter-group label {
  display: block; font-size: 0.75rem; font-weight: 500;
  color: var(--text-secondary); margin-bottom: 5px;
}

.filter-row { display: flex; gap: 8px; }

.filter-half { flex: 1; }

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

.form-input:focus {
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(108, 92, 231, 0.1);
}

.form-select-sm {
  padding: 6px 28px 6px 10px;
  font-size: 0.78rem; width: auto;
}

.btn-block { width: 100%; justify-content: center; margin-top: 4px; }

.checkbox-label {
  display: flex; align-items: center; gap: 8px;
  font-size: 0.82rem; color: var(--text-secondary); cursor: pointer;
}

.checkbox-label input { accent-color: var(--accent-primary); width: 16px; height: 16px; }

.my-profile-box {
  margin-top: 20px; padding: 12px;
  background: var(--bg-glass); border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.profile-box-title { font-size: 0.75rem; font-weight: 600; color: var(--text-accent); margin-bottom: 6px; }

.profile-info-text { font-size: 0.8rem; color: var(--text-secondary); margin-bottom: 8px; }

/* Conflict Banner */
.conflict-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 20px;
  background: rgba(255, 107, 107, 0.12);
  border-bottom: 1px solid rgba(255, 107, 107, 0.25);
  color: #FF8A8A; font-size: 0.85rem;
  position: relative; z-index: 2;
}

[data-theme="light"] .conflict-banner {
  background: rgba(231, 76, 60, 0.08);
  color: #C0392B;
}

.conflict-banner-close {
  margin-left: auto; background: none; border: none;
  color: inherit; font-size: 1.2rem; cursor: pointer; padding: 0 4px;
}

/* Results Panel */
.results-panel {
  padding: 16px 20px 32px;
  overflow-y: auto;
  max-height: calc(100vh - var(--header-height));
}

.results-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px; gap: 12px; flex-wrap: wrap;
}

.results-summary { font-size: 0.85rem; color: var(--text-secondary); }

.results-conflict-hint {
  display: block; font-size: 0.75rem;
  color: var(--danger); margin-top: 2px;
}

.results-actions { display: flex; gap: 8px; align-items: center; }

/* Course Cards */
.course-list {
  display: flex; flex-direction: column; gap: 10px;
}

.course-card {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: all var(--transition-fast);
  cursor: pointer;
}

.course-card:hover {
  border-color: rgba(129, 140, 248, 0.3);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.course-card.has-conflict {
  border-color: rgba(255, 107, 107, 0.4);
  background: rgba(255, 107, 107, 0.04);
}

.course-card.in-schedule {
  border-color: rgba(0, 184, 148, 0.35);
  opacity: 0.75;
}

.course-card.in-cart {
  border-color: rgba(129, 140, 248, 0.5);
  box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.2);
}

.course-card-main { min-width: 0; }

.course-card-top {
  display: flex; align-items: flex-start; gap: 8px; flex-wrap: wrap;
  margin-bottom: 6px;
}

.course-card-name {
  font-size: 0.95rem; font-weight: 600;
  color: var(--text-primary); line-height: 1.3;
}

.course-badges { display: flex; gap: 5px; flex-wrap: wrap; }

.badge {
  display: inline-block; padding: 2px 8px;
  border-radius: 10px; font-size: 0.68rem; font-weight: 600;
}

.badge-required { background: rgba(255, 107, 107, 0.15); color: #FF8A8A; }

.badge-elective { background: rgba(0, 184, 148, 0.15); color: #00B894; }

.badge-conflict {
  background: rgba(255, 107, 107, 0.2); color: #FF6B6B;
  animation: pulse-conflict 2s ease infinite;
}

.badge-required-conflict {
  background: rgba(255, 50, 50, 0.25); color: #FF4444;
  font-weight: 700;
}

.badge-added { background: rgba(0, 184, 148, 0.15); color: var(--success); }

.badge-credits {
  background: var(--bg-glass); color: var(--text-muted);
}

@keyframes pulse-conflict {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.7; }
}

.course-card-meta {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  font-size: 0.78rem; color: var(--text-secondary);
}

.course-card-meta span { display: flex; align-items: center; gap: 4px; }

.course-card-schedule {
  margin-top: 6px; font-size: 0.78rem;
  color: var(--text-accent); font-weight: 500;
}

.conflict-detail {
  margin-top: 8px; padding: 8px 10px;
  background: rgba(255, 107, 107, 0.08);
  border-radius: var(--radius-sm);
  border-left: 3px solid var(--danger);
  font-size: 0.75rem; color: #FF8A8A;
  line-height: 1.5;
}

[data-theme="light"] .conflict-detail { color: #C0392B; }

.course-card-actions {
  display: flex; flex-direction: column; gap: 6px;
  align-items: flex-end; justify-content: center;
}

.btn-add {
  padding: 7px 14px; font-size: 0.78rem;
  white-space: nowrap;
}

.btn-add:disabled { opacity: 0.4; cursor: not-allowed; }

.btn-add.conflict-warn {
  background: rgba(255, 107, 107, 0.15);
  color: var(--danger); border: 1px solid rgba(255, 107, 107, 0.3);
}

/* Pagination */
.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 4px; margin-top: 20px; flex-wrap: wrap;
}

.page-btn {
  min-width: 36px; height: 36px; padding: 0 8px;
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  background: var(--bg-glass); color: var(--text-secondary);
  font-family: inherit; font-size: 0.82rem; cursor: pointer;
  transition: all var(--transition-fast);
}

.page-btn:hover:not(:disabled) { background: var(--bg-glass-hover); color: var(--text-primary); }

.page-btn.active {
  background: var(--accent-gradient); color: white; border-color: transparent;
}

.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

.page-info { font-size: 0.78rem; color: var(--text-muted); padding: 0 8px; }

/* Cart Panel */
.cart-panel {
  background: var(--bg-card);
  border-left: 1px solid var(--border-color);
  display: flex; flex-direction: column;
  max-height: calc(100vh - var(--header-height));
  position: sticky; top: var(--header-height);
}

.cart-header {
  padding: 16px; border-bottom: 1px solid var(--border-color);
}

.cart-header h2 { font-size: 0.9rem; font-weight: 600; }

.cart-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 20px; height: 20px; padding: 0 6px;
  background: var(--accent-gradient); color: white;
  border-radius: 10px; font-size: 0.72rem; margin-left: 4px;
}

.cart-required-summary {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  max-height: 180px; overflow-y: auto;
}

.required-title { font-size: 0.75rem; font-weight: 600; color: var(--text-accent); margin-bottom: 8px; }

.required-list { display: flex; flex-direction: column; gap: 4px; }

.required-item {
  font-size: 0.72rem; color: var(--text-secondary);
  padding: 4px 8px; background: var(--bg-glass);
  border-radius: var(--radius-sm);
  border-left: 2px solid var(--danger);
}

.required-item .req-time { color: var(--text-muted); font-size: 0.68rem; }

.cart-items {
  flex: 1; overflow-y: auto; padding: 12px 16px;
  display: flex; flex-direction: column; gap: 8px;
}

.cart-empty {
  text-align: center; color: var(--text-muted);
  font-size: 0.8rem; padding: 20px 10px;
}

.cart-item {
  padding: 10px 12px; background: var(--bg-glass);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); font-size: 0.78rem;
}

.cart-item.has-conflict { border-color: rgba(255, 107, 107, 0.4); }

.cart-item-name { font-weight: 600; margin-bottom: 3px; }

.cart-item-meta { color: var(--text-muted); font-size: 0.72rem; }

.cart-item-remove {
  float: right; background: none; border: none;
  color: var(--text-muted); cursor: pointer; font-size: 0.9rem;
  padding: 0 2px;
}

.cart-item-remove:hover { color: var(--danger); }

.cart-footer {
  padding: 12px 16px; border-top: 1px solid var(--border-color);
}

.cart-stats {
  display: flex; justify-content: space-between;
  font-size: 0.8rem; color: var(--text-secondary);
  margin-bottom: 10px;
}

.cart-stats strong { color: var(--text-accent); }

/* Detail Modal extras */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
}

.detail-item {
  padding: 10px 12px; background: var(--bg-glass);
  border-radius: var(--radius-sm); font-size: 0.82rem;
}

.detail-item.full { grid-column: 1 / -1; }

.detail-label {
  font-size: 0.68rem; color: var(--text-muted);
  margin-bottom: 3px; font-weight: 500;
}

.detail-value { color: var(--text-primary); }

.detail-conflict-box {
  padding: 12px 14px; margin-top: 12px;
  background: rgba(255, 107, 107, 0.1);
  border: 1px solid rgba(255, 107, 107, 0.25);
  border-radius: var(--radius-md);
}

.detail-conflict-box h3 {
  font-size: 0.85rem; color: var(--danger); margin-bottom: 8px;
}

.detail-conflict-box ul {
  list-style: none; font-size: 0.78rem; color: var(--text-secondary);
  display: flex; flex-direction: column; gap: 4px;
}

.detail-conflict-box li::before { content: '⚠ '; }

/* Empty state */
.empty-state {
  text-align: center; padding: 60px 20px; color: var(--text-muted);
}

.empty-state-icon { font-size: 2.5rem; margin-bottom: 12px; }

.empty-state p { font-size: 0.9rem; }

/* Responsive */
@media (max-width: 1100px) {
  .select-layout {
    grid-template-columns: 260px 1fr;
  }
  .cart-panel { display: none; }
}

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

  .filter-panel {
    position: fixed; inset: 0; top: var(--header-height);
    z-index: 200; max-height: none;
    transform: translateX(-100%);
    transition: transform var(--transition-normal);
    width: min(320px, 90vw);
  }

  .filter-panel.open { transform: translateX(0); }

  .filter-panel::before {
    content: ''; position: fixed; inset: 0;
    background: rgba(0,0,0,0.5); z-index: -1;
    opacity: 0; pointer-events: none;
    transition: opacity var(--transition-normal);
  }

  .filter-panel.open::before {
    opacity: 1; pointer-events: auto;
  }

  .results-panel { max-height: none; padding: 12px; }

  .course-card {
    grid-template-columns: 1fr;
  }

  .course-card-actions {
    flex-direction: row; justify-content: flex-end;
  }

  .cart-panel {
    display: flex; position: fixed;
    bottom: 0; left: 0; right: 0; top: auto;
    max-height: 45vh; z-index: 150;
    border-left: none; border-top: 1px solid var(--border-color);
    transform: translateY(calc(100% - 48px));
    transition: transform var(--transition-normal);
  }

  .cart-panel.expanded { transform: translateY(0); }

  .cart-header { cursor: pointer; }
}
