/* ===== ระบบบริหารจัดการยูริโกะ - PHP + MySQL Edition ===== */
@import url('https://fonts.googleapis.com/css2?family=Sarabun:wght@300;400;600;700&display=swap');

* {
  box-sizing: border-box;
}

body {
  padding: 20px;
  background-color: #f0f4f1;
  font-family: 'Sarabun', sans-serif;
  margin: 0;
  overflow-y: auto;
}

.container {
  max-width: 950px;
  margin: 0 auto;
  background: #ffffff;
  padding: 30px;
  border-radius: 20px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  border-top: 5px solid #a3b18a;
  overflow: visible;
}

h2 {
  color: #556b2f;
}

/* ===== Loading Overlay ===== */
.loading-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 9999;
}

.loading-spinner {
  text-align: center;
}

.loading-spinner .loading-icon {
  font-size: 48px;
  display: block;
  margin-bottom: 12px;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.15); opacity: 0.7; }
}

.loading-spinner p {
  font-size: 16px;
  color: #6c757d;
  font-weight: 600;
}

/* ===== User Bar ===== */
.user-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 12px 18px;
  border-radius: 12px;
  margin-bottom: 20px;
  border: 1px solid #dee2e6;
  flex-wrap: wrap;
  gap: 10px;
}

.user-info {
  display: flex;
  align-items: center;
  gap: 10px;
}

.user-avatar {
  font-size: 28px;
  background: #fff;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.08);
}

.user-name {
  display: block;
  font-weight: 700;
  font-size: 15px;
  color: #343a40;
}

.user-role {
  display: block;
  font-size: 12px;
  color: #6c757d;
  font-weight: 600;
}

