/* ==== BASE ==== */
* { margin:0; padding:0; box-sizing:border-box; }
body { font-family: 'Segoe UI', sans-serif; background: #0f0f0f; color: #e0e0e0; overflow-x: hidden; }
h1, h2, h3 { font-family: 'Playfair Display', serif; }

/* ==== COLORS ==== */
:root {
  --gold: #d4af37;
  --gold-dark: #b8972e;
  --dark: #1a1a1a;
  --gray: #444;
  --success: #4ade80;
  --danger: #ef4444;
  --warning: #fbbf24;
  --info: #3b82f6;
  --amber: #d97706;
  --red-dark: #991b1b;
}

/* ==== LOGIN ==== */
.screen { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.login-box {
  background: var(--dark); padding: 2.5rem; border-radius: 16px; width: 100%; max-width: 400px;
  box-shadow: 0 10px 30px rgba(0,0,0,.5); border: 1px solid #333;
}
.login-box h2 { color: var(--gold); text-align: center; margin-bottom: 1.5rem; }
.input-group { margin-bottom: 1rem; }
.input-group label { display: block; margin-bottom: .5rem; color: #ccc; font-weight: 600; }
.input-group input {
  width: 100%; padding: .9rem; border: 1px solid var(--gray); border-radius: 8px;
  background: #111; color: #fff; font-size: 1rem;
}
.btn-login {
  width: 100%; padding: 1rem; background: var(--gold); color: #000; border: none;
  border-radius: 50px; font-weight: 700; margin-top: 1rem; transition: .3s;
  position: relative;
}
.btn-login:hover { background: var(--gold-dark); }
.btn-text, .btn-loader { display: inline-block; }
.btn-loader { display: none; }

/* ==== DASHBOARD ==== */
#dashboard { display: flex; min-height: 100vh; position: relative; }
.mobile-menu-btn {
  position: fixed; top: 1rem; right: 1rem; z-index: 1001; background: var(--gold);
  color: #000; border: none; padding: .8rem; border-radius: 50%; font-size: 1.3rem;
  display: none; box-shadow: 0 4px 15px rgba(212,175,55,.3);
}

/* ==== SIDEBAR ==== */
.sidebar {
  width: 280px; background: var(--dark); border-right: 1px solid #333; padding: 1.5rem 0;
  position: fixed; top: 0; left: 0; height: 100%; z-index: 1000; transition: transform .3s ease;
  overflow-y: auto;
}
.sidebar-header {
  padding: 0 1.5rem 1rem; border-bottom: 1px solid #333; display: flex; justify-content: space-between;
  align-items: center;
}
.sidebar-header h3 { color: var(--gold); }
.close-sidebar { display: none; }
.sidebar-nav { margin-top: 2rem; }
.nav-item {
  display: flex; align-items: center; gap: .8rem; padding: 1rem 1.5rem; color: #ccc;
  text-decoration: none; transition: .3s; font-weight: 500;
}
.nav-item:hover, .nav-item.active { background: #222; color: var(--gold); }
.nav-item i { width: 20px; }

/* ==== MAIN CONTENT ==== */
.main-content {
  flex: 1; margin-left: 280px; padding: 1.5rem 1rem; width: 100%;
  overflow-x: hidden;
}
.content-section { margin-top: 0; }
.section-header {
  display: flex; justify-content: space-between; align-items: center; margin-bottom: 1rem;
  flex-wrap: wrap; gap: .5rem;
}
.section-header h2 { color: var(--gold); font-size: 1.8rem; margin: 0; }
.filters {
  display: flex; gap: .8rem; margin-bottom: 1.2rem; flex-wrap: wrap; align-items: center;
}
.date-picker {
  position: relative; display: flex; align-items: center;
}
.date-picker input {
  padding: .7rem 2.5rem .7rem .9rem; width: 150px; font-size: .9rem;
  border: 1px solid var(--gray); border-radius: 8px; background: #111; color: #fff;
}
.date-picker i {
  position: absolute; right: .8rem; color: var(--gold); pointer-events: none;
}
.filters select {
  padding: .7rem 1rem; border: 1px solid var(--gray); border-radius: 8px;
  background: #111; color: #fff; font-size: .9rem; min-width: 140px;
}
.btn-block {
  background: var(--gold); color: #000; padding: .7rem 1.2rem; border: none;
  border-radius: 50px; font-weight: 600; font-size: .9rem;
}
.btn-block:hover { background: var(--gold-dark); }

/* ==== TABLE ==== */
.table-wrapper {
  background: #111; border-radius: 12px; overflow: hidden; border: 1px solid var(--gray);
  margin-top: 0; width: 100%;
}
.table-scroll {
  overflow-x: auto; -webkit-overflow-scrolling: touch; width: 100%;
  padding: 0 1rem;
}
.table-scroll::-webkit-scrollbar { height: 8px; }
.table-scroll::-webkit-scrollbar-track { background: #222; border-radius: 4px; }
.table-scroll::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 4px; }

table {
  width: 100%; border-collapse: collapse; min-width: 900px; table-layout: auto;
}
th {
  background: var(--dark); color: var(--gold); padding: .9rem .7rem; text-align: left;
  font-weight: 600; font-size: .95rem; white-space: nowrap; position: sticky; top: 0; z-index: 10;
}
td {
  padding: .9rem .7rem; border-bottom: 1px solid #333; font-size: .9rem;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 150px;
}
tr:hover { background: #222; }

/* ==== STATUS BADGES ==== */
.status-pending { color: #94a3b8; }
.status-confirmed { color: var(--success); font-weight: 600; }
.status-completed { color: var(--warning); font-weight: 600; }
.status-cancelled { color: var(--danger); font-weight: 600; }

/* ==== ACTION BUTTONS ==== */
.action-btn {
  padding: .38rem .65rem;
  margin: 0 .12rem;
  border: none;
  border-radius: 50px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s ease;
  white-space: nowrap;
  min-width: 60px;
  display: inline-block;
  text-align: center;
}
.action-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 2px 6px rgba(0,0,0,.3);
}

/* Button Colors */
.view-btn     { background: var(--info); color: #fff; }
.confirm-btn  { background: var(--success); color: #000; }
.complete-btn { background: var(--amber); color: #fff; }
.cancel-btn   { background: var(--danger); color: #fff; }
.delete-btn   { background: var(--red-dark); color: #fff; }

/* Action cell: prevent overflow */
td.action-cell {
  white-space: normal !important;
  max-width: 220px;
  padding: .7rem .5rem !important;
}
td.action-cell .action-btn {
  display: block;
  width: 100%;
  margin: .18rem 0;
  font-size: .76rem;
}

/* ==== MOBILE RESPONSIVE ==== */
@media (max-width: 900px) {
  .mobile-menu-btn { display: block; }
  .sidebar {
    transform: translateX(-100%); width: 260px; left: 0;
    border-left: none; border-right: 1px solid #333;
  }
  .sidebar.open { transform: translateX(0); }
  .close-sidebar { display: block; }
  .main-content {
    margin-left: 0 !important;
    padding: 1rem;
    width: 100%;
  }
  .filters {
    flex-direction: column; align-items: stretch; gap: .5rem;
  }
  .date-picker input, .filters select { width: 100%; }
  .table-wrapper {
    margin: 1rem -1rem 0;
    border-radius: 0;
    border-left: none;
    border-right: none;
  }
  .table-scroll { padding: 0 1rem; margin: 0; }
  table { min-width: 800px; }
  th, td { padding: .6rem .4rem; font-size: .82rem; }
  th { font-size: .85rem; }
  td { max-width: 110px; }

  /* Mobile: Stack action buttons */
  td.action-cell {
    padding: .5rem .3rem !important;
    white-space: normal;
  }
  .action-btn {
    display: block;
    width: 100%;
    margin: .2rem 0;
    font-size: .78rem;
    padding: .4rem .5rem;
  }
}

@media (min-width: 901px) {
  .mobile-menu-btn { display: none; }
  .sidebar { transform: translateX(0); }
  .main-content { margin-left: 280px; }
  td { max-width: 180px; }

  /* Desktop: Inline buttons */
  td.action-cell .action-btn {
    display: inline-block;
    width: auto;
    margin: 0 .15rem;
  }
}

/* ==== ANNOUNCEMENTS ==== */
.preview-box {
  background: #111;
  border: 1px solid var(--gray);
  border-radius: 8px;
  padding: 1rem;
  margin-top: 1rem;
  font-size: .95rem;
}
.preview-title {
  color: var(--gold);
  font-weight: 600;
  margin-bottom: .3rem;
}
.type-badge {
  font-size: .7rem;
  padding: .25rem .5rem;
  border-radius: 50px;
  font-weight: 600;
}
.type-promotion { background: #166534; color: #86efac; }
.type-unavailable { background: #7f1d1d; color: #fca5a5; }
.type-price-update { background: #7c2d12; color: #fdba74; }
.type-info { background: #1e3a8a; color: #93c5fd; }

.announcement-card {
  background: #111;
  border: 1px solid var(--gray);
  border-radius: 12px;
  padding: 1rem;
  margin-bottom: .8rem;
}
.announcement-card h4 {
  color: var(--gold);
  margin: 0 0 .4rem;
  font-size: 1.1rem;
}
.announcement-card p {
  margin: .4rem 0;
  color: #ccc;
  line-height: 1.6;
}
.announcement-card .date {
  font-size: .8rem;
  color: #888;
}

/* ==== MODAL BASE ==== */
.modal {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,.7);
  align-items: center;
  justify-content: center;
  z-index: 2000;
  padding: 1rem;
}
.modal[style*="flex"] {
  display: flex !important;
}
.modal-content {
  background: var(--dark);
  padding: 2rem;
  border-radius: 12px;
  width: 100%;
  max-width: 500px;
  border: 1px solid #333;
  box-shadow: 0 10px 30px rgba(0,0,0,.5);
}
.modal-content h3 { color: var(--gold); margin-bottom: .8rem; }
.modal-actions { 
  display: flex; gap: .8rem; margin-top: 1.5rem; justify-content: flex-end; 
}
.btn-primary, .btn-secondary {
  padding: .7rem 1.2rem;
  border: none;
  border-radius: 50px;
  font-weight: 600;
  cursor: pointer;
  transition: .2s;
}
.btn-primary {
  background: var(--gold);
  color: #000;
}
.btn-primary:hover { background: var(--gold-dark); }
.btn-secondary {
  background: #444;
  color: #ccc;
}
.btn-secondary:hover { background: #555; }

#changePassBtn {
  margin-top: 1.5rem;
  width: 100%;
}

.modal .input-group { margin-bottom: 1rem; }
.modal .input-group label { display: block; margin-bottom: .4rem; color: #ccc; }
.modal .input-group input,
.modal .input-group textarea,
.modal .input-group select {
  width: 100%;
  padding: .8rem;
  background: #111;
  border: 1px solid var(--gray);
  border-radius: 8px;
  color: #fff;
}

#resetEmail { width: 100%; }

/* ==== CLICK-TO-CALL PHONE ==== */
.phone-link {
  color: var(--gold) !important;
  text-decoration: none;
  font-weight: 600;
  transition: color .2s;
}
.phone-link:hover {
  color: #fff !important;
  text-decoration: underline;
}
.modal-phone {
  display: inline;
}
.modal-phone .value {
  color: var(--gold);
  font-weight: 600;
}

/* ==== BOOKING CARDS (HIDDEN) ==== */
.booking-card { display: none !important; }

/* ==== DETAILS MODAL ==== */
#detailsModal .modal-content {
  max-width: 520px;
}
#detailsContent {
  line-height: 1.8;
  font-size: .95rem;
}
#detailsContent .label {
  font-weight: 600;
  color: var(--gold);
  display: inline-block;
  width: 120px;
  vertical-align: top;
}
#detailsContent .value {
  color: #fff;
  display: inline-block;
  width: calc(100% - 130px);
  word-wrap: break-word;
}

/* ==== FINAL FIX: ENSURE ACTION CELL IS WIDE ENOUGH ==== */
th:last-child, td:last-child {
  min-width: 200px;
  max-width: none;
}

/* ==== STATUS: UNCONFIRMED ==== */
.status-unconfirmed {
  color: #fbbf24;
  font-weight: 600;
  background: rgba(251, 191, 36, 0.1);
  padding: 2px 6px;
  border-radius: 4px;
}

/* View Button */
.view-btn { background: var(--info); color: #fff; }

/* Announcement Details Modal */
#announceDetailsModal .modal-content {
  max-width: 560px;
}
#announceDetailsBody {
  line-height: 1.8;
  font-size: 0.95rem;
}
#announceDetailsBody p {
  margin: 0.8rem 0;
}