:root {
  --bg: #f0f8ff;
  --surface: rgba(255, 255, 255, 0.88);
  --surface-strong: rgba(255, 255, 255, 0.98);
  --text: #11234d;
  --muted: #5b6195;
  --primary: #3778c2;
  --primary-light: #5a9bd4;
  --primary-dark: #2c5aa0;
  --secondary: #6ba3d6;
  --accent: #ff6b35;
  --shadow: 0 40px 120px rgba(55, 120, 194, 0.14);
  --radius: 28px;
  --btn-text: #ffffff;
  --btn-primary-bg: var(--primary);
  --btn-primary-hover: var(--primary-dark);
  --btn-secondary-bg: rgba(255,255,255,0.18);
  --btn-secondary-hover: rgba(255,255,255,0.28);
  --btn-success-bg: #28a745;
  --btn-success-hover: #218838;
  --btn-danger-bg: #dc3545;
  --btn-danger-hover: #c82333;
  --btn-warning-bg: #ffc107;
  --btn-warning-hover: #e0a800;
  --btn-outline: rgba(255, 255, 255, 0.18);
  --btn-primary-gradient: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
  --accent-gradient: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: 'Inter', sans-serif;
  color: var(--text);
  background: radial-gradient(circle at top left, rgba(55, 120, 194, 0.12), transparent 24%),
    linear-gradient(180deg, #f0f8ff 0%, #e6f3ff 100%);
}

img {
  display: block;
  width: 100%;
  height: auto;
}

button,
a {
  font: inherit;
}

.btn,
.button {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-text);
}

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

.button.button-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 24px 50px rgba(55, 120, 194, 0.24);
}

.button.button-primary:hover {
  background: var(--primary-dark);
}

.btn-secondary,
.button-secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-text);
  border: 1px solid var(--btn-outline);
}

.btn-secondary:hover,
.button-secondary:hover {
  background: var(--btn-secondary-hover);
}

.btn-success,
.button-success {
  background: var(--btn-success-bg);
  color: var(--btn-text);
}

.btn-success:hover,
.button-success:hover {
  background: var(--btn-success-hover);
}

.btn-danger,
.button-danger {
  background: var(--btn-danger-bg);
  color: var(--btn-text);
}

.btn-danger:hover,
.button-danger:hover {
  background: var(--btn-danger-hover);
}

.btn-warning,
.button-warning {
  background: var(--btn-warning-bg);
  color: var(--btn-text);
}

.btn-warning:hover,
.button-warning:hover {
  background: var(--btn-warning-hover);
}

.button {
  background: var(--btn-primary-bg);
  color: var(--btn-text);
}

.button:hover {
  transform: translateY(-1px);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 2rem;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(27, 45, 106, 0.12);
}

.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
}

nav {
  display: flex;
  gap: 1.5rem;
}

nav a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s ease;
}

nav a:hover {
  color: var(--text);
}

.button {
  border: none;
  border-radius: 999px;
  padding: 0.95rem 1.6rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  background: var(--btn-primary-bg);
  color: #fff;
}

.button:hover {
  transform: translateY(-1px);
}

.button-small {
  padding: 0.45rem 0.85rem;
  font-size: 0.85rem;
  min-width: 0;
}

.button-primary {
  box-shadow: 0 24px 50px rgba(27, 45, 106, 0.24);
}

.button-secondary {
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 2rem;
  align-items: center;
  min-height: calc(100vh - 92px);
  padding: 4rem 2rem 3rem;
}

.hero-content {
  max-width: 680px;
}

.eyebrow {
  margin: 0 0 1rem;
  color: var(--accent);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.85rem;
}

.hero h1 {
  margin: 0;
  font-family: 'Playfair Display', serif;
  font-size: clamp(3rem, 4.3vw, 5rem);
  line-height: 0.95;
}

.hero p {
  margin: 1.6rem 0 2rem;
  max-width: 34rem;
  color: var(--muted);
  line-height: 1.8;
  font-size: 1.05rem;
}

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

.hero-image {
  min-height: 520px;
  border-radius: var(--radius);
  background: url('https://images.unsplash.com/photo-1519699047748-d75f0a8ff7b7?auto=format&fit=crop&w=1200&q=80') center/cover no-repeat;
  box-shadow: var(--shadow);
}

.section {
  padding: 4rem 2rem;
}

.section-inner,
.section-header {
  max-width: 1200px;
  margin: 0 auto;
}

/* Responsive Design */
@media (max-width: 1024px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 3rem 1.5rem 2rem;
  }

  .hero h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-image {
    min-height: 400px;
  }

  .section {
    padding: 3rem 1.5rem;
  }
}

@media (max-width: 768px) {
  .topbar {
    padding: 1rem 1.5rem;
    flex-direction: column;
    gap: 0.5rem;
  }

  .logo {
    font-size: 1.25rem;
  }

  nav {
    gap: 1rem;
  }

  .hero {
    padding: 2rem 1rem 1.5rem;
    min-height: auto;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    margin: 1rem 0 1.5rem;
    font-size: 0.95rem;
  }

  .hero-image {
    min-height: 300px;
  }

  .section {
    padding: 2rem 1rem;
  }

  .btn,
  .button {
    padding: 0.75rem 1.5rem;
    font-size: 0.9rem;
  }
}

@media (max-width: 480px) {
  .topbar {
    padding: 0.75rem 1rem;
  }

  .logo {
    font-size: 1.1rem;
  }

  nav {
    flex-wrap: wrap;
    justify-content: center;
  }

  .hero h1 {
    font-size: 1.75rem;
  }

  .hero p {
    font-size: 0.9rem;
  }

  .hero-image {
    min-height: 250px;
  }

  .section {
    padding: 1.5rem 1rem;
  }

  .btn,
  .button {
    padding: 0.6rem 1.2rem;
    font-size: 0.85rem;
  }
}

.container {
  max-width: 1180px;
  margin: 0 auto;
}

.section-header {
  display: grid;
  gap: 1rem;
  margin-bottom: 2.4rem;
}

.section-tag {
  margin: 0;
  color: var(--accent-2);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.85rem;
  font-weight: 700;
}

.section h2 {
  margin: 0;
  font-size: clamp(2rem, 3vw, 3rem);
  line-height: 1.05;
}

