/* =====================================================
   ELITE PG — DESIGN SYSTEM
   Colors: Navy #1B2A4A | Gold #C9A227 | Professional
   ===================================================== */

/* ---------- CSS VARIABLES ---------- */
:root {
  --navy:        #1B2A4A;
  --navy-light:  #243759;
  --navy-dark:   #111D33;
  --gold:        #C9A227;
  --gold-light:  #DDB842;
  --gold-pale:   #F5ECC8;
  --white:       #FFFFFF;
  --bg:          #F4F5F7;
  --surface:     #FFFFFF;
  --border:      #E2E5EC;
  --text-primary: #1B2A4A;
  --text-secondary: #5A6880;
  --text-muted:  #8A98AE;
  --available:   #2E7D52;
  --available-bg:#EBF5F0;
  --occupied:    #B03A3A;
  --occupied-bg: #FAECEC;
  --partial:     #8A6B00;
  --partial-bg:  #FDF4D5;
  --radius-sm:   6px;
  --radius:      10px;
  --radius-lg:   16px;
  --shadow-sm:   0 1px 3px rgba(27,42,74,0.08);
  --shadow:      0 4px 12px rgba(27,42,74,0.10);
  --shadow-lg:   0 8px 30px rgba(27,42,74,0.14);
  --transition:  0.2s ease;
  --font:        'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---------- RESET & BASE ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  font-size: 14px;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { cursor: pointer; font-family: var(--font); }
input, select, textarea { font-family: var(--font); }

/* ---------- CONTAINER ---------- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ---------- BUTTONS ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 20px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  border: none;
  transition: background var(--transition), transform var(--transition), box-shadow var(--transition);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn-primary {
  background: var(--gold);
  color: var(--navy-dark);
}
.btn-primary:hover { background: var(--gold-light); box-shadow: 0 2px 8px rgba(201,162,39,0.35); }
.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text-primary);
}
.btn-outline:hover { border-color: var(--gold); color: var(--gold); }
.btn-ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1.5px solid var(--border);
}
.btn-ghost:hover { background: var(--bg); }
.btn-danger {
  background: var(--occupied);
  color: white;
}
.btn-danger:hover { background: #8e2e2e; }
.btn-warning {
  background: var(--partial-bg);
  color: var(--partial);
  border: 1px solid #e0c860;
}
.btn-warning:hover { background: #f0e3a0; }
.btn-block { width: 100%; justify-content: center; padding: 12px; }
.btn-sm { padding: 6px 14px; font-size: 12.5px; }
.btn-spinner {
  width: 14px; height: 14px;
  border: 2px solid rgba(27,42,74,0.3);
  border-top-color: var(--navy);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* ---------- FORM ELEMENTS ---------- */
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-label { font-size: 12.5px; font-weight: 600; color: var(--text-secondary); text-transform: uppercase; letter-spacing: 0.04em; }
.form-input {
  padding: 10px 13px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--white);
  transition: border-color var(--transition), box-shadow var(--transition);
  outline: none;
}
.form-input:focus { border-color: var(--gold); box-shadow: 0 0 0 3px rgba(201,162,39,0.12); }
.form-input::placeholder { color: var(--text-muted); }
.form-textarea { resize: vertical; min-height: 70px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-error { color: var(--occupied); font-size: 13px; padding: 8px 12px; background: var(--occupied-bg); border-radius: var(--radius-sm); }
.select-input { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%235A6880' 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 10px center; padding-right: 32px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; user-select: none; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--gold); }

/* ---------- PUBLIC HEADER ---------- */
.header {
  background: var(--navy);
  border-bottom: 3px solid var(--gold);
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 68px;
}
.header-logo { display: flex; align-items: center; }
.logo-img { height: 50px; width: auto; object-fit: contain; }
.header-nav { display: flex; align-items: center; gap: 16px; }
.nav-badge {
  background: rgba(201,162,39,0.15);
  border: 1px solid rgba(201,162,39,0.4);
  color: var(--gold-light);
  padding: 5px 14px;
  border-radius: 50px;
  font-size: 12.5px;
  font-weight: 500;
}
.header-nav .btn-outline {
  border-color: rgba(255,255,255,0.25);
  color: rgba(255,255,255,0.85);
}
.header-nav .btn-outline:hover { border-color: var(--gold); color: var(--gold); }

/* ---------- HERO STRIP ---------- */
.hero-strip {
  background: linear-gradient(135deg, var(--navy-dark) 0%, var(--navy) 60%, #2a3f6e 100%);
  padding: 40px 0 36px;
  border-bottom: 1px solid rgba(201,162,39,0.2);
}
.hero-title {
  font-size: 28px;
  font-weight: 700;
  color: var(--white);
  letter-spacing: -0.3px;
}
.hero-subtitle { color: rgba(255,255,255,0.6); font-size: 14px; margin-top: 4px; }
.stats-row { display: flex; gap: 20px; margin-top: 28px; flex-wrap: wrap; }
.stat-card {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius);
  padding: 18px 28px;
  display: flex; flex-direction: column; align-items: center; gap: 4px;
  min-width: 110px;
}
.stat-number { font-size: 30px; font-weight: 700; color: var(--white); }
.stat-number.available { color: #5DD39E; }
.stat-number.occupied { color: #F08080; }
.stat-label { font-size: 11.5px; color: rgba(255,255,255,0.55); text-transform: uppercase; letter-spacing: 0.06em; }

/* ---------- MAIN CONTENT ---------- */
.main-content { padding: 40px 0 60px; }

/* ---------- FLOOR SECTION ---------- */
.floor-section {
  margin-bottom: 40px;
}
.floor-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}
.floor-badge {
  background: var(--navy);
  color: var(--gold);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 5px 14px;
  border-radius: 50px;
  border: 1px solid rgba(201,162,39,0.3);
}
.floor-label {
  font-size: 18px;
  font-weight: 700;
  color: var(--navy);
}
.floor-divider { flex: 1; height: 1px; background: var(--border); }
.floor-occupancy-text { font-size: 12.5px; color: var(--text-secondary); font-weight: 500; }

.floor-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.floor-side {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.floor-side-label {
  font-size: 11px;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 2px;
  padding-left: 2px;
}

/* ---------- ROOM CARD ---------- */
.room-card {
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 16px 18px;
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--transition), border-color var(--transition), transform var(--transition);
}
.room-card:hover { box-shadow: var(--shadow); transform: translateY(-1px); }
.room-card.fully-occupied { border-left: 4px solid var(--occupied); }
.room-card.fully-available { border-left: 4px solid var(--available); }
.room-card.partially-occupied { border-left: 4px solid var(--gold); }
.room-card.non-room { background: var(--bg); border-style: dashed; border-color: var(--border); }

.room-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 12px;
}
.room-card-name { font-size: 14px; font-weight: 600; color: var(--navy); }
.room-card-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.room-tag {
  font-size: 10.5px;
  padding: 2px 8px;
  border-radius: 50px;
  font-weight: 500;
}
.tag-balcony { background: #E8F4EA; color: #2A6E3B; }
.tag-type { background: var(--bg); color: var(--text-secondary); }
.tag-floor-info { background: var(--gold-pale); color: #8A6B00; }

.occupancy-bar {
  height: 5px;
  background: var(--bg);
  border-radius: 50px;
  overflow: hidden;
  margin-bottom: 14px;
}
.occupancy-fill {
  height: 100%;
  border-radius: 50px;
  transition: width 0.4s ease;
}
.fill-0    { background: var(--available); }
.fill-full { background: var(--occupied); }
.fill-part { background: var(--gold); }

/* ---------- BED SLOTS ---------- */
.beds-row {
  display: flex;
  flex-direction: column;
  gap: 7px;
}
.bed-slot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: background var(--transition), border-color var(--transition);
  cursor: default;
}
.bed-slot.occupied-bed {
  background: var(--occupied-bg);
  border-color: rgba(176,58,58,0.2);
}
.bed-slot.available-bed {
  background: var(--available-bg);
  border-color: rgba(46,125,82,0.2);
}

.bed-icon {
  width: 28px; height: 28px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.bed-icon.occ { background: rgba(176,58,58,0.12); }
.bed-icon.avail { background: rgba(46,125,82,0.12); }

.bed-info { flex: 1; min-width: 0; }
.bed-label { font-size: 11px; color: var(--text-muted); font-weight: 500; }
.bed-name { font-size: 13.5px; font-weight: 600; color: var(--text-primary); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bed-name.empty-name { color: var(--available); font-weight: 400; font-style: italic; font-size: 12.5px; }

.bed-status-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-occ { background: var(--occupied); }
.dot-avail { background: var(--available); }

/* Non-room placeholders */
.non-room-inner {
  display: flex; align-items: center; gap: 10px;
  padding: 6px 0;
  color: var(--text-muted);
  font-size: 13px;
}
.non-room-icon { font-size: 20px; }

/* ---------- LOADING STATE ---------- */
.loading-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 16px; padding: 80px 20px; color: var(--text-muted);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid var(--border);
  border-top-color: var(--gold);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- AUTH PAGE ---------- */
.auth-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--navy-dark) 0%, #1f3357 50%, var(--navy) 100%);
  padding: 24px;
}
.auth-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 40px;
  width: 100%; max-width: 420px;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
}
.auth-logo-wrap { display: flex; justify-content: center; margin-bottom: 28px; }
.auth-logo { height: 72px; width: auto; }
.auth-title { text-align: center; font-size: 22px; font-weight: 700; color: var(--navy); }
.auth-subtitle { text-align: center; color: var(--text-secondary); font-size: 13.5px; margin: 6px 0 28px; }
.auth-form { display: flex; flex-direction: column; gap: 18px; }
.password-wrap { position: relative; }
.password-wrap .form-input { padding-right: 44px; }
.pw-toggle {
  position: absolute; right: 13px; top: 50%; transform: translateY(-50%);
  background: none; border: none; color: var(--text-muted);
  display: flex; align-items: center;
  transition: color var(--transition);
}
.pw-toggle:hover { color: var(--navy); }
.back-link { display: block; text-align: center; margin-top: 24px; font-size: 13px; color: var(--text-muted); }
.back-link:hover { color: var(--gold); }

/* ---------- MODALS ---------- */
.modal-overlay {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(17,29,51,0.55);
  display: flex; align-items: center; justify-content: center;
  padding: 16px;
  backdrop-filter: blur(3px);
  animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  background: var(--white);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 600px;
  max-height: 90vh;
  display: flex; flex-direction: column;
  box-shadow: 0 20px 60px rgba(17,29,51,0.25);
  animation: slideUp 0.2s ease;
}
@keyframes slideUp { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.modal-sm { max-width: 440px; }
.modal-xs { max-width: 360px; }
.modal-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}
.modal-title { font-size: 17px; font-weight: 700; color: var(--navy); }
.modal-close {
  background: none; border: none; font-size: 22px; color: var(--text-muted);
  line-height: 1; padding: 2px 6px; border-radius: 4px;
  transition: background var(--transition), color var(--transition);
}
.modal-close:hover { background: var(--bg); color: var(--text-primary); }
.modal-body { padding: 24px; overflow-y: auto; display: flex; flex-direction: column; gap: 16px; }
.modal-footer {
  display: flex; justify-content: flex-end; gap: 10px;
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  background: var(--bg);
  border-radius: 0 0 var(--radius-lg) var(--radius-lg);
}

/* ---------- DETAIL MODAL ---------- */
.detail-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
}
.detail-item {}
.detail-item-label { font-size: 11px; font-weight: 600; color: var(--text-muted); text-transform: uppercase; letter-spacing: 0.06em; }
.detail-item-value { font-size: 14px; font-weight: 500; color: var(--text-primary); margin-top: 2px; }
.detail-full { grid-column: 1 / -1; }
.detail-avatar {
  width: 52px; height: 52px; border-radius: 50%;
  background: var(--navy); color: var(--gold);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700; margin-bottom: 16px;
}

/* ---------- TOAST ---------- */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 2000; display: flex; flex-direction: column; gap: 8px; }
.toast {
  background: var(--navy);
  color: var(--white);
  padding: 12px 18px;
  border-radius: var(--radius);
  font-size: 13.5px;
  box-shadow: var(--shadow-lg);
  display: flex; align-items: center; gap: 10px;
  min-width: 220px; max-width: 360px;
  animation: slideLeft 0.2s ease;
  border-left: 4px solid var(--gold);
}
.toast.toast-success { border-left-color: var(--available); }
.toast.toast-error { border-left-color: var(--occupied); }
@keyframes slideLeft { from { transform: translateX(30px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.toast-fade-out { animation: fadeOut 0.3s ease forwards; }
@keyframes fadeOut { to { opacity: 0; transform: translateX(20px); } }

/* ---------- BED TOOLTIP ---------- */
.bed-tooltip {
  position: fixed;
  background: var(--navy);
  color: white;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 12.5px;
  pointer-events: none;
  z-index: 500;
  box-shadow: var(--shadow);
  border: 1px solid rgba(201,162,39,0.3);
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
  .floor-grid { grid-template-columns: 1fr; }
  .form-row { grid-template-columns: 1fr; }
  .stats-row { gap: 12px; }
  .stat-card { padding: 14px 20px; }
  .hero-strip { padding: 28px 0 24px; }
  .auth-card { padding: 28px 20px; }
}
