:root {
  --primary: #0b3b8c;
  --primary-dark: #07265e;
  --primary-light: #1d4ed8;
  --accent: #f5b027;
  --accent-dark: #d9930d;
  --success: #0b3b8c;
  --danger: #dc2626;
  --bg: #f8fafc;
  --surface: #ffffff;
  --text: #0f172a;
  --text-muted: #475569;
  --border: #e2e8f0;
  --shadow-sm: 0 2px 6px rgba(11, 59, 140, 0.05);
  --shadow-md: 0 8px 20px -4px rgba(11, 59, 140, 0.1);
  --shadow-lg: 0 16px 32px -8px rgba(11, 59, 140, 0.15);
  --radius: 10px;
  --container: 1120px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  font-family: 'Prompt', sans-serif;
}

html, body, button, input, select, textarea, table, th, td, code {
  font-family: 'Prompt', sans-serif !important;
}

html {
  scroll-behavior: smooth;
  color: var(--text);
  background: var(--bg);
  font-size: 14.5px;
}

body {
  line-height: 1.55;
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 16px;
}

/* Header & Navigation (กระชับลง 20%) */
.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 62px;
  gap: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
}
.brand-logo {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--primary);
}
.brand-text h1 {
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--primary-dark);
  line-height: 1.2;
}
.brand-text p {
  font-size: 0.68rem;
  color: var(--text-muted);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-item {
  position: relative;
}
.nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 7px 10px;
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text);
  border-radius: 6px;
  transition: all 0.18s;
  cursor: pointer;
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active {
  color: var(--primary);
  background: #eff6ff;
}
.nav-link-highlight {
  background: rgba(245, 176, 39, 0.18);
  color: var(--primary-dark);
  font-weight: 700;
  border: 1px solid rgba(245, 176, 39, 0.45);
}
.nav-link-highlight:hover, .nav-link-highlight.active {
  background: var(--accent);
  color: var(--primary-dark);
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 6px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.18s ease;
  z-index: 1100;
}
.nav-item:hover > .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.dropdown-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 11px;
  font-size: 0.8rem;
  color: var(--text);
  border-radius: 6px;
  transition: background 0.15s;
  cursor: pointer;
}
.dropdown-link:hover {
  background: #eff6ff;
  color: var(--primary);
  font-weight: 500;
}
.dropdown-divider {
  height: 1px;
  background: var(--border);
  margin: 5px 0;
}
.dropdown-label {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  padding: 5px 11px 2px;
  text-transform: uppercase;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}
.section-nav-wrapper {
  position: relative;
}
.hamburger-btn {
  width: 34px;
  height: 34px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: #f8fafc;
  color: var(--primary-dark);
  font-size: 1.05rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.18s;
}
.hamburger-btn:hover {
  background: #eff6ff;
  border-color: var(--primary);
  color: var(--primary);
}
.section-drawer {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  width: 280px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  padding: 10px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: all 0.18s ease;
  z-index: 1200;
}
.section-drawer.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.drawer-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
  margin-top: 4px;
}
.drawer-grid-2 .dropdown-link {
  padding: 6px 8px;
  font-size: 0.76rem;
  background: #f8fafc;
  border: 1px solid #f1f5f9;
  justify-content: center;
  text-align: center;
}
.drawer-grid-2 .dropdown-link:hover {
  background: #eff6ff;
  border-color: #dbeafe;
}
.drawer-chip {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px 8px;
  font-size: 0.76rem;
  font-weight: 600;
  color: var(--primary-dark);
  background: #f0f7ff;
  border: 1px solid #dbeafe;
  border-radius: 6px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s;
}
.drawer-chip:hover {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}
.drawer-chip-gold {
  background: rgba(245, 176, 39, 0.2);
  border-color: rgba(245, 176, 39, 0.55);
  color: var(--primary-dark);
  font-weight: 700;
}
.drawer-chip-gold:hover {
  background: var(--accent);
  color: var(--primary-dark);
  border-color: var(--accent);
}
.drawer-chip-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.drawer-chip-primary:hover {
  background: var(--primary-dark);
}