.section-text p {
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.section-carousel .carousel-wrapper {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  background: rgba(27, 45, 106, 0.08);
  box-shadow: var(--shadow);
}

.carousel-track {
  display: flex;
  transition: transform 0.6s ease;
  will-change: transform;
}

.carousel-slide {
  min-width: 100%;
  position: relative;
}

.carousel-slide img {
  width: 100%;
  display: block;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.slide-caption {
  position: absolute;
  left: 1.5rem;
  bottom: 1.5rem;
  color: #fff;
  background: rgba(0, 20, 50, 0.65);
  padding: 0.9rem 1.25rem;
  border-radius: 999px;
  font-weight: 600;
  max-width: calc(100% - 3rem);
}

.carousel-controls {
  position: absolute;
  right: 1.5rem;
  bottom: 1.5rem;
  display: flex;
  gap: 0.75rem;
}

.carousel-button {
  width: 3rem;
  height: 3rem;
  display: grid;
  place-items: center;
  border: none;
  border-radius: 50%;
  background: rgba(27, 45, 106, 0.96);
  color: #fff;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 12px 24px rgba(27, 45, 106, 0.2);
  transition: transform 0.2s ease, background-color 0.2s ease;
}

.carousel-button:hover {
  transform: translateY(-1px);
  background: #152a67;
}

.stats-grid {
  display: grid;
  gap: 1.25rem;
  margin-top: 2.5rem;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
}

.stat-card {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 22px;
  min-height: 160px;
  padding: 1.8rem;
  display: grid;
  gap: 0.75rem;
}

.stat-card h3 {
  margin: 0;
  font-size: 2.6rem;
}

.stat-card p {
  margin: 0;
  color: var(--muted);
}

.gallery-filters,
.profile-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.75rem;
}

.filter-button {
  border: none;
  color: #fff;
  background: var(--accent);
  border-radius: 999px;
  padding: 0.9rem 1.4rem;
  cursor: pointer;
  transition: transform 0.2s ease, background-color 0.2s ease, border-color 0.2s ease;
}

.filter-button:hover {
  transform: translateY(-1px);
  background: #152a67;
}

.filter-button.active {
  background: #152a67;
  border-color: transparent;
  color: #fff;
}

.gallery-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.gallery-card {
  position: relative;
  border-radius: 26px;
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.3s ease;
}

.gallery-card:hover {
  transform: translateY(-6px);
}

.gallery-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(0, 0, 0, 0.5));
}

.gallery-meta {
  position: absolute;
  bottom: 1rem;
  left: 1rem;
  right: 1rem;
  color: #fff;
  z-index: 1;
  font-weight: 600;
}

.section-media .video-panel {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 1.8rem;
}

.video-player {
  border-radius: 30px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #000;
  min-height: 340px;
}

.video-player iframe {
  width: 100%;
  height: 100%;
  min-height: 340px;
}

.video-list {
  display: grid;
  gap: 1rem;
}

.video-card {
  border-radius: 24px;
  padding: 1.3rem;
  background: var(--accent);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.video-card:hover {
  transform: translateY(-2px);
}

.video-card.active {
  background: linear-gradient(135deg, rgba(61, 193, 211, 0.16), rgba(255, 123, 114, 0.14));
  border-color: rgba(61, 193, 211, 0.4);
}

.video-card span {
  display: block;
  font-weight: 600;
}

.profiles-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.profile-callout {
  margin-top: 2rem;
  text-align: center;
}

.profile-card {
  padding: 0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: var(--shadow);
  display: grid;
  gap: 1rem;
  overflow: hidden;
}

.profile-card img {
  width: 100%;
  height: 240px;
  object-fit: cover;
  display: block;
}

.profile-card h3 {
  margin: 0;
  font-size: 1.35rem;
}

.profile-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.profile-role {
  display: inline-flex;
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: var(--accent-2);
  font-size: 0.9rem;
  font-weight: 700;
}

.footer {
  padding: 3rem 2rem;
  margin-top: 1.5rem;
  background: rgba(255, 255, 255, 0.05);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  border-radius: 32px 32px 0 0;
}

.footer h3 {
  margin: 0 0 0.8rem;
}

.footer p {
  margin: 0;
  max-width: 40rem;
  color: var(--muted);
}

@media (max-width: 980px) {
  .topbar {
    flex-wrap: wrap;
    gap: 0.8rem;
    padding: 1.5rem 1.5rem;
  }

  nav {
    justify-content: center;
    gap: 1rem;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 3.5rem 1.5rem 2.5rem;
  }

  .hero-image {
    min-height: 380px;
  }

  .section {
    padding: 3rem 1.5rem;
  }

  .section-media .video-panel {
    grid-template-columns: 1fr;
  }

  .gallery-grid,
  .profiles-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .carousel-controls {
    right: 1rem;
    bottom: 1rem;
  }
}

@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1rem;
  }

  nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  .hero {
    padding: 3rem 1rem 2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .button {
    width: 100%;
  }

  .section,
  .footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .video-player iframe {
    min-height: 220px;
  }

  .carousel-button {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.3rem;
  }

  .slide-caption {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    font-size: 0.95rem;
  }

  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
}

.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: grid;
  place-items: center;
  padding: 1.5rem;
  z-index: 100;
}

.lightbox-card {
  position: relative;
  max-width: 900px;
  width: 100%;
  border-radius: 32px;
  overflow: hidden;
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.5);
  background: rgba(10, 18, 31, 0.95);
}

.lightbox-card img {
  width: 100%;
  display: block;
  height: auto;
}

.lightbox-card p {
  margin: 0;
  padding: 1.3rem 1.5rem 1.9rem;
  color: #f2f6ff;
  font-size: 1rem;
  background: rgba(3, 8, 16, 0.8);
}

.lightbox-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  border: none;
  background: rgba(255, 255, 255, 0.1);
  width: 42px;
  height: 42px;
  border-radius: 50%;
  color: #fff;
  font-size: 1.55rem;
  cursor: pointer;
}

/* Legacy page helpers */
.navbar,
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  padding: 1.25rem 2rem;
  backdrop-filter: blur(18px);
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(27, 45, 106, 0.12);
  position: sticky;
  top: 0;
  z-index: 10;
}

.navbar-brand,
.logo {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  letter-spacing: 0.08em;
  color: var(--text);
  text-decoration: none;
}

.navbar-menu {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.navbar-menu li {
  margin: 0;
}

.navbar-menu a {
  color: var(--muted);
  text-decoration: none;
  transition: color 0.25s ease;
}

.navbar-menu a:hover {
  color: var(--text);
}

.btn,
.button,
button,
input[type="submit"],
input[type="button"] {
  border: none;
  border-radius: 999px;
  padding: 0.6rem 1.2rem;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
  background: var(--accent);
  color: #fff;
  font-weight: 600;
}

.btn:hover,
.button:hover,
button:hover,
input[type="submit"]:hover,
input[type="button"]:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  box-shadow: 0 24px 50px rgba(27, 45, 106, 0.24);
}

.btn-secondary {
  background: #4c57b8;
}

.btn-secondary:hover {
  background: #3f49a4;
}

.btn-danger {
  background: #e53935;
}

.btn-block {
  width: 100%;
}

/* Logout button styling */
.logout-btn {
  color: #fff !important;
  background: #dc3545 !important;
  border: 1px solid #dc3545 !important;
}

/* Logout button hover styling */
.logout-btn:hover {
  color: #fff !important;
  background: #c82333 !important;
  border-color: #c82333 !important;
}

.content {
  padding: 4rem 2rem;
}

.container {
  max-width: 1180px;
  margin: 0 auto;
}

.form-container {
  width: 100%;
  max-width: 720px;
  margin: 0 auto;
  padding: 2rem;
  background: var(--surface-strong);
  border-radius: 32px;
  box-shadow: var(--shadow);
}

.form-group {
  margin-bottom: 1.4rem;
}

