
  :root {
    --primary-color: #2c3e50;
    --secondary-color: #e67e22;
    --bg-color: #f4f6f8;
    --card-bg: #ffffff;
    --text-color: #333333;
    --border-color: #e0e0e0;
    --success-color: #27ae60;
    --danger-color: #e74c3c;
    --warning-color: #f1c40f;
  }

  body {
    font-family: 'Sarabun', sans-serif;
    background-color: var(--bg-color);
    margin: 0;
    padding: 0;
    color: var(--text-color);
  }

  .app-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 20px;
  }

  /* Header */
  .header {
    background: linear-gradient(135deg, var(--primary-color), #34495e);
    color: white;
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  }
  .header-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
  }
  .logo-area {
    display: flex;
    align-items: center;
    gap: 15px;
  }
  .logo-area i {
    font-size: 2.5rem;
    color: var(--secondary-color);
  }
  .logo-area h1 {
    margin: 0;
    font-size: 1.8rem;
    font-weight: 600;
  }

  /* Tabs */
  .tabs {
    display: flex;
    gap: 10px;
    background: rgba(255,255,255,0.1);
    padding: 5px;
    border-radius: 8px;
  }
  .tab {
    padding: 10px 20px;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
  }
  .tab:hover {
    background: rgba(255,255,255,0.2);
  }
  .tab.active {
    background: white;
    color: var(--primary-color);
  }

  .tab-pane {
    display: none;
    animation: fadeIn 0.4s ease;
  }
  .tab-pane.active {
    display: block;
  }

  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
  }

  /* Cards */
  .card {
    background: var(--card-bg);
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    margin-bottom: 20px;
    overflow: hidden;
  }
  .card-header {
    background: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
  }
  .card-header h2 {
    margin: 0;
    font-size: 1.2rem;
    color: var(--primary-color);
  }
  .card-body {
    padding: 20px;
  }

  .flex-between {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Forms */
  .form-row {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
  }
  .form-group {
    flex: 1;
    min-width: 200px;
    margin-bottom: 15px;
  }
  .form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555;
  }
  .form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-family: inherit;
    font-size: 1rem;
    box-sizing: border-box;
    transition: border-color 0.3s;
  }
  .form-control:focus {
    outline: none;
    border-color: var(--secondary-color);
  }

  /* Buttons */
  .btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    font-size: 1rem;
    transition: all 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 8px;
  }
  .btn-primary {
    background-color: var(--secondary-color);
    color: white;
  }
  .btn-primary:hover {
    background-color: #d68910;
  }
  .text-right {
    text-align: right;
  }
  .mt-3 { margin-top: 15px; }
  .mt-4 { margin-top: 20px; }
  .text-muted { color: #888; }

  /* Alerts */
  .alert {
    padding: 15px;
    border-radius: 6px;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
  }
  .alert.warning {
    background-color: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
  }

  /* Table */
  .table-responsive {
    overflow-x: auto;
  }
  .table {
    width: 100%;
    border-collapse: collapse;
  }
  .table th, .table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
  }
  .table th {
    background-color: #f8f9fa;
    font-weight: 600;
  }
  .text-center { text-align: center; }

  /* Radio Buttons for Status */
  .status-options {
    display: flex;
    gap: 15px;
  }
  .status-label {
    display: flex;
    align-items: center;
    gap: 5px;
    cursor: pointer;
  }
  .status-label input[type="radio"] {
    accent-color: var(--secondary-color);
    width: 18px;
    height: 18px;
  }

  /* Calendar */
  .calendar-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 15px;
  }
  .cal-day {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    background: #fdfdfd;
    transition: transform 0.2s;
    cursor: pointer;
    position: relative;
  }
  .cal-day:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  }
  .cal-date {
    font-size: 1.2rem;
    font-weight: bold;
    margin-bottom: 10px;
    color: var(--primary-color);
  }
  .cal-status {
    font-size: 0.9rem;
    padding: 5px;
    border-radius: 4px;
    margin-bottom: 10px;
  }
  .cal-status.normal { background: #e8f8f5; color: #1abc9c; }
  .cal-status.holiday { background: #fdedec; color: #e74c3c; }
  .cal-activity {
    font-size: 0.85rem;
    color: #555;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }

  /* Modal */
  .modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.5);
    align-items: center;
    justify-content: center;
  }
  .modal-content {
    width: 90%;
    max-width: 500px;
    margin: auto;
  }
  .close {
    font-size: 1.5rem;
    cursor: pointer;
  }

  /* Loading Overlay */
  .loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.7);
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }
  .spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid var(--secondary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
  }
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  /* Toast Notification */
  .toast {
    visibility: hidden;
    min-width: 250px;
    background-color: var(--success-color);
    color: #fff;
    text-align: center;
    border-radius: 4px;
    padding: 16px;
    position: fixed;
    z-index: 10000;
    left: 50%;
    bottom: 30px;
    transform: translateX(-50%);
    font-size: 16px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
  }
  .toast.show {
    visibility: visible;
    animation: fadein 0.5s, fadeout 0.5s 2.5s;
  }
  .toast.error { background-color: var(--danger-color); }
  @keyframes fadein {
    from {bottom: 0; opacity: 0;} 
    to {bottom: 30px; opacity: 1;}
  }
  @keyframes fadeout {
    from {bottom: 30px; opacity: 1;} 
    to {bottom: 0; opacity: 0;}
  }

  /* Mobile App UI / UX Improvements */
  @media (max-width: 768px) {
    body {
      font-size: 14px;
    }
    .app-container {
      padding: 10px;
    }
    .header {
      padding: 15px;
      border-radius: 8px;
    }
    .logo-area i {
      font-size: 1.8rem;
    }
    .logo-area h1 {
      font-size: 1.3rem;
    }
    .tabs {
      display: grid;
      grid-template-columns: repeat(3, 1fr);
      gap: 8px;
      background: transparent;
      padding: 0;
    }
    .tab {
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      background: rgba(255,255,255,0.15);
      border-radius: 10px;
      padding: 10px 5px;
      font-size: 0.75rem;
      white-space: normal;
      text-align: center;
      line-height: 1.2;
    }
    .tab i {
      font-size: 1.4rem;
      margin-bottom: 5px;
    }
    .tab span {
      display: inline-block;
      margin-top: 2px;
    }
    .tab.active {
      background: white;
      color: var(--primary-color);
      box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }
    .card {
      border-radius: 8px;
      margin-bottom: 15px;
      box-shadow: 0 1px 4px rgba(0,0,0,0.08);
    }
    .card-header {
      padding: 12px 15px;
    }
    .card-header h2 {
      font-size: 1.1rem;
    }
    .card-body {
      padding: 15px;
    }
    .form-group {
      margin-bottom: 10px;
    }
    .form-control {
      padding: 8px 10px;
      font-size: 0.95rem;
    }
    
    /* Table like Mobile App */
    .table-responsive {
      border-radius: 6px;
      border: 1px solid var(--border-color);
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      background: #fff;
    }
    .table {
      min-width: 500px; /* Force minimum width to prevent awkward wrapping */
    }
    .table th, .table td {
      padding: 10px 8px;
      font-size: 0.9rem;
      white-space: nowrap; /* Prevent ugly text wrapping in small columns */
    }
    
    /* Radio Buttons for Status Mobile */
    .status-options {
      gap: 8px;
      flex-wrap: nowrap;
    }
    .status-label {
      font-size: 0.85rem;
      padding: 4px 6px;
      border: 1px solid #ddd;
      border-radius: 20px;
      background: #fdfdfd;
      white-space: nowrap;
    }
    .status-label input[type="radio"] {
      width: 14px;
      height: 14px;
      margin: 0;
    }
    
    .btn {
      padding: 8px 15px;
      font-size: 0.9rem;
      width: 100%;
      justify-content: center;
    }
    
    /* Make buttons inline again if they are in small cells */
    .table .btn {
      width: auto;
      padding: 4px 8px;
      font-size: 0.8rem;
    }

    .form-row {
      flex-direction: column;
      gap: 10px;
    }
  }