/* Buttons (คุมโทน 3 สีหลัก: น้ำเงิน - ทอง - ขาวขอบน้ำเงิน) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 99px;
  font-family: inherit;
  font-weight: 600;
  font-size: 0.8rem;
  border: none;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.btn-primary {
  background: var(--primary);
  color: #fff;
}
.btn-primary:hover {
  background: var(--primary-dark);
}
.btn-accent {
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
}
.btn-accent:hover {
  background: var(--accent-dark);
  color: #fff;
}
.btn-line {
  background: var(--primary);
  color: #fff;
}
.btn-line:hover {
  background: var(--primary-dark);
}
.btn-outline {
  background: #fff;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover {
  background: #eff6ff;
}
.btn-sm {
  padding: 5px 11px;
  font-size: 0.75rem;
  border-radius: 6px;
}

/* Announcement Strip */
.announcement-strip {
  background: var(--primary-dark);
  color: #fff;
  padding: 8px 0;
  text-align: center;
  font-weight: 500;
  font-size: 0.82rem;
  cursor: pointer;
}
.announcement-strip span.cta-pill {
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 2px 10px;
  border-radius: 99px;
  margin-left: 8px;
  display: inline-block;
}

/* Hero Banner (กระชับลง 20%) */
.hero-section {
  background: linear-gradient(135deg, #f0f7ff 0%, #ffffff 100%);
  padding: 26px 0 32px;
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr 1.12fr;
  gap: 24px;
  align-items: center;
}
.hero-title {
  font-size: 1.72rem;
  line-height: 1.28;
  color: var(--primary-dark);
  font-weight: 800;
  margin-bottom: 10px;
}
.hero-title span {
  color: var(--primary);
}
.hero-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
  margin-bottom: 16px;
  line-height: 1.6;
}
.hero-buttons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}
.hero-buttons .btn {
  width: 100%;
  padding: 9px 10px;
  font-size: 0.8rem;
  text-align: center;
}
.hero-banner-card {
  border-radius: 12px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 2px solid #fff;
  background: #fff;
}
.hero-banner-card img {
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* Section Generic (กระชับลง 20%) */
.section {
  padding: 38px 0;
}
.section-alt {
  background: #fff;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}
.section-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 20px;
}
.section-tag {
  display: inline-block;
  color: var(--primary);
  background: #eff6ff;
  border: 1px solid #dbeafe;
  padding: 2px 9px;
  border-radius: 99px;
  font-weight: 700;
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.4px;
  margin-bottom: 4px;
}
.section-title {
  font-size: 1.38rem;
  font-weight: 800;
  color: var(--primary-dark);
  line-height: 1.3;
}
.section-subtitle {
  color: var(--text-muted);
  font-size: 0.84rem;
  margin-top: 3px;
}

/* In-House Value Strip (4 จุดขายสำหรับองค์กร) */
.inhouse-value-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.inhouse-value-box {
  background: #fff;
  border: 1px solid var(--border);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 10px 12px;
  box-shadow: var(--shadow-sm);
}
.section-alt .inhouse-value-box {
  background: #f8fafc;
}
.inhouse-value-box strong {
  display: block;
  font-size: 0.82rem;
  color: var(--primary-dark);
  margin-bottom: 2px;
}
.inhouse-value-box span {
  display: block;
  font-size: 0.74rem;
  color: var(--text-muted);
  line-height: 1.45;
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}
.tab-btn {
  padding: 6px 14px;
  border-radius: 99px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.18s;
}
.tab-btn:hover, .tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
}

/* Cards Grid (กระชับลง 20%) */
.cards-grid,
.cards-grid-3 {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.card {
  background: var(--surface);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-md);
}
.card-media {
  position: relative;
  height: 215px;
  background: #f8fafc;
  border-bottom: 1px solid var(--border);
  overflow: hidden;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
}
.card-media img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 6px;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease;
}
.card:hover .card-media img {
  transform: scale(1.02);
}
.card-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}
.card-type-pill {
  display: inline-block;
  background: var(--primary);
  color: #fff;
  font-size: 0.68rem;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 5px;
}
.card-type-pill.pill-gold {
  background: var(--accent);
  color: var(--primary-dark);
  font-weight: 700;
}
.card-meta-text {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
}
.badge-inline {
  font-size: 0.7rem;
  background: #f1f5f9;
  color: var(--primary-dark);
  padding: 2px 8px;
  border-radius: 99px;
  font-weight: 600;
}