.form-group label {
  display: block;
  margin-bottom: 0.65rem;
  font-weight: 700;
  color: var(--text);
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  border: 1px solid rgba(27, 45, 106, 0.16);
  border-radius: 18px;
  padding: 0.95rem 1rem;
  background: #fff;
  color: var(--text);
  font-family: inherit;
}

.form-group input[type="time"] {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3e%3ccircle cx='12' cy='12' r='10'%3e%3c/circle%3e%3cpolyline points='12 6 12 12 16 14'%3e%3c/polyline%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-group input[type="time"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 104, 146, 0.1);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234d6892' stroke-width='2'%3e%3ccircle cx='12' cy='12' r='10'%3e%3c/circle%3e%3cpolyline points='12 6 12 12 16 14'%3e%3c/polyline%3e%3c/svg%3e");
}

.form-group input[type="time"]:hover {
  border-color: rgba(77, 104, 146, 0.3);
}

.form-group input[type="date"] {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3e%3c/rect%3e%3cline x1='16' y1='2' x2='16' y2='6'%3e%3c/line%3e%3cline x1='8' y1='2' x2='8' y2='6'%3e%3c/line%3e%3cline x1='3' y1='10' x2='21' y2='10'%3e%3c/line%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.form-group input[type="date"]:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 104, 146, 0.1);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234d6892' stroke-width='2'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3e%3c/rect%3e%3cline x1='16' y1='2' x2='16' y2='6'%3e%3c/line%3e%3cline x1='8' y1='2' x2='8' y2='6'%3e%3c/line%3e%3cline x1='3' y1='10' x2='21' y2='10'%3e%3c/line%3e%3c/svg%3e");
}

.form-group input[type="date"]:hover {
  border-color: rgba(77, 104, 146, 0.3);
}

/* General date input styling for inputs not in .form-group */
input[type="date"] {
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3e%3c/rect%3e%3cline x1='16' y1='2' x2='16' y2='6'%3e%3c/line%3e%3cline x1='8' y1='2' x2='8' y2='6'%3e%3c/line%3e%3cline x1='3' y1='10' x2='21' y2='10'%3e%3c/line%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 1.25rem;
  padding-right: 2.5rem;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 1px solid rgba(27, 45, 106, 0.16);
  border-radius: 8px;
  padding: 0.5rem 0.75rem;
  background-color: #fff;
  font-family: inherit;
  font-size: 0.9rem;
}

input[type="date"]:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(77, 104, 146, 0.1);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234d6892' stroke-width='2'%3e%3crect x='3' y='4' width='18' height='18' rx='2' ry='2'%3e%3c/rect%3e%3cline x1='16' y1='2' x2='16' y2='6'%3e%3c/line%3e%3cline x1='8' y1='2' x2='8' y2='6'%3e%3c/line%3e%3cline x1='3' y1='10' x2='21' y2='10'%3e%3c/line%3e%3c/svg%3e");
}

input[type="date"]:hover {
  border-color: rgba(77, 104, 146, 0.3);
}

.form-group textarea {
  min-height: 140px;
  resize: vertical;
}

.alert {
  border-radius: 22px;
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  box-shadow: 0 16px 40px rgba(27, 45, 106, 0.08);
}

.alert-success {
  background: rgba(71, 184, 129, 0.12);
  border-left: 4px solid #47b881;
  color: #134c24;
}

.alert-danger {
  background: rgba(244, 67, 54, 0.12);
  border-left: 4px solid #f44336;
  color: #7f1d1d;
}

.alert-info {
  background: rgba(33, 150, 243, 0.12);
  border-left: 4px solid #2196f3;
  color: #0f3d75;
}

.card {
  background: var(--surface);
  border-radius: 28px;
  padding: 1.6rem;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease;
}

.card:hover {
  transform: translateY(-3px);
}

.card-title {
  margin-bottom: 0.85rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--accent);
}

.card-body {
  color: var(--muted);
  line-height: 1.8;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1rem;
}

.grid {
  display: grid;
  gap: 1.5rem;
}

.grid-2 {
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
}

.grid-3 {
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.table-responsive {
  overflow-x: auto;
  border-radius: 24px;
  box-shadow: var(--shadow);
  margin-bottom: 1.5rem;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  min-width: 680px;
}

thead {
  background: rgba(27, 45, 106, 0.08);
}

th,
td {
  padding: 1rem 1rem;
  text-align: left;
  border-bottom: 1px solid rgba(27, 45, 106, 0.08);
}

th {
  font-weight: 700;
  color: var(--accent);
}

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

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.95rem;
  border-radius: 999px;
  background: rgba(27, 45, 106, 0.08);
  color: var(--accent);
  font-size: 0.85rem;
  font-weight: 700;
}