.user-actions {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

/* ===== Buttons ===== */
.btn {
  display: inline-block;
  padding: 8px 16px;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-family: 'Sarabun', sans-serif;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  transition: all 0.2s;
}

.btn:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-primary {
  background-color: #89c2d9;
  border-color: #89c2d9;
  color: #fff;
}

.btn-primary:hover {
  background-color: #6a9ab0;
}

.btn-success {
  background-color: #a3b18a;
  border-color: #a3b18a;
  color: #fff;
}

.btn-success:hover {
  background-color: #7b8865;
}

.btn-info {
  background-color: #b08968;
  border-color: #b08968;
  color: #fff;
}

.btn-info:hover {
  background-color: #8c6d52;
}

.btn-secondary {
  background-color: #6c757d;
  color: #fff;
}

.btn-secondary:hover {
  background-color: #565e64;
}

.btn-dark {
  background-color: #343a40;
  color: #fff;
}

.btn-dark:hover {
  background-color: #23272b;
}

.btn-warning {
  background-color: #ffc107;
  color: #212529;
}

.btn-danger {
  background-color: #dc3545;
  color: #fff;
}

.btn-report-blue {
  background-color: #0d6efd;
  color: #fff;
}

.btn-report-blue:hover {
  background-color: #0b5ed7;
}

.btn-outline-primary {
  background: transparent;
  border: 1px solid #89c2d9;
  color: #89c2d9;
}

.btn-outline-primary:hover {
  background: #89c2d9;
  color: #fff;
}

.btn-outline-danger {
  background: transparent;
  border: 1px solid #dc3545;
  color: #dc3545;
}

.btn-outline-danger:hover {
  background: #dc3545;
  color: #fff;
}

.btn-outline-secondary {
  background: transparent;
  border: 1px solid #6c757d;
  color: #6c757d;
}

.btn-outline-secondary:hover {
  background: #6c757d;
  color: #fff;
}

.btn-sm {
  padding: 4px 10px;
  font-size: 12px;
}

.btn-lg {
  padding: 12px 24px;
  font-size: 16px;
}

.w-100 {
  width: 100%;
}

/* ===== Sticky Header Wrapper ===== */
.sticky-header {
  position: sticky;
  top: -1px;
  z-index: 100;
  background: #ffffff;
  padding-bottom: 12px;
  margin: -30px -30px 20px -30px;
  padding: 20px 30px 12px 30px;
  border-bottom: 1px solid #e9ecef;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border-radius: 20px 20px 0 0;
}

/* ===== Nav Buttons ===== */
.nav-buttons {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
  flex-wrap: wrap;
}

.nav-buttons .btn {
  flex: 1;
  min-width: 100px;
}

/* ===== Forms ===== */
.form-control {
  display: block;
  width: 100%;
  padding: 8px 12px;
  font-size: 14px;
  font-family: 'Sarabun', sans-serif;
  border: 1px solid #ced4da;
  border-radius: 6px;
  transition: border-color 0.15s;
}

.form-control:focus {
  outline: none;
  border-color: #89c2d9;
  box-shadow: 0 0 0 3px rgba(137, 194, 217, 0.25);
}

.form-control:disabled {
  background-color: #e9ecef;
  cursor: not-allowed;
}

select.form-control {
  appearance: auto;
}

label {
  display: block;
  margin-bottom: 4px;
  font-weight: 600;
  font-size: 14px;
  color: #495057;
}

/* ===== Grid ===== */
.row {
  display: flex;
  flex-wrap: wrap;
  margin: 0 -8px;
}

.col-2 { width: 16.66%; padding: 0 8px; }
.col-4 { width: 33.33%; padding: 0 8px; }
.col-5 { width: 41.66%; padding: 0 8px; }
.col-6 { width: 50%; padding: 0 8px; }
.col-12 { width: 100%; padding: 0 8px; }

/* ===== Sections ===== */
.hidden {
  display: none;
}

.mb-2 { margin-bottom: 8px; }
.mb-3 { margin-bottom: 16px; }
.mb-4 { margin-bottom: 24px; }
.mt-2 { margin-top: 8px; }
.mt-3 { margin-top: 16px; }
.mt-4 { margin-top: 24px; }
.py-2 { padding-top: 8px; padding-bottom: 8px; }
.p-2 { padding: 8px; }
.p-3 { padding: 16px; }

.text-center { text-align: center; }
.text-end { text-align: right; }
.text-muted { color: #6c757d; }
.text-danger { color: #dc3545; }
.text-success { color: #198754; }
.text-primary { color: #0d6efd; }
.text-warning { color: #ffc107; }
.fw-bold { font-weight: 700; }
.fs-4 { font-size: 1.5rem; }
.small { font-size: 0.875rem; }
.font-monospace { font-family: monospace; }

/* ===== Room Check Items ===== */
.room-check-item {
  background: #f8f9fa;
  padding: 10px 14px;
  border-radius: 8px;
  margin-bottom: 5px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background 0.15s;
}

.room-check-item:hover {
  background: #e9ecef;
}

.room-check-item input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.room-check-item label {
  margin: 0;
  cursor: pointer;
  font-weight: 400;
}

.room-check-item.disabled-room {
  opacity: 0.5;
}

.room-check-item.disabled-room label {
  text-decoration: line-through;
}

/* ===== Option Rows ===== */
.option-row {
  background: #fcfaf5;
  padding: 12px;
  border-radius: 12px;
  margin-bottom: 10px;
  border-left: 5px solid #a3b18a;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.option-row .option-date {
  min-width: 120px;
  font-weight: 600;
}

.option-row .input-group {
  display: flex;
  align-items: center;
  gap: 0;
  flex: 1;
  min-width: 140px;
}

.option-row .input-group .input-group-text {
  background: #e9ecef;
  border: 1px solid #ced4da;
  border-right: none;
  padding: 6px 10px;
  font-size: 13px;
  border-radius: 6px 0 0 6px;
  white-space: nowrap;
}

.option-row .input-group .form-control {
  border-radius: 0 6px 6px 0;
  padding: 6px 10px;
  font-size: 13px;
  width: 70px;
}

.badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
}

.badge-dark { background: #343a40; }
.badge-warning { background: #ffc107; color: #212529; }
.badge-success { background: #198754; }
.badge-danger  { background: #dc3545; }
.badge-teal    { background: #0d9488; color: #fff; }

/* ===== Alert ===== */
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.alert-primary {
  background: #cfe2ff;
  border: 1px solid #b6d4fe;
  color: #084298;
}

.alert-warning {
  background: #fff3cd;
  border: 1px solid #ffecb5;
  color: #664d03;
}

/* ===== Cards ===== */
.card-res {
  border: none;
  border-radius: 15px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
  padding: 16px;
  margin-bottom: 12px;
  background: #fff;
  border-left: 6px solid #89c2d9;
  transition: transform 0.15s;
}

.card-res:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.card-res.status-warning { border-left-color: #ffc107; }
.card-res.status-success { border-left-color: #198754; }
.card-res.status-danger  { border-left-color: #dc3545; }
.card-res.status-info    { border-left-color: #17a2b8; }

.card-res-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.card-res-details {
  font-size: 0.875rem;
  color: #6c757d;
  margin-bottom: 8px;
}

.card-res-options {
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 8px;
}

.card-res-footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 8px;
}

.card-res-footer .btn-group {
  display: flex;
  gap: 4px;
}

/* ===== Report Cards ===== */
.report-summary {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.report-card {
  flex: 1;
  min-width: 120px;
  padding: 12px;
  border-radius: 12px;
  text-align: center;
  font-weight: 700;
  background: #f8f9fa;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ===== Table ===== */
.table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}

.table th,
.table td {
  padding: 8px 12px;
  border: 1px solid #dee2e6;
  text-align: left;
}

.table thead th {
  background: #343a40;
  color: #fff;
  font-weight: 600;
}

.table tbody tr:nth-child(even) {
  background: #f8f9fa;
}

.table-responsive {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

/* ===== Input Group ===== */
.input-group {
  display: flex;
  gap: 0;
}

.input-group .form-control {
  border-radius: 6px 0 0 6px;
  flex: 1;
}

.input-group .btn {
  border-radius: 0 6px 6px 0;
}

.input-group .input-group-text {
  background: #e9ecef;
  border: 1px solid #ced4da;
  padding: 8px 12px;
  font-size: 14px;
  display: flex;
  align-items: center;
}

/* ===== Settings - Redesigned ===== */
.settings-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #f8f9fa, #e9ecef);
  padding: 18px 20px;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid #dee2e6;
}

.settings-header-icon {
  font-size: 36px;
  background: #fff;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.settings-section-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.settings-section-title {
  font-weight: 700;
  font-size: 16px;
  color: #556b2f;
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid #a3b18a;
}

.settings-room-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.settings-room-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8faf6;
  padding: 12px 16px;
  border-radius: 12px;
  border: 1px solid #e8ede4;
  transition: all 0.2s;
}

.settings-room-item:hover {
  background: #f0f4ec;
  border-color: #a3b18a;
  box-shadow: 0 2px 8px rgba(163, 177, 138, 0.15);
}

.settings-room-icon {
  font-size: 24px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.settings-room-info {
  flex: 1;
  min-width: 0;
}

.settings-room-name {
  font-weight: 700;
  font-size: 14px;
  color: #343a40;
}

.settings-room-type {
  font-size: 11px;
  color: #6c757d;
  margin-top: 2px;
}

.settings-room-price-wrapper {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.settings-room-price-wrapper .form-control {
  width: 120px;
  text-align: right;
  font-weight: 600;
  font-size: 15px;
}

.settings-price-unit {
  font-size: 12px;
  color: #6c757d;
  font-weight: 600;
  white-space: nowrap;
}

.settings-extras-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.settings-extra-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: #f8faf6;
  padding: 16px;
  border-radius: 12px;
  border: 1px solid #e8ede4;
  transition: all 0.2s;
}

.settings-extra-item:hover {
  background: #f0f4ec;
  border-color: #a3b18a;
  box-shadow: 0 2px 8px rgba(163, 177, 138, 0.15);
}

.settings-extra-icon {
  font-size: 28px;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
  flex-shrink: 0;
}

.settings-extra-info {
  flex: 1;
}

.settings-extra-info label {
  font-size: 13px;
  font-weight: 700;
  color: #343a40;
  margin-bottom: 6px;
}

.settings-price-input {
  display: flex;
  align-items: center;
  gap: 6px;
}

.settings-price-input .form-control {
  width: 100px;
  text-align: right;
  font-weight: 600;
  font-size: 15px;
}

.btn-save-settings {
  background: linear-gradient(135deg, #dc3545, #c82333);
  color: #fff;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 700;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: 'Sarabun', sans-serif;
  letter-spacing: 0.5px;
}

.btn-save-settings:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(220, 53, 69, 0.3);
}

/* Legacy settings support */
.settings-input-group {
  display: flex;
  align-items: center;
  margin-bottom: 8px;
}

.settings-input-group .input-group-text {
  min-width: 200px;
  background: #e9ecef;
  border: 1px solid #ced4da;
  border-right: none;
  padding: 8px 12px;
  border-radius: 6px 0 0 6px;
  font-weight: 600;
}

.settings-input-group .form-control {
  border-radius: 0 6px 6px 0;
}

/* ===== Modal ===== */
.modal-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1040;
  justify-content: center;
  align-items: center;
}

.modal-overlay.show {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  width: 90%;
  max-width: 700px;
  max-height: 85vh;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
  animation: modalSlideIn 0.3s ease;
}

@keyframes modalSlideIn {
  from {
    opacity: 0;
    transform: translateY(-30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid #dee2e6;
}

.modal-header h5 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
}

.modal-close {
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #6c757d;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: #343a40;
}

.modal-body {
  padding: 20px;
  max-height: 60vh;
  overflow-y: auto;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding: 16px 20px;
  border-top: 1px solid #dee2e6;
}

/* ===== Detail Section (Booking Details Modal) ===== */
.detail-section {
  margin-bottom: 16px;
}

.detail-section h6 {
  margin: 0 0 10px 0;
  color: #556b2f;
  border-bottom: 2px solid #a3b18a;
  padding-bottom: 6px;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 16px;
  font-size: 14px;
}

.detail-grid div {
  padding: 4px 0;
}

/* ===== Room Monitor Grid ===== */
.room-monitor-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.room-card {
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  border: 2px solid transparent;
  display: flex;
  flex-direction: column;
  user-select: none;
}

.room-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.room-card.vacant {
  background: linear-gradient(135deg, #f0fff0, #e8f5e9);
  border-color: #a3b18a;
}

.room-card.occupied {
  background: linear-gradient(135deg, #fff5f5, #ffebee);
  border-color: #dc3545;
}

.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.room-card-name {
  font-weight: 700;
  font-size: 15px;
  color: #343a40;
}

.room-card-price {
  font-size: 14px;
  font-weight: 700;
  color: #556b2f;
}

.room-card-status {
  text-align: center;
  padding: 8px;
  border-radius: 8px;
  font-weight: 700;
  font-size: 14px;
  margin-bottom: 10px;
}

.room-card-status.vacant-status {
  background: rgba(163, 177, 138, 0.2);
  color: #556b2f;
}

.room-card-status.occupied-status {
  background: rgba(220, 53, 69, 0.1);
  color: #dc3545;
}

.room-card-info {
  font-size: 13px;
  line-height: 1.7;
  flex: 1;
}

.room-card-info div {
  margin-bottom: 3px;
}

/* ===== Room Select Cards (หน้าจองห้อง) ===== */
.room-select-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
}

.room-select-card {
  border-radius: 14px;
  padding: 16px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  border: 2px solid transparent;
  background: linear-gradient(135deg, #f0fff0, #e8f5e9);
  border-color: #a3b18a;
  cursor: pointer;
  user-select: none;
}

.room-select-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.room-select-card.room-select-selected {
  background: linear-gradient(135deg, #d4edda, #c3e6cb);
  border-color: #198754;
  box-shadow: 0 4px 16px rgba(25, 135, 84, 0.25);
}

.room-select-card.room-select-selected::after {
  content: '✅ เลือกแล้ว';
  display: block;
  text-align: center;
  margin-top: 8px;
  font-size: 12px;
  font-weight: 700;
  color: #198754;
}

.room-select-card.room-select-disabled {
  background: linear-gradient(135deg, #fff5f5, #ffebee);
  border-color: #dc3545;
  opacity: 0.6;
  cursor: not-allowed;
}

.room-select-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}

.room-select-card-name {
  font-weight: 700;
  font-size: 15px;
  color: #343a40;
}

.room-select-card-price {
  font-size: 14px;
  font-weight: 700;
  color: #556b2f;
  margin-bottom: 6px;
}

.room-select-card-dates {
  font-size: 12px;
  color: #6c757d;
}

/* ===== Room Monitor Card Buttons ===== */
.room-card-buttons {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-top: 10px;
}

/* ===== Checkin List ===== */
.checkin-list .card-res {
  margin-bottom: 10px;
}

/* ===== Expense Form ===== */
.expense-form-header {
  display: flex;
  align-items: center;
  gap: 14px;
  background: linear-gradient(135deg, #fff5f5, #ffe8e8);
  padding: 18px 20px;
  border-radius: 14px;
  margin-bottom: 20px;
  border: 1px solid #fed7d7;
}

.expense-form-header-icon {
  font-size: 36px;
  background: #fff;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.expense-form-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  padding: 24px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.expense-form-card textarea.form-control {
  resize: vertical;
  min-height: 80px;
}

/* ===== Summary Overview Card ===== */
.summary-overview-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 16px;
  padding: 24px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
}

.summary-overview-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 2px solid #a3b18a;
}

.summary-overview-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.summary-overview-item {
  text-align: center;
  padding: 20px 16px;
  border-radius: 14px;
  transition: transform 0.2s;
}

.summary-overview-item:hover {
  transform: translateY(-3px);
}

.summary-overview-item.income-item {
  background: linear-gradient(135deg, #f0fff0, #e8f5e9);
  border: 1px solid #c3e6cb;
}

.summary-overview-item.expense-item {
  background: linear-gradient(135deg, #fff5f5, #ffebee);
  border: 1px solid #f5c6cb;
}

.summary-overview-item.profit-item {
  background: linear-gradient(135deg, #f0f4ff, #e8eaf6);
  border: 1px solid #c5cae9;
}

.summary-overview-label {
  font-size: 14px;
  font-weight: 600;
  color: #495057;
  margin-bottom: 8px;
}

.summary-overview-value {
  font-size: 1.3rem;
  font-weight: 700;
}

/* ===== Summary Section Card ===== */
.summary-section-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
}

.summary-section-card details summary {
  padding: 8px 0;
}

.summary-section-card details[open] summary {
  margin-bottom: 12px;
}

/* ===== Staff Cards (Mobile-friendly) ===== */
.staff-table-desktop {
  display: block;
}

.staff-cards-mobile {
  display: none;
}

.staff-card {
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border-left: 5px solid #a3b18a;
  transition: transform 0.15s, box-shadow 0.15s;
}

.staff-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
}

.staff-card-inactive {
  opacity: 0.55;
  border-left-color: #dc3545;
}

.staff-card-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.staff-card-avatar {
  font-size: 28px;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8f9fa;
  border-radius: 50%;
  flex-shrink: 0;
}

.staff-card-info {
  flex: 1;
  min-width: 0;
}

.staff-card-name {
  font-weight: 700;
  font-size: 16px;
  color: #343a40;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.staff-card-username {
  font-size: 13px;
  color: #6c757d;
}

.staff-card-badge {
  flex-shrink: 0;
}

.staff-card-body {
  margin-bottom: 12px;
}

.staff-card-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 14px;
}

.staff-card-label {
  font-weight: 600;
  color: #6c757d;
}

.staff-card-actions {
  display: flex;
  gap: 8px;
  padding-top: 10px;
  border-top: 1px solid #f0f0f0;
}

.staff-card-actions .btn {
  flex: 1;
}

/* ===== Responsive ===== */
@media (max-width: 768px) {
  .container {
    padding: 16px;
    border-radius: 12px;
  }

  .nav-buttons {
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 6px;
  }

  .nav-buttons .btn {
    min-width: auto;
    flex: 0 0 auto;
    white-space: nowrap;
    font-size: 12px;
    padding: 6px 10px;
  }

  .row {
    flex-direction: column;
  }

  .col-2, .col-4, .col-5, .col-6 {
    width: 100%;
  }

  .option-row {
    flex-direction: column;
    align-items: flex-start;
  }

  .card-res-footer {
    flex-direction: column;
  }

  .report-summary {
    flex-direction: column;
  }

  .user-bar {
    flex-direction: column;
    align-items: flex-start;
  }

  .user-actions {
    width: 100%;
  }

  .user-actions .btn {
    flex: 1;
  }

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

  .room-monitor-grid {
    grid-template-columns: 1fr 1fr;
  }

  .sticky-header {
    margin: -16px -16px 16px -16px;
    padding: 12px 16px 8px 16px;
    border-radius: 12px 12px 0 0;
  }

  .room-select-grid {
    grid-template-columns: 1fr;
  }

  .table-responsive {
    margin: 0 -16px;
    padding: 0 16px;
  }

  /* ตาราง modal บนมือถือ — ลด padding และ font */
  .modal-body .table th,
  .modal-body .table td {
    padding: 6px 6px;
    font-size: 12px;
    vertical-align: middle;
  }

  .modal-body .table-sm th,
  .modal-body .table-sm td {
    padding: 4px 5px;
    font-size: 11px;
  }

  /* modal เต็มจอบนมือถือ */
  .modal-content {
    width: 97%;
    max-height: 92vh;
  }

  .modal-body {
    padding: 12px;
    max-height: 70vh;
  }

  .settings-extras-grid {
    grid-template-columns: 1fr;
  }

  .settings-room-item {
    flex-wrap: wrap;
  }

  .settings-room-price-wrapper {
    width: 100%;
    margin-top: 4px;
  }

  .settings-room-price-wrapper .form-control {
    flex: 1;
    width: auto;
  }

  .summary-overview-grid {
    grid-template-columns: 1fr;
  }

  .expense-form-header {
    flex-direction: column;
    text-align: center;
  }

  /* Staff: show cards, hide table on mobile */
  .staff-table-desktop {
    display: none;
  }

  .staff-cards-mobile {
    display: block;
  }
}

/* ===== All Bookings — Responsive =====  */
.all-bookings-mobile  { display: none; }
.all-bookings-desktop { display: block; }

.booking-mobile-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,.08);
  margin-bottom: 12px;
  overflow: hidden;
}

.booking-mobile-card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: #f8f9fa;
  border-bottom: 1px solid #e9ecef;
}

.booking-mobile-id {
  font-family: monospace;
  font-size: 13px;
  font-weight: 700;
  color: #343a40;
  word-break: break-all;
}

.booking-mobile-card-body {
  padding: 10px 14px;
}

.booking-mobile-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  padding: 4px 0;
  border-bottom: 1px solid #f0f0f0;
  font-size: 13px;
}

.booking-mobile-row:last-child { border-bottom: none; }

.booking-mobile-label {
  color: #6c757d;
  white-space: nowrap;
  flex-shrink: 0;
  font-size: 12px;
}

.booking-mobile-card-footer {
  padding: 10px 14px;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
}

@media (max-width: 768px) {
  .all-bookings-mobile  { display: block; }
  .all-bookings-desktop { display: none; }
}