.card-body {
  padding: 13px;
  display: flex;
  flex-direction: column;
  flex: 1;
}
.card-meta {
  font-size: 0.7rem;
  color: var(--primary);
  font-weight: 600;
  margin-bottom: 4px;
}
.card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 6px;
  line-height: 1.38;
  cursor: pointer;
}
.card-title:hover {
  color: var(--primary);
}
.card-desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 10px;
  flex: 1;
  line-height: 1.5;
}
.card-info-list {
  font-size: 0.72rem;
  color: var(--text-muted);
  background: #f8fafc;
  padding: 7px 9px;
  border-radius: 6px;
  margin-bottom: 10px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  border: 1px solid #f1f5f9;
}
.card-info-list > div {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-inline-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: underline;
  margin-left: 4px;
}

.card-footer {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
  margin-top: auto;
}
.price-stack {
  display: flex;
  flex-direction: column;
  gap: 2px;
  font-size: 0.74rem;
}
.price-line {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 6px;
}
.price-line span {
  color: var(--text-muted);
}
.price-public {
  color: var(--primary);
}
.price-inhouse {
  color: var(--primary-dark);
}

.card-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  width: 100%;
}
.card-actions .btn {
  flex: 1 1 auto;
  padding: 6px 8px;
  font-size: 0.74rem;
  justify-content: center;
}

/* Lecturer Card */
.lecturer-card {
  display: grid;
  grid-template-columns: 110px 1fr;
  gap: 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
  align-items: center;
}
.lecturer-avatar {
  width: 110px;
  height: 128px;
  border-radius: 10px;
  object-fit: cover;
  object-position: top center;
  border: 2px solid var(--primary);
}

/* Page Hero Banner (กระชับลง 20%) */
.page-hero {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary));
  color: #fff;
  padding: 28px 0;
}
.page-hero h2 {
  font-size: 1.5rem;
  font-weight: 800;
  margin-bottom: 4px;
}
.page-hero p {
  color: #cbd5e1;
  font-size: 0.86rem;
}

/* Forms */
.form-card {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow-sm);
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.form-group {
  margin-bottom: 12px;
}
.form-group label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  margin-bottom: 4px;
  color: var(--text);
}
.form-control {
  width: 100%;
  padding: 8px 11px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  font-family: inherit;
  font-size: 0.82rem;
}
.form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 2px rgba(11, 59, 140, 0.12);
}
textarea.form-control {
  min-height: 80px;
  resize: vertical;
}

/* Modal */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(4px);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.modal-backdrop.open {
  display: flex;
}
.modal-box {
  background: #fff;
  border-radius: 12px;
  max-width: 580px;
  width: 92%;
  max-height: 82vh;
  overflow-y: auto;
  overflow-x: hidden;
  box-shadow: var(--shadow-lg);
  position: relative;
}
.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 10;
}
#modal-title {
  font-size: 0.94rem !important;
  line-height: 1.35;
}
.modal-close {
  background: #f1f5f9;
  border: none;
  width: 28px;
  height: 28px;
  min-width: 28px;
  border-radius: 50%;
  font-size: 0.9rem;
  cursor: pointer;
}
.modal-body {
  padding: 14px 16px;
}
.modal-poster-img {
  max-height: 310px;
  width: auto;
  max-width: 100%;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
}
.modal-title-h4 {
  font-size: 0.98rem;
  color: var(--primary-dark);
  margin-bottom: 5px;
  line-height: 1.35;
}
.modal-cta-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 14px;
}
.modal-cta-row .btn {
  width: 100%;
  padding: 8px 10px;
  font-size: 0.78rem;
  white-space: normal;
  text-align: center;
}

/* Admin Table */
.admin-table-wrap {
  overflow-x: auto;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 10px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.82rem;
}
.admin-table th, .admin-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}
.admin-table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--primary-dark);
}
.btn-danger {
  background: #fee2e2;
  color: var(--danger);
}
.btn-danger:hover {
  background: var(--danger);
  color: #fff;
}

/* Footer (กระชับลง 20%) */
.site-footer {
  background: var(--primary-dark);
  color: #cbd5e1;
  padding: 34px 0 18px;
  margin-top: 28px;
}
.footer-container {
  max-width: 1240px;
  width: 96%;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1.15fr 0.85fr 1fr;
  gap: 20px;
  padding-bottom: 22px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}
.footer-col h4 {
  color: #fff;
  font-size: 0.86rem;
  margin-bottom: 10px;
  white-space: nowrap;
}
.footer-nowrap {
  white-space: nowrap;
}
.footer-links {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.footer-links li {
  white-space: nowrap;
  font-size: 0.76rem;
}
.footer-links a {
  color: #cbd5e1;
  font-size: 0.76rem;
  cursor: pointer;
  white-space: nowrap;
}
.footer-links a:hover {
  color: var(--accent);
}
.footer-bottom {
  padding-top: 14px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 0.72rem;
  color: #94a3b8;
}

/* Floating Action Buttons (คุมโทนน้ำเงิน-ทอง) */
.fab-wrapper {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 1500;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.fab-menu {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all 0.2s ease;
}
.fab-wrapper.open .fab-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.fab-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #fff;
  color: var(--text);
  padding: 7px 14px;
  border-radius: 99px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
  font-size: 0.78rem;
  font-weight: 600;
  transition: transform 0.18s;
}
.fab-item:hover {
  transform: translateX(-3px);
}
.fab-item .dot {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 700;
  font-size: 0.72rem;
}
.fab-main-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.fab-trigger {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--primary);
  color: #fff;
  border: 2px solid var(--accent);
  padding: 10px 18px;
  border-radius: 99px;
  font-family: inherit;
  font-size: 0.82rem;
  font-weight: 700;
  box-shadow: var(--shadow-md);
  cursor: pointer;
}
.fab-top {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: var(--primary-dark);
  color: #fff;
  border: none;
  font-size: 0.95rem;
  cursor: pointer;
  box-shadow: var(--shadow-md);
}