.stat-box {
  background: linear-gradient(180deg, #e8eeff 0%, #d7e2fd 100%);
  border: 1px solid rgba(88, 110, 255, 0.18);
  border-radius: 28px;
  padding: 1.6rem;
  box-shadow: 0 22px 45px rgba(63, 84, 162, 0.12);
}

.dashboard-panel {
  background: linear-gradient(180deg, #f6faff 0%, #e8eeff 100%);
  border: 1px solid rgba(105, 129, 255, 0.24);
  border-radius: 28px;
  box-shadow: 0 20px 50px rgba(71, 92, 175, 0.12);
  overflow: hidden;
  margin-top: 2rem;
  margin-bottom: 1.5rem;
}

.panel-header {
  padding: 1.8rem 2rem 0;
}

.panel-header h2 {
  margin: 0;
  font-size: 1.45rem;
  letter-spacing: -0.03em;
  color: #1f3253;
}

.panel-subtitle {
  margin-top: 0.5rem;
  color: #5f6f8b;
  font-size: 0.95rem;
}

.panel-body {
  padding: 1.5rem 2rem 2rem;
}

.section-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.filter-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.filter-row label,
.section-filters label {
  font-weight: 600;
  color: #4a5568;
}

.filter-row input[type="date"] {
  padding: 0.75rem 1rem;
  border-radius: 14px;
  border: 1px solid #cbd5e1;
  background: #f8fafc;
  color: #2d3748;
}

.stat-label {
  margin-bottom: 0.85rem;
  display: block;
  color: var(--muted);
  font-size: 0.9rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.stat-number {
  font-size: 2.6rem;
  font-weight: 700;
  color: var(--accent);
}

footer {
  padding: 2rem;
  text-align: center;
  color: var(--muted);
}

footer p {
  margin: 0.35rem 0;
}

.required::after {
  content: '*';
  color: #f44336;
  margin-left: 0.25rem;
}

@media (max-width: 980px) {
  .navbar,
  .topbar {
    flex-wrap: wrap;
    padding: 1.25rem 1.5rem;
  }

  .container {
    padding: 0;
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: auto;
    padding: 3.5rem 1.5rem 2.5rem;
  }

  .hero-image {
    min-height: 380px;
  }

  .section {
    padding: 3rem 1.5rem;
  }

  .section-media .video-panel {
    grid-template-columns: 1fr;
  }

  .gallery-grid,
  .profiles-grid {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .carousel-controls {
    right: 1rem;
    bottom: 1rem;
  }

  /* Form responsiveness */
  .entry-form,
  .recent-entries {
    padding: 1.5rem;
    max-height: none;
    overflow-y: visible;
  }

  .form-row {
    grid-template-columns: 1fr;
  }

  .form-section {
    width: 100%;
    margin-right: 0;
  }

  /* Table responsiveness */
  .data-table {
    font-size: 0.9rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.8rem 0.5rem;
  }

  /* Metric cards responsiveness */
  .summary-metrics {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 1.5rem;
  }

  .metric-card {
    padding: 1.5rem 1rem;
  }

  .metric-value {
    font-size: 2rem;
  }
}

/* Mobile devices */
@media (max-width: 720px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem 1rem;
  }

  nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.75rem;
  }

  nav a {
    padding: 0.5rem 1rem;
    font-size: 0.9rem;
  }

  .hero {
    padding: 3rem 1rem 2rem;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-actions .button {
    width: 100%;
  }

  .section,
  .footer {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  .video-player iframe {
    min-height: 220px;
  }

  .carousel-button {
    width: 2.6rem;
    height: 2.6rem;
    font-size: 1.3rem;
  }

  .slide-caption {
    left: 1rem;
    right: 1rem;
    bottom: 1rem;
    font-size: 0.95rem;
  }

  .footer {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  /* Entry page mobile styles */
  .entry-container {
    padding: 0.5rem;
  }

  .entry-header h1 {
    font-size: 2rem;
  }

  .entry-form {
    padding: 1rem;
  }

  .form-group {
    margin-bottom: 1.5rem;
  }

  .form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
  }

  .form-group.checkbox-group {
    margin-bottom: 1rem;
  }

  .show-password-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
  }

  .show-password-container input[type="checkbox"] {
    width: auto;
    margin: 0;
    cursor: pointer;
  }

  .show-password-container label {
    cursor: pointer;
    color: var(--text-light);
    font-size: 0.9rem;
    margin: 0;
  }

  .form-group input:not([type="checkbox"]),
  .form-group select {
    width: 100%;
    padding: 0.8rem;
    font-size: 1rem;
  }

  /* Button responsiveness */
  .button {
    padding: 0.8rem 1.2rem;
    font-size: 0.9rem;
  }

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

  .form-actions .button {
    width: 100%;
  }

  /* Modal responsiveness */
  .shift-modal {
    padding: 2rem 1.5rem;
    width: 95%;
    max-width: none;
  }

  .shift-modal h3 {
    font-size: 1.5rem;
  }

  /* Report page mobile styles */
  .report-container {
    padding: 1rem 0.5rem;
  }

  .report-header h1 {
    font-size: 2.2rem;
  }

  .date-range-filter {
    flex-direction: column;
    gap: 1rem;
  }

  .filter-controls {
    flex-wrap: wrap;
    justify-content: center;
  }

  .filter-btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    margin: 0.25rem;
  }

  .custom-date-range {
    width: 100%;
  }

  .custom-date-range form {
    flex-direction: column;
    gap: 0.75rem;
  }

  .custom-date-range input {
    width: 100%;
  }

  /* Metric cards mobile */
  .summary-metrics {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .metric-card {
    padding: 1.5rem 1rem;
  }

  .metric-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.2rem;
  }

  .metric-label {
    font-size: 0.95rem;
  }

  .metric-value {
    font-size: 2.2rem;
  }

  /* Table mobile styles */
  .data-table {
    font-size: 0.8rem;
    overflow-x: auto;
    display: block;
    white-space: nowrap;
  }

  .data-table th,
  .data-table td {
    padding: 0.6rem 0.4rem;
    min-width: 80px;
  }

  /* Modal mobile styles */
  .modal {
    width: 95%;
    max-width: none;
    margin: 1rem;
    max-height: 80vh;
    overflow-y: auto;
  }

  .modal h2 {
    font-size: 1.3rem;
  }
}

/* Small phones */
@media (max-width: 480px) {
  .topbar {
    padding: 0.75rem 0.75rem;
  }

  .logo {
    font-size: 1.1rem;
  }

  nav a {
    padding: 0.4rem 0.8rem;
    font-size: 0.8rem;
  }

  .hero {
    padding: 2rem 0.75rem 1.5rem;
  }

  .hero h1 {
    font-size: 2rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .section {
    padding: 2rem 0.75rem;
  }

  /* Entry page small phone styles */
  .entry-container {
    padding: 0.25rem;
  }

  .entry-header {
    text-align: center;
    margin-bottom: 1.5rem;
  }

  .entry-header h1 {
    font-size: 1.8rem;
  }

  .entry-form {
    padding: 0.75rem;
  }

  .form-group input,
  .form-group select {
    padding: 0.7rem;
    font-size: 0.95rem;
  }

  .button {
    padding: 0.7rem 1rem;
    font-size: 0.85rem;
  }

  /* Report page small phone styles */
  .report-container {
    padding: 0.5rem 0.25rem;
  }

  .report-header h1 {
    font-size: 1.8rem;
  }

  .report-header p {
    font-size: 0.9rem;
  }

  /* Project-wide responsive helpers */
  .page-shell,
  .dashboard-shell,
  .details-page,
  .details-container,
  .form-container,
  .login-panel,
  .login-card,
  .login-side,
  .login-form-card,
  .dashboard-panel,
  .panel-body {
    max-width: 1180px;
    width: 100%;
  }

  .page-header,
  .navbar,
  .topbar,
  .dashboard-nav,
  .section-filters,
  .filter-row,
  .action-row,
  .form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.9rem;
  }

  .navbar-menu {
    justify-content: flex-end;
  }

  .navbar-menu a {
    padding: 0.75rem 1rem;
  }

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

  .table-responsive table {
    min-width: 100%;
  }

  .detail-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .detail-value,
  .detail-label {
    text-align: left;
  }

  .btn,
  .button,
  input[type="submit"],
  input[type="button"] {
    min-width: 0;
  }

  .btn-block,
  .hero-actions .button {
    width: 100%;
  }

  @media (max-width: 980px) {
    .navbar,
    .topbar,
    .page-header,
    .dashboard-nav,
    .section-filters,
    .filter-row,
    .action-row,
    .form-actions {
      justify-content: center;
      align-items: stretch;
    }

    .navbar-menu {
      width: 100%;
      justify-content: center;
    }

    .page-header {
      flex-direction: column;
      align-items: flex-start;
    }

    .content,
    .dashboard-shell,
    .details-page,
    .form-container {
      padding-left: 1rem;
      padding-right: 1rem;
    }

    th,
    td {
      padding: 0.85rem 0.75rem;
    }
  }

  @media (max-width: 768px) {
    .navbar,
    .topbar,
    .page-header,
    .dashboard-nav,
    .section-filters,
    .filter-row,
    .action-row,
    .form-actions {
      flex-direction: column;
      align-items: stretch;
    }

    .navbar-menu {
      justify-content: center;
    }

    .navbar-brand,
    .logo {
      font-size: 1.25rem;
    }

    .hero,
    .dashboard-panel,
    .details-grid,
    .details-container,
    .form-container,
    .login-panel,
    .page-shell,
    .content {
      padding-left: 1rem;
      padding-right: 1rem;
    }

    .detail-row {
      grid-template-columns: 1fr;
    }

    .form-group input,
    .form-group select,
    .form-group textarea,
    .filter-row input[type="date"] {
      width: 100%;
    }
  }

  @media (max-width: 580px) {
    .navbar,
    .topbar,
    .page-header,
    .dashboard-nav,
    .section-filters,
    .filter-row,
    .action-row,
    .form-actions {
      padding: 0.75rem 0;
    }

    .navbar-menu a,
    .btn,
    .button {
      font-size: 0.92rem;
      padding: 0.7rem 0.95rem;
    }

    .details-title,
    .dashboard-banner h1,
    .hero h1,
    .login-side h1,
    .page-header h1 {
      font-size: clamp(1.8rem, 5vw, 2.4rem);
    }

    .detail-section,
    .stat-box,
    .dashboard-panel,
    .panel-body,
    .form-container,
    .login-card,
    .login-side {
      padding: 1.25rem !important;
    }

    th,
    td {
      padding: 0.7rem 0.55rem;
    }
  }

  .filter-btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
  }

  .custom-date-range input {
    padding: 0.6rem;
    font-size: 0.9rem;
  }

  /* Metric cards small phone */
  .metric-card {
    padding: 1.2rem 0.8rem;
  }

  .metric-icon {
    width: 2rem;
    height: 2rem;
    font-size: 1rem;
  }

  .metric-label {
    font-size: 0.9rem;
  }

  .metric-value {
    font-size: 1.8rem;
  }

  /* Table small phone styles */
  .data-table th,
  .data-table td {
    padding: 0.5rem 0.3rem;
    font-size: 0.75rem;
  }

  /* Modal small phone styles */
  .modal {
    width: 98%;
    margin: 0.5rem;
    padding: 1rem;
  }

  .modal h2 {
    font-size: 1.2rem;
  }

  .lightbox-overlay {
    padding: 0.5rem;
  }
}

/* Tablet screens (480px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  .topbar {
    flex-direction: column;
    align-items: stretch;
    padding: 1rem;
    gap: 0.5rem;
  }

  nav {
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.8rem;
  }

  nav a {
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
  }

  .logo {
    font-size: 1.3rem;
  }

  .hero {
    grid-template-columns: 1fr;
    padding: 2.5rem 1rem 2rem;
  }

  .hero h1 {
    font-size: 2.5rem;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .hero-image {
    min-height: 300px;
  }

  .section {
    padding: 2.5rem 1rem;
  }

  .section h2 {
    font-size: 2rem;
  }

  .entry-container {
    padding: 0.75rem;
  }

  .entry-form {
    padding: 1.25rem;
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-group input,
  .form-group select {
    padding: 0.75rem;
    font-size: 0.95rem;
  }

  .data-table {
    font-size: 0.85rem;
    overflow-x: auto;
  }

  .data-table th,
  .data-table td {
    padding: 0.6rem 0.5rem;
  }

  .button {
    padding: 0.75rem 1.25rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

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

  .form-actions .button {
    width: 100%;
  }

  .metric-card {
    padding: 1.5rem 1rem;
  }

  .metric-icon {
    width: 2.5rem;
    height: 2.5rem;
    font-size: 1.25rem;
  }

  .metric-label {
    font-size: 0.9rem;
  }

  .metric-value {
    font-size: 1.8rem;
  }

  .report-container {
    padding: 1rem 0.75rem;
  }

  .report-header h1 {
    font-size: 1.8rem;
  }

  .filter-btn {
    padding: 0.6rem 0.9rem;
    font-size: 0.85rem;
  }

  .custom-date-range input {
    padding: 0.65rem;
    font-size: 0.9rem;
  }

  .modal {
    width: 90%;
    padding: 1.5rem;
  }

  .modal h2 {
    font-size: 1.3rem;
  }

  .recent-entries {
    margin-top: 1.5rem;
  }

  .recent-entries table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }
}

/* Large tablet screens (769px - 980px) */
@media (min-width: 769px) and (max-width: 980px) {
  .topbar {
    padding: 1.1rem 1.5rem;
    gap: 1.2rem;
  }

  nav {
    gap: 1.2rem;
  }

  nav a {
    font-size: 0.95rem;
  }

  .logo {
    font-size: 1.4rem;
  }

  .hero {
    grid-template-columns: 1.1fr 0.9fr;
    padding: 3.25rem 1.5rem 2.5rem;
    gap: 1.5rem;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .hero p {
    font-size: 1rem;
  }

  .hero-image {
    min-height: 350px;
  }

  .section {
    padding: 3rem 1.5rem;
  }

  .section h2 {
    font-size: 2.3rem;
  }

  .entry-container {
    padding: 1rem;
  }

  .entry-form {
    padding: 1.5rem;
  }

  .form-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .form-group input,
  .form-group select {
    padding: 0.8rem;
    font-size: 0.95rem;
  }

  .data-table {
    font-size: 0.9rem;
  }

  .data-table th,
  .data-table td {
    padding: 0.65rem;
  }

  .button {
    padding: 0.85rem 1.4rem;
    font-size: 0.9rem;
    min-height: 44px;
  }

  .metric-card {
    padding: 1.5rem 1.25rem;
  }

  .metric-icon {
    width: 2.8rem;
    height: 2.8rem;
    font-size: 1.3rem;
  }

  .metric-label {
    font-size: 0.95rem;
  }

  .metric-value {
    font-size: 1.9rem;
  }

  .report-header h1 {
    font-size: 2rem;
  }

  .filter-btn {
    padding: 0.65rem 1rem;
    font-size: 0.9rem;
  }

  .custom-date-range input {
    padding: 0.7rem;
    font-size: 0.95rem;
  }

  .modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(10, 25, 63, 0.6);
    padding: 1.5rem;
    z-index: 2000;
    overflow-y: auto;
  }

  .modal-content {
    width: 100%;
    max-width: 560px;
    background: #ffffff;
    border-radius: 22px;
    box-shadow: 0 30px 75px rgba(20, 40, 95, 0.18);
    overflow: hidden;
    border: 1px solid rgba(59, 130, 246, 0.15);
  }

  .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.75rem 0;
  }

  .modal-body {
    padding: 1.5rem 1.75rem 2rem;
  }

  .modal h2,
  .modal h3 {
    font-size: 1.5rem;
    margin: 0;
  }

  .recent-entries {
    margin-top: 2rem;
  }
}

