    :root {
      --primary-color: #1a237e; /* Indigo */
      --secondary-color: #3f51b5; /* Indigo lighter */
      --accent-color: #00bcd4; /* Cyan */
      --warning-color: #ff9800; /* Orange */
      --success-color: #4caf50; /* Green */
      --light-bg: #f8f9fa; /* Light Gray */
      --dark-text: #333;
      --light-text: #fff;
      --gradient-primary: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
      --gradient-accent: linear-gradient(135deg, var(--accent-color) 0%, #00acc1 100%);
      --card-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
      --card-hover-shadow: 0 12px 32px rgba(0, 0, 0, 0.15);
      --border-radius-md: 15px;
      --border-radius-lg: 20px;
    }

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

    body {
      font-family: 'Sarabun', sans-serif;
      line-height: 1.7;
      color: var(--dark-text);
      background-color: #f4f7f6; /* Slightly off-white background */
      overflow-x: hidden;
    }

    /* Loading Overlay */
    .loading-overlay {
      position: fixed;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      background: var(--gradient-primary);
      display: flex;
      align-items: center;
      justify-content: center;
      z-index: 9999;
      transition: opacity 0.5s ease, visibility 0.5s ease;
    }

    .loading-overlay.hidden {
        opacity: 0;
        visibility: hidden;
    }

    .loading-spinner {
      width: 60px;
      height: 60px;
      border: 4px solid rgba(255, 255, 255, 0.3);
      border-top-color: var(--light-text);
      border-radius: 50%;
      animation: spin 1s linear infinite;
    }

    @keyframes spin {
      0% { transform: rotate(0deg); }
      100% { transform: rotate(360deg); }
    }
    
    /* Navbar */
    .navbar-custom {
        background-color: var(--light-text);
        box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        padding-top: 1rem;
        padding-bottom: 1rem;
    }
    .navbar-custom .navbar-brand {
        color: var(--primary-color);
        font-weight: 700;
        font-size: 1.5rem;
    }
    .navbar-custom .nav-link {
        color: var(--primary-color);
        font-weight: 500;
        margin: 0 0.5rem;
        transition: color 0.3s ease;
        white-space: nowrap;

    }
    .navbar-custom .nav-link:hover,
    .navbar-custom .nav-link.active {
        color: var(--accent-color);
    }

    /* Banner Section */
    .banner-section img {
        width: 100%;
        height: auto; /* Maintain aspect ratio */
        max-height: 350px; /* Optional: constrain max height */
        object-fit: cover; /* Or 'contain' depending on the image */
    }

    /* Hero Section */
    .hero-section {
      color: var(--light-text);
      text-align: center;
      position: relative;
      overflow: hidden;
      padding: 0; 
    }
    .carousel-item img {
        object-fit: cover;
        height: 60vh; 
        width: 100%;
    }
    .carousel-caption { 
        background-color: rgba(0,0,0,0.5);
        border-radius: var(--border-radius-md);
        padding: 1rem; /* Add some padding to caption */
    }


    .hero-section::before { 
      content: '';
      position: absolute;
      top: 0; left: 0; right: 0; bottom: 0;
      background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.07'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
      animation: subtleSlide 20s linear infinite;
      z-index: 0;
    }

    @keyframes subtleSlide {
      0% { background-position: 0 0; }
      100% { background-position: 120px 120px; }
    }

    .hero-content { 
      position: relative;
      z-index: 1;
    }

    .hero-title {
      font-size: clamp(1.5rem, 4vw, 2.5rem); /* Adjusted for caption */
      font-weight: 700;
      margin-bottom: 0.5rem; /* Adjusted for caption */
      text-shadow: 1px 1px 3px rgba(0,0,0,0.3);
    }

    .hero-subtitle {
      font-size: clamp(1rem, 2.5vw, 1.25rem); /* Adjusted for caption */
      font-weight: 400;
      margin-bottom: 0;
      opacity: 0.9;
    }
    
    /* Section Headers */
    .section-header {
      text-align: center;
      margin-bottom: 3.5rem;
    }
    .section-title {
      font-size: clamp(2rem, 4vw, 2.8rem);
      font-weight: 700;
      color: var(--primary-color);
      margin-bottom: 0.75rem;
      position: relative;
      display: inline-block;
    }
    .section-title::after {
      content: '';
      position: absolute;
      bottom: -12px;
      left: 50%;
      transform: translateX(-50%);
      width: 70px;
      height: 4px;
      background: var(--gradient-accent);
      border-radius: 2px;
    }
    .section-subtitle {
      color: #555;
      font-size: 1.1rem;
      max-width: 650px;
      margin: 1.5rem auto 0;
    }

    /* Vision & Profile Card */
    .vision-card {
      background: var(--gradient-primary);
      color: var(--light-text);
      border-radius: var(--border-radius-lg);
      padding: 2.5rem;
      text-align: center;
      box-shadow: var(--card-shadow);
      transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .vision-card:hover {
      transform: translateY(-8px);
      box-shadow: var(--card-hover-shadow);
    }
    .vision-card h2 {
        font-weight: 600;
        font-size: 1.8rem;
    }
     .vision-card h4 {
        font-weight: 500;
        font-size: 1.3rem;
        opacity: 0.95;
    }

    .profile-card {
      background: var(--light-text);
      border-radius: var(--border-radius-lg);
      padding: 2rem;
      text-align: center;
      box-shadow: var(--card-shadow);
      transition: transform 0.3s ease, box-shadow 0.3s ease;
      height: 100%;
    }
    .profile-card:hover {
      transform: translateY(-8px);
      box-shadow: var(--card-hover-shadow);
    }
    .profile-image {
      width: 180px; 
      height: 220px; 
      object-fit: cover;
      border-radius: var(--border-radius-md);
      border: 6px solid var(--light-text);
      box-shadow: 0 6px 20px rgba(0,0,0,0.15);
      margin-top: -40px; 
      position: relative;
      z-index: 1;
    }
     .profile-card h5 {
        color: var(--primary-color);
        font-weight: 600;
        margin-top: 1rem;
     }
     .profile-card p {
        color: var(--secondary-color);
        font-size: 0.95rem;
     }


    /* Mission Cards */
    .mission-section {
      background-color: var(--light-bg);
      padding: 4rem 0;
    }
    .mission-card {
      background: var(--light-text);
      border-radius: var(--border-radius-md);
      padding: 1.5rem 1.1rem;
      height: 100%;
      box-shadow: var(--card-shadow);
      transition: all 0.3s ease;
      display: flex;
      align-items: flex-start; 
    }
    .mission-card:hover {
      transform: translateY(-8px);
      box-shadow: var(--card-hover-shadow);
    }
    .mission-number {
      background: var(--gradient-accent);
      color: var(--light-text);
      min-width: 45px; 
      height: 45px;
      border-radius: 50%;
      display: flex;
      align-items: center;
      justify-content: center;
      font-weight: 700;
      font-size: 1.3rem;
      margin-right: 1rem;
      flex-shrink: 0; 
    }
    .mission-card h5 {
        font-weight: 500;
        font-size: 1.05rem; 
        color: var(--dark-text);
        line-height: 1.5;
    }

    /* Quick Access Cards */
    .quick-access-section {
        padding: 4rem 0;
    }
    .quick-access-card {
      background: var(--light-text);
      border-radius: var(--border-radius-md);
      padding: 1.5rem 1rem;
      text-align: center;
      box-shadow: var(--card-shadow);
      transition: all 0.3s ease;
      height: 100%;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: space-between; 
      text-decoration: none;
      color: var(--dark-text);
    }
    .quick-access-card:hover {
      transform: translateY(-8px) scale(1.03);
      box-shadow: var(--card-hover-shadow);
      background: var(--gradient-primary);
      color: var(--light-text);
    }
    .quick-access-icon-img { 
        width: 60px; 
        height: auto;
        margin-bottom: 1rem;
        transition: transform 0.3s ease;
    }
    .quick-access-card:hover .quick-access-icon-img {
        transform: scale(1.1);
    }
    .quick-access-card p {
        font-weight: 500;
        font-size: 0.9rem;
        line-height: 1.3;
        margin-top: auto; 
    }


    /* Statistics & Bed Status Section */
    .stats-bed-section {
        background-color: var(--light-bg);
        padding: 4rem 0;
    }

    .counter-card, .bed-status-card {
      background: var(--light-text);
      border-radius: var(--border-radius-lg);
      padding: 2rem;
      box-shadow: var(--card-shadow);
    }

    .counter-card h5, .bed-status-card h5 {
      color: var(--primary-color);
      font-weight: 600;
      margin-bottom: 1.5rem;
      text-align: center;
    }

    .count-display-container {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 0.3rem;
      flex-wrap: wrap;
      margin-bottom: 1rem;
    }

    .count-display-label {
      width: 100%;
      text-align: center;
      font-weight: bold;
      margin-bottom: 0.5rem;
    }

    .count-display {
      background: var(--dark-text);
      color: #ffd700;
      padding: 6px 10px;
      border-radius: 6px;
      font-weight: 700;
      font-size: 1.3rem;
      min-width: 30px;
      text-align: center;
    }

    
    .table-modern {
      border-radius: var(--border-radius-md);
      overflow: hidden;
      box-shadow: 0 4px 12px rgba(0,0,0,0.08);
      margin-bottom: 0; 
    }
    .table-modern thead th {
      background: var(--gradient-primary);
      color: var(--light-text);
      border: none;
      padding: 0.9rem;
      font-weight: 600;
      font-size: 0.9rem;
      text-align: center;
    }
    .table-modern tbody td {
      padding: 0.9rem;
      border: none;
      border-bottom: 1px solid #eee;
      font-size: 0.9rem;
      vertical-align: middle;
    }
    .table-modern tbody tr:last-child td {
        border-bottom: none;
    }
    .table-modern tbody tr:hover {
      background-color: #f1f5ff; 
    }
    .table-modern .ward-name {
        font-weight: 500;
    }
    .table-modern .text-bold {
        font-weight: 600;
    }
    .table-modern .text-center { text-align: center; }
    .table-modern .text-end { text-align: right; }


    /* News & Nurse Photos Section */
    .news-section, .nurse-photos-section {
        padding: 4rem 0;
    }
    .news-card-item { 
      background: var(--light-text);
      border-radius: var(--border-radius-md);
      overflow: hidden;
      box-shadow: var(--card-shadow);
      transition: all 0.3s ease;
      height: 100%;
      display: flex;
      flex-direction: column;
    }
    .news-card-item:hover {
      transform: translateY(-8px);
      box-shadow: var(--card-hover-shadow);
    }
    .news-image {
      width: 100%;
      height: 220px;
      object-fit: cover;
      transition: transform 0.3s ease;
    }
    .news-card-item:hover .news-image {
      transform: scale(1.05);
    }
    .news-content {
      padding: 1.5rem;
      flex-grow: 1; 
      display: flex;
      flex-direction: column;
    }
    .news-title {
      color: var(--primary-color);
      font-weight: 600;
      font-size: 1.15rem;
      margin-bottom: 0.75rem;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
      overflow: hidden;
      line-height: 1.4;
    }
    .news-description {
        font-size: 0.9rem;
        color: #555;
        display: -webkit-box;
        -webkit-line-clamp: 3; 
        -webkit-box-orient: vertical;
        overflow: hidden;
        margin-bottom: 1rem;
        flex-grow: 1;
    }
    .news-meta {
      color: #777;
      font-size: 0.85rem;
      display: flex;
      align-items: center;
      gap: 0.75rem; 
      margin-top: auto; 
    }
    .news-meta i {
        color: var(--accent-color);
    }

    /* Nurse Photos Section */
    .nurse-photo-card {
        border-radius: var(--border-radius-md);
        overflow: hidden;
        box-shadow: var(--card-shadow);
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }
    .nurse-photo-card img {
        width: 100%;
        height: 440px; 
        object-fit: cover;
        display: block;
    }
    .nurse-photo-card:hover {
        transform: translateY(-5px) scale(1.02);
        box-shadow: var(--card-hover-shadow);
    }
    
    /* Footer */
    .footer-custom {
        background-color: var(--dark-text);
        color: rgba(255,255,255,0.7);
        padding: 3rem 0;
        font-size: 0.9rem;
    }
    .footer-custom a {
        color: var(--accent-color);
        text-decoration: none;
        transition: color 0.3s ease;
    }
    .footer-custom a:hover {
        color: var(--light-text);
    }
    .footer-custom .footer-title {
        color: var(--light-text);
        font-weight: 600;
        margin-bottom: 1rem;
        font-size: 1.1rem;
    }
    .footer-custom ul {
        list-style: none;
        padding-left: 0;
    }
    .footer-custom ul li a {
        margin-bottom: 0.5rem;
        display: block;
    }
    .footer-social-icons a {
        color: rgba(255,255,255,0.7);
        font-size: 1.3rem;
        margin-right: 1rem;
        transition: color 0.3s ease;
    }
    .footer-social-icons a:hover {
        color: var(--accent-color);
    }


    /* Responsive Adjustments */
    @media (max-width: 991.98px) {
      .profile-image { margin-top: 0; }
      .mission-card h5 { font-size: 1rem; }
      .carousel-item img { height: 50vh; } 
    }
    @media (max-width: 767.98px) {
        .carousel-item img { height: 45vh; } 
        .vision-card, .profile-card { padding: 1.5rem; }
        .quick-access-card p { font-size: 0.8rem; }
        .news-title { font-size: 1.05rem; }
        .banner-section img { max-height: 250px; }
        .hero-title {font-size: clamp(1.2rem, 4vw, 1.8rem);}
        .hero-subtitle {font-size: clamp(0.8rem, 2.5vw, 1rem);}
        .carousel-caption {padding: 0.5rem;}
    }
    @media (max-width: 575.98px) {
        .carousel-item img { height: 40vh; }
        .banner-section img { max-height: 200px; }
    }

    /** NEW VISIT CARD */
    .visit-stats-card {
      background: #ffffff;
      border-radius: 16px;
      padding: 2rem;
      box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
      max-width: 500px;
      margin: auto;
      text-align: center;
      font-family: 'Sarabun', sans-serif;
    }

    .card-title {
      color: #2b2b2b;
      margin-bottom: 1.5rem;
      font-size: 1.6rem;
    }

    .stats-section {
      margin-bottom: 0.75rem;
    }

    .stats-label {
      font-size: 1.1rem;
      font-weight: 600;
      color: #555;
      margin-bottom: 0.5rem;
    }

    .stats-digits {
      display: flex;
      justify-content: center;
      gap: 8px;
    }

    .stats-digits .digit-box {
      background: #2b2b2b;
      color: #ffd700;
      font-size: 1.5rem;
      font-weight: bold;
      padding: 10px 14px;
      border-radius: 8px;
      min-width: 32px;
    }

    /** END NEW VISIT CARD */

    .simple-visitor-stats {
      color: #ffffff;
      font-size: 16px;
      line-height: 1.8;
      letter-spacing: 0.5px; /* เพิ่มความห่างตัวอักษร */

    }

    .visitor-number {
      margin-left: 10px;
      background-color: #f89c5e;
      color: #fff;
      padding: 2px 6px;
      border-radius: 4px;
      font-weight: bold;
      letter-spacing: 2.5px; /* เพิ่มความห่างเฉพาะตัวเลขให้ชัด */
    }