/* Training Calendar Section (กระชับลง 20% คุมโทนน้ำเงิน-ทอง) */
.calendar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  width: 100%;
}
.calendar-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px 16px;
  background: var(--primary-dark);
  color: #fff;
}
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.cal-nav-btn {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 5px 12px;
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.18s;
  white-space: nowrap;
}
.cal-nav-btn:hover {
  background: rgba(255, 255, 255, 0.25);
}
.cal-month-label {
  font-size: 0.96rem;
  font-weight: 700;
  min-width: 130px;
  text-align: center;
  white-space: nowrap;
}
.calendar-legend {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.cal-filter-btn {
  padding: 5px 12px;
  border-radius: 99px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  font-size: 0.74rem;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  text-align: center;
}
.cal-filter-btn.active {
  background: var(--accent);
  color: var(--primary-dark);
  border-color: var(--accent);
}
.calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  background: #f1f5f9;
  border-bottom: 1px solid var(--border);
  text-align: center;
  font-weight: 700;
  font-size: 0.74rem;
  color: var(--primary-dark);
}
.calendar-weekdays div {
  padding: 7px 2px;
  min-width: 0;
}
.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  width: 100%;
}
.cal-cell {
  min-width: 0;
  min-height: 76px;
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 5px;
  display: flex;
  flex-direction: column;
  gap: 3px;
  background: #fff;
  overflow: hidden;
}
.cal-cell:nth-child(7n) {
  border-right: none;
}
.cal-cell.other-month {
  background: #f8fafc;
  color: #94a3b8;
}
.cal-cell.today {
  background: #f0f7ff;
}
.cal-day-num {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--text-muted);
  margin-bottom: 1px;
}
.cal-cell.today .cal-day-num {
  color: #fff;
  background: var(--primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
}
.cal-event {
  display: block;
  width: 100%;
  font-size: 0.66rem;
  padding: 2px 5px;
  border-radius: 4px;
  line-height: 1.25;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 600;
}
.cal-event:hover {
  filter: brightness(0.95);
}
.cal-event.public {
  background: #eff6ff;
  color: var(--primary-dark);
  border-left: 3px solid var(--primary);
}
.cal-event.inhouse {
  background: #fef9c3;
  color: var(--primary-dark);
  border-left: 3px solid var(--accent);
}

@media (max-width: 1024px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .inhouse-value-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .cards-grid,
  .cards-grid-3 {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .main-nav {
    display: none;
  }
}

@media (max-width: 768px) {
  .container {
    padding: 0 12px;
  }
  .header-inner {
    min-height: 54px;
    gap: 6px;
  }
  .brand-logo {
    width: 36px;
    height: 36px;
  }
  .brand-text h1 {
    font-size: 0.9rem;
  }
  .brand-text p {
    font-size: 0.62rem;
    max-width: 145px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .header-actions .btn-outline {
    display: none;
  }
  .section-drawer {
    position: fixed;
    top: 58px;
    right: 10px;
    left: 10px;
    width: auto;
    max-height: calc(100vh - 72px);
    overflow-y: auto;
  }
  .hero-section {
    padding: 18px 0 24px;
  }
  .hero-title {
    font-size: 1.32rem;
    line-height: 1.3;
  }
  .hero-desc {
    font-size: 0.82rem;
    margin-bottom: 14px;
  }
  .hero-buttons {
    grid-template-columns: 1fr 1fr;
    gap: 6px;
  }
  .section {
    padding: 28px 0;
  }
  .section-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }
  .section-title {
    font-size: 1.18rem;
  }
  .section-subtitle {
    font-size: 0.78rem;
  }
  .inhouse-value-strip {
    grid-template-columns: 1fr;
    gap: 8px;
  }
  .filter-tabs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
    margin-bottom: 14px;
  }
  .tab-btn {
    width: 100%;
    font-size: 0.76rem;
    padding: 8px 12px;
    white-space: normal;
    text-align: center;
  }
  .cards-grid,
  .cards-grid-3 {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .lecturer-card {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 14px;
  }
  .lecturer-avatar {
    margin: 0 auto;
    width: 100px;
    height: 118px;
  }
  .page-hero {
    padding: 22px 0;
  }
  .page-hero h2 {
    font-size: 1.25rem;
  }
  .page-hero p {
    font-size: 0.8rem;
  }
  .form-card {
    padding: 14px;
  }
  .form-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .modal-box {
    width: 92%;
    max-width: 380px;
    max-height: 78vh;
  }
  .modal-poster-img {
    max-height: 200px;
  }
  .modal-cta-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }
  .footer-nowrap,
  .footer-links li,
  .footer-links a {
    white-space: normal;
  }
  .footer-bottom {
    flex-direction: column;
    text-align: center;
    gap: 4px;
  }
  .calendar-toolbar {
    flex-direction: column;
    align-items: stretch;
    padding: 10px;
    gap: 8px;
  }
  .calendar-nav {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 6px;
  }
  .cal-month-label {
    font-size: 0.84rem;
    min-width: 0;
  }
  .cal-nav-btn {
    padding: 4px 8px;
    font-size: 0.68rem;
  }
  .calendar-legend {
    display: grid;
    grid-template-columns: 0.8fr 1.1fr 1.15fr;
    gap: 4px;
  }
  .cal-filter-btn {
    padding: 5px 4px;
    font-size: 0.68rem;
  }
  .cal-cell {
    min-height: 52px;
    padding: 3px;
  }
  .cal-event {
    font-size: 0.6rem;
    padding: 2px 3px;
    text-align: center;
  }
  .cal-ev-time {
    display: none;
  }
}