/* Touch-friendly adjustments for all mobile/tablet devices */
@media (max-width: 980px) {
  /* Increase touch target sizes */
  button,
  .button,
  input[type="submit"],
  input[type="checkbox"],
  input[type="radio"] {
    min-height: 44px;
    min-width: 44px;
  }

  /* Improve spacing for touch interaction */
  .form-group {
    margin-bottom: 1.25rem;
  }

  /* Make tables scrollable on mobile */
  .data-table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Better form input sizing */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="time"],
  select,
  textarea {
    font-size: 16px;
    line-height: 1.5;
  }

  /* Prevent horizontal scroll */
  body {
    overflow-x: hidden;
  }

  /* Better spacing for navigation */
  .topbar a,
  nav a {
    padding: 0.5rem 0.75rem;
    display: inline-block;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
  }

  /* Improve card spacing */
  .metric-card,
  .report-card,
  .dashboard-card {
    margin-bottom: 1rem;
  }

  /* Better dropdown/select sizing */
  select {
    padding: 0.75rem;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2'%3e%3cpolyline points='6 9 12 15 18 9'%3e%3c/polyline%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 0.5rem center;
    background-size: 1.5em 1.5em;
    padding-right: 2.25rem;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
  }

  /* Improve checkbox alignment */
  .show-password-container {
    margin-bottom: 1rem;
  }

  .show-password-container input[type="checkbox"] {
    cursor: pointer;
    min-width: 18px;
    min-height: 18px;
  }

  /* Better modal responsiveness */
  .modal,
  .shift-modal,
  .lightbox-overlay {
    max-width: 95vw;
    max-height: 95vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Responsive grid layouts */
  .gallery-grid,
  .profiles-grid,
  .section-media {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  /* Better typography for mobile */
  h1 {
    line-height: 1.2;
    margin: 1rem 0;
  }

  h2 {
    line-height: 1.3;
    margin: 0.8rem 0;
  }

  h3 {
    line-height: 1.3;
    margin: 0.6rem 0;
  }

  p {
    line-height: 1.6;
  }
}

/* COMPREHENSIVE MOBILE & TABLET OPTIMIZATIONS */

/* Universal mobile improvements */
@media (max-width: 980px) {
  /* Prevent horizontal overflow */
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  /* Enhanced touch targets for all interactive elements */
  button,
  .btn,
  .button,
  input[type="submit"],
  input[type="button"],
  .nav-btn,
  .nav-link,
  a.btn,
  a.button {
    min-height: 44px;
    min-width: 44px;
    padding: 12px 16px !important;
    font-size: 16px;
  }

  /* Improved form spacing for touch */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="date"],
  input[type="tel"],
  textarea,
  select {
    min-height: 44px;
    padding: 12px 14px;
    font-size: 16px;
    border-radius: 12px;
    width: 100%;
  }

  /* Better checkbox/radio spacing */
  input[type="checkbox"],
  input[type="radio"] {
    width: 20px;
    height: 20px;
    margin: 8px;
    cursor: pointer;
  }

  label {
    margin-bottom: 12px;
    display: block;
  }

  /* Improved form groups */
  .form-group {
    margin-bottom: 1.5rem;
  }

  /* Better table scrolling */
  .table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    border-radius: 12px;
    border: 1px solid rgba(55, 120, 194, 0.1);
    width: 100%;
  }

  table {
    width: 100%;
    min-width: 100%;
  }

  th,
  td {
    padding: 12px 8px;
    font-size: 0.9rem;
  }

  /* Better grid layouts */
  .grid,
  .grid-2,
  .grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Prevent card overflow */
  .card,
  .stat-card,
  .dashboard-card {
    overflow: hidden;
    word-wrap: break-word;
  }

  /* Better content containers */
  .container,
  .form-container,
  .content {
    padding-left: max(1rem, env(safe-area-inset-left));
    padding-right: max(1rem, env(safe-area-inset-right));
    max-width: 100%;
  }
}

/* Tablet screens (481px - 768px) */
@media (min-width: 481px) and (max-width: 768px) {
  body {
    overflow-x: hidden;
  }

  .topbar,
  .navbar {
    flex-direction: column;
    padding: 1rem;
    gap: 1rem;
    width: 100%;
  }

  .logo {
    text-align: center;
  }

  nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.75rem;
    width: 100%;
  }

  nav a {
    padding: 10px 16px;
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .hero {
    padding: 2.5rem 1.5rem 1.5rem;
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero h1 {
    font-size: 2.2rem;
    line-height: 1.2;
  }

  .hero p {
    font-size: 0.95rem;
  }

  .hero-image {
    min-height: 320px;
    margin-top: 1rem;
  }

  .dashboard-shell {
    padding: 1.5rem;
    max-width: 100%;
  }

  .dashboard-card-grid,
  .dashboard-grid,
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .section {
    padding: 2.5rem 1.5rem;
  }

  .section h2 {
    font-size: 2rem;
  }

  .section-media .video-panel {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .video-player {
    min-height: 280px;
    border-radius: 20px;
  }

  .video-player iframe {
    min-height: 280px;
  }

  .gallery-grid,
  .profiles-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.5rem;
  }

  .gallery-card,
  .profile-card {
    border-radius: 20px;
  }

  .appointment-list,
  .card-list {
    gap: 1.5rem;
  }

  .appointment-card {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .filter-controls {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    width: 100%;
  }

  .filter-controls input,
  .filter-controls select {
    flex: 1;
    min-width: 150px;
  }

  .modal {
    width: 90%;
    padding: 1.5rem;
    max-height: 90vh;
    overflow-y: auto;
    border-radius: 20px;
  }

  .modal h2,
  .modal h3 {
    font-size: 1.4rem;
    margin: 0 0 1rem 0;
  }

  .page-header {
    flex-direction: column;
    align-items: flex-start;
    padding: 0 1rem;
    gap: 1rem;
  }

  .page-intro {
    text-align: left;
    width: 100%;
  }

  .login-panel {
    grid-template-columns: 1fr;
    border-radius: 24px;
  }

  .login-side {
    padding: 2rem 1.5rem;
    order: 2;
  }

  .login-form-card {
    padding: 2rem 1.5rem;
  }

  .login-card {
    max-width: 100%;
  }

  .cta-actions,
  .hero-actions {
    flex-direction: column;
    gap: 1rem;
  }

  .cta-actions .button,
  .hero-actions .button {
    width: 100%;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }
}

/* Small phones (max 480px) */
@media (max-width: 480px) {
  html, body {
    padding: 0;
    margin: 0;
    overflow-x: hidden;
    width: 100%;
  }

  .topbar,
  .navbar {
    flex-direction: column;
    padding: 0.75rem;
    gap: 0.75rem;
    width: 100%;
  }

  .logo {
    font-size: 1.15rem;
    text-align: center;
    width: 100%;
  }

  nav {
    padding: 0;
    justify-content: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    width: 100%;
  }

  nav a {
    padding: 10px 14px;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .hero {
    padding: 1.5rem 0.75rem 1rem;
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .hero h1 {
    font-size: 1.8rem;
    line-height: 1.2;
    margin: 0.5rem 0;
  }

  .hero p {
    font-size: 0.9rem;
    margin: 0.75rem 0 1rem;
    line-height: 1.5;
  }

  .hero-image {
    min-height: 260px;
    border-radius: 16px;
    margin-top: 1rem;
  }

  .section {
    padding: 1.5rem 0.75rem;
    width: 100%;
  }

  .section h2 {
    font-size: 1.6rem;
    line-height: 1.2;
    margin: 0 0 1rem 0;
  }

  .section p {
    font-size: 0.9rem;
    line-height: 1.6;
  }

  .dashboard-shell {
    padding: 0.75rem;
    width: 100%;
  }

  .dashboard-header {
    padding: 1rem 0.75rem;
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .dashboard-header h1 {
    font-size: 1.6rem;
    line-height: 1.2;
    margin: 0;
  }

  .dashboard-card-grid,
  .dashboard-grid,
  .form-grid,
  .stats-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .appointment-card {
    grid-template-columns: 1fr;
    gap: 0.75rem;
    padding: 1rem;
  }

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

  .appointment-actions .button {
    width: 100%;
  }

  .filter-controls {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .filter-controls input,
  .filter-controls select,
  .filter-controls button {
    width: 100%;
    padding: 10px 12px;
  }

  .gallery-grid,
  .profiles-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .gallery-card,
  .profile-card {
    border-radius: 16px;
    overflow: hidden;
  }

  .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 0.75rem;
    padding: 0.75rem;
  }

  .page-header a {
    font-size: 0.9rem;
  }

  .page-intro {
    text-align: left;
    font-size: 0.85rem;
  }

  .login-panel {
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .login-side {
    padding: 1.5rem 1rem;
    order: 2;
  }

  .login-side h1 {
    font-size: 1.8rem;
    line-height: 1.2;
  }

  .login-form-card {
    padding: 1.5rem 1rem;
  }

  .login-card {
    max-width: 100%;
    border-radius: 18px;
  }

  .login-card h2 {
    font-size: 1.5rem;
    margin: 0 0 1rem 0;
  }

  .benefit-item {
    font-size: 0.9rem;
    gap: 0.65rem;
  }

  .benefit-item::before {
    width: 1.4rem;
    height: 1.4rem;
    font-size: 0.8rem;
  }

  .modal,
  .shift-modal {
    width: 96%;
    padding: 1rem 0.75rem;
    max-height: 95vh;
    overflow-y: auto;
    border-radius: 16px;
  }

  .modal h2,
  .modal h3 {
    font-size: 1.3rem;
    margin: 0 0 0.75rem 0;
  }

  .modal button,
  .modal .btn {
    width: 100%;
  }

  .cta-actions,
  .hero-actions {
    flex-direction: column;
    gap: 0.75rem;
  }

  .cta-actions .button,
  .hero-actions .button {
    width: 100%;
    padding: 12px 16px;
    font-size: 0.95rem;
  }

  .card,
  .form-card,
  .panel,
  .stat-card {
    border-radius: 16px;
    padding: 1rem;
  }

  .card-header,
  .card-body {
    padding: 1rem;
  }

  .table-responsive {
    padding: 0.75rem;
    border-radius: 12px;
    width: 100%;
  }

  table {
    width: 100%;
    overflow-x: auto;
  }

  table th,
  table td {
    padding: 10px 6px;
    font-size: 0.8rem;
  }

  .footer {
    flex-direction: column;
    text-align: center;
    gap: 0.75rem;
    padding: 1.5rem 0.75rem;
  }

  .footer h3 {
    font-size: 1.1rem;
    margin: 0.5rem 0;
  }

  .footer p {
    font-size: 0.85rem;
    margin: 0.25rem 0;
  }

  /* Ensure headers are readable on small screens */
  h1 {
    font-size: 1.6rem;
    line-height: 1.2;
    margin: 0.5rem 0;
  }

  h2 {
    font-size: 1.4rem;
    line-height: 1.25;
    margin: 0.5rem 0;
  }

  h3 {
    font-size: 1.2rem;
    margin: 0.3rem 0;
  }

  /* Better spacing for paragraphs */
  p {
    line-height: 1.6;
    margin: 0.75rem 0;
  }

  /* Improve list readability */
  li {
    margin-bottom: 0.75rem;
  }
}

/* Ultra-wide tablets and iPad landscape (769px - 1024px) */
@media (min-width: 769px) and (max-width: 1024px) {
  body {
    overflow-x: hidden;
  }

  .dashboard-shell {
    padding: 1.5rem;
    max-width: 100%;
  }

  .dashboard-card-grid,
  .form-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }

  .section {
    padding: 2.5rem 1.5rem;
  }

  .section h2 {
    font-size: 2.2rem;
  }

  .gallery-grid,
  .profiles-grid {
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
  }

  .video-player {
    min-height: 320px;
    border-radius: 22px;
  }

  .video-player iframe {
    min-height: 320px;
  }

  .page-header {
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
  }

  .page-intro {
    text-align: right;
    flex: 1;
  }

  .modal {
    width: 85%;
    max-height: 92vh;
    padding: 1.5rem;
    border-radius: 20px;
  }

  .topbar,
  .navbar {
    gap: 1.2rem;
  }

  nav a {
    font-size: 0.95rem;
  }

  .hero {
    gap: 1.5rem;
  }

  .hero h1 {
    font-size: 2.8rem;
  }
}

/* Touch-friendly spacing for all devices */
@media (hover: none) and (pointer: coarse) {
  /* Mobile/tablet with touch */
  a,
  button,
  .btn,
  .button,
  .nav-link,
  input[type="submit"],
  input[type="button"] {
    min-height: 48px;
    padding: 14px 18px;
    margin: 4px;
  }

  select,
  textarea {
    min-height: 48px;
  }

  /* Remove hover effects on touch devices - use active instead */
  a:hover,
  button:hover,
  .btn:hover,
  .button:hover {
    text-decoration: none;
  }

  /* Add active/tap feedback for better UX */
  a:active,
  button:active,
  .btn:active,
  .button:active {
    opacity: 0.85;
    transform: scale(0.98);
  }

  /* Easier tap targets for form elements */
  input[type="checkbox"],
  input[type="radio"] {
    width: 24px;
    height: 24px;
    margin: 8px;
  }

  label[for] {
    cursor: pointer;
  }

  /* Better spacing for interactive lists */
  li a,
  li button {
    display: block;
    padding: 12px 0;
  }
}

/* Doctor Dashboard Mobile Improvements */
@media (max-width: 768px) {
  .dashboard-header {
    text-align: center;
    padding: 1rem 0;
  }

  .dashboard-header h1 {
    font-size: 1.8rem;
    margin: 0.5rem 0;
  }

  .dashboard-header p {
    font-size: 0.9rem;
    margin: 0.25rem 0;
  }

  .grid.grid-3 {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .stat-box {
    padding: 1.25rem;
    border-radius: 16px;
  }

  .stat-label {
    font-size: 0.85rem;
  }

  .stat-number {
    font-size: 2.2rem;
  }

  .dashboard-panel {
    margin-bottom: 1.5rem;
    border-radius: 20px;
  }

  .panel-header {
    padding: 1.25rem 1.5rem 0;
  }

  .panel-header h2 {
    font-size: 1.4rem;
    margin: 0 0 0.5rem 0;
  }

  .panel-subtitle {
    font-size: 0.9rem;
    margin: 0.5rem 0 1rem 0;
  }

  .panel-body {
    padding: 1rem 1.5rem 1.5rem;
  }

  .section-filters {
    flex-direction: column;
    gap: 1rem;
    align-items: stretch;
  }

  .section-filters label {
    font-weight: 600;
    margin-bottom: 0.5rem;
  }

  .filter-row {
    flex-direction: column;
    gap: 0.75rem;
    align-items: stretch;
  }

  .filter-row input[type="date"] {
    width: 100%;
    padding: 0.75rem;
    font-size: 16px;
    min-height: 44px;
  }

  .filter-row button {
    width: 100%;
    padding: 0.75rem;
    min-height: 44px;
  }

  .table-responsive {
    border-radius: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  table th,
  table td {
    padding: 0.75rem 0.5rem;
    font-size: 0.85rem;
    white-space: nowrap;
  }

  .btn {
    padding: 0.6rem 1rem;
    font-size: 0.85rem;
    min-height: 44px;
  }
}

@media (max-width: 480px) {
  .content {
    padding: 1rem 0.75rem 2rem;
  }

  .container {
    padding: 0;
    max-width: 100%;
  }

  .dashboard-header {
    text-align: center;
    padding: 0.75rem 0;
  }

  .dashboard-header h1 {
    font-size: 1.6rem;
    margin: 0.25rem 0;
  }

  .dashboard-header p {
    font-size: 0.85rem;
    margin: 0.25rem 0;
  }

  .grid.grid-3 {
    gap: 0.75rem;
  }

  .stat-box {
    padding: 1rem;
    border-radius: 14px;
  }

  .stat-label {
    font-size: 0.8rem;
  }

  .stat-number {
    font-size: 1.8rem;
  }

  .dashboard-panel {
    margin-bottom: 1rem;
    border-radius: 16px;
    box-shadow: 0 12px 32px rgba(71, 92, 175, 0.08);
  }

  .panel-header {
    padding: 1rem 1.25rem 0;
  }

  .panel-header h2 {
    font-size: 1.3rem;
    margin: 0 0 0.25rem 0;
  }

  .panel-subtitle {
    font-size: 0.85rem;
    margin: 0.25rem 0 0.75rem 0;
  }

  .panel-body {
    padding: 0.75rem 1.25rem 1.25rem;
  }

  .section-filters {
    gap: 0.75rem;
  }

  .section-filters label {
    font-size: 0.9rem;
  }

  .filter-row {
    gap: 0.5rem;
  }

  .filter-row input[type="date"] {
    padding: 0.6rem 0.75rem;
    font-size: 16px;
    min-height: 40px;
  }

  .filter-row button {
    padding: 0.6rem 0.75rem;
    font-size: 0.9rem;
    min-height: 40px;
  }

  .table-responsive {
    border-radius: 10px;
    margin: 0 -0.25rem;
  }

  table {
    min-width: 100%;
  }

  table th,
  table td {
    padding: 0.6rem 0.4rem;
    font-size: 0.8rem;
  }

  .btn {
    padding: 0.5rem 0.8rem;
    font-size: 0.8rem;
    min-height: 40px;
  }

  .alert {
    border-radius: 12px;
    padding: 0.75rem 1rem;
    font-size: 0.85rem;
  }
}

/* Additional mobile optimizations */
@media (max-width: 640px) {
  /* Prevent overflow in all directions */
  * {
    max-width: 100vw;
  }

  body,
  html {
    width: 100vw;
    overflow-x: hidden;
  }

  /* Ensure all containers fit properly */
  .container,
  .content,
  .form-container,
  .dashboard-shell,
  .section,
  .card {
    width: 100%;
    max-width: 100%;
    padding-left: max(0.75rem, env(safe-area-inset-left));
    padding-right: max(0.75rem, env(safe-area-inset-right));
  }

  /* Better spacing for form elements */
  .form-group input,
  .form-group select,
  .form-group textarea {
    width: 100%;
    box-sizing: border-box;
  }

  /* Prevent text overflow */
  h1, h2, h3, h4, h5, h6 {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  p, span, a {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Better button consistency */
  .button,
  .btn,
  button,
  input[type="submit"],
  input[type="button"] {
    width: 100%;
    box-sizing: border-box;
  }

  /* Fix modals on small screens */
  .modal,
  .shift-modal,
  .lightbox-overlay {
    padding: max(1rem, env(safe-area-inset-bottom));
  }

  /* Better table handling */
  .table-responsive {
    border-radius: 12px;
    margin: 0;
  }

  table {
    width: 100%;
    overflow-x: auto;
  }
}

/* Prevent common mobile issues */
@media screen and (max-width: 768px) {
  /* Disable font size adjustment on input focus */
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="date"],
  input[type="time"],
  textarea,
  select {
    font-size: 16px !important;
  }

  /* Prevent iOS zoom on input focus */
  textarea,
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="search"],
  input[type="date"],
  input[type="time"],
  button,
  select {
    font-size: 16px;
  }

  /* Better iOS support */
  body {
    -webkit-user-select: text;
    -webkit-touch-callout: default;
  }

  /* Improve safe area handling */
  body,
  .topbar,
  .navbar,
  .footer {
    padding-left: env(safe-area-inset-left);
    padding-right: env(safe-area-inset-right);
    padding-bottom: env(safe-area-inset-bottom);
  }
}

/* Improve specific element spacing on mobile */
@media (max-width: 768px) {
  /* Navigation links better spacing */
  nav a,
  .navbar-menu a,
  .topbar a {
    margin: 0.25rem 0.5rem;
    padding: 12px 14px;
    display: inline-block;
    min-height: 44px;
    border-radius: 12px;
  }

  /* Better card spacing */
  .card,
  .stat-card,
  .dashboard-card,
  .appointment-card,
  .gallery-card,
  .profile-card {
    margin-bottom: 1rem;
    border-radius: 16px;
  }

  /* Better form field spacing */
  .form-group {
    margin-bottom: 1.5rem;
  }

  .form-group label {
    margin-bottom: 0.5rem;
    font-weight: 600;
  }

  /* Better button groups */
  .button-group,
  .form-actions,
  .action-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
  }

  .button-group .btn,
  .button-group .button,
  .form-actions .btn,
  .form-actions .button {
    width: 100%;
  }

  /* Better filter controls */
  .filter-row,
  .filter-controls {
    flex-direction: column;
    gap: 0.75rem;
    width: 100%;
  }

  .filter-row input,
  .filter-row select,
  .filter-controls input,
  .filter-controls select {
    width: 100%;
  }

  /* Better section spacing */
  .section-inner,
  .section-header {
    padding: 0 0.75rem;
  }

  /* Better stat boxes */
  .stat-box,
  .stat-card {
    padding: 1.25rem;
  }

  .stat-number {
    font-size: 2rem;
  }

  /* Better video/media containers */
  .video-player,
  .media-container {
    border-radius: 16px;
    overflow: hidden;
  }

  /* Better carousel on mobile */
  .carousel-button {
    width: 2.2rem;
    height: 2.2rem;
    font-size: 1.1rem;
  }

  .slide-caption {
    font-size: 0.9rem;
    padding: 0.75rem 1rem;
  }
}
