/* ============================================================
   style.css — Dormitory Database & Payment Management System
   ============================================================ */

/* ─── CSS VARIABLES ─────────────────────────────────────────── */
:root {
  --primary:       #3A7AFE;
  --primary-dark:  #2563EB;
  --primary-light: #EBF2FF;
  --accent:        #6C63FF;
  --accent-light:  #EEEEFF;
  --secondary:     #F4F6FB;
  --text:          #333333;
  --text-light:    #666666;
  --text-muted:    #999999;
  --white:         #FFFFFF;
  --border:        #E2E8F0;
  --success:       #10B981;
  --success-light: #D1FAE5;
  --warning:       #F59E0B;
  --warning-light: #FEF3C7;
  --danger:        #EF4444;
  --danger-light:  #FEE2E2;
  --info:          #3B82F6;
  --info-light:    #DBEAFE;

  --sidebar-w:     260px;
  --topbar-h:      68px;

  --shadow-sm:  0 1px 4px rgba(0,0,0,.07);
  --shadow-md:  0 4px 16px rgba(0,0,0,.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,.13);
  --shadow-xl:  0 16px 48px rgba(0,0,0,.16);

  --radius-xs:  6px;
  --radius-sm:  10px;
  --radius-md:  14px;
  --radius-lg:  20px;
  --radius-xl:  28px;
  --radius-full: 9999px;

  --transition: all .25s ease;
  --transition-slow: all .4s ease;
}

/* ─── RESET & BASE ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--secondary);
  min-height: 100vh;
  line-height: 1.6;
}

a { text-decoration: none; color: inherit; }
ul { list-style: none; }
img { max-width: 100%; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ─── SCROLLBAR ──────────────────────────────────────────────── */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--secondary); }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: var(--radius-full); }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

/* ─── TYPOGRAPHY ────────────────────────────────────────────── */
h1, h2, h3, h4, h5 { font-weight: 700; line-height: 1.3; }
h1 { font-size: clamp(1.6rem, 3vw, 2.4rem); }
h2 { font-size: clamp(1.3rem, 2.5vw, 1.9rem); }
h3 { font-size: clamp(1.1rem, 2vw, 1.4rem); }
h4 { font-size: 1.05rem; }
h5 { font-size: .9rem; }
p  { color: var(--text-light); }

/* ─── UTILITY ───────────────────────────────────────────────── */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.mt-1 { margin-top: .5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: .5rem; }
.mb-2 { margin-bottom: 1rem; }
.flex { display: flex; }
.items-center { align-items: center; }
.gap-1 { gap: .5rem; }
.gap-2 { gap: 1rem; }
.w-full { width: 100%; }

/* ─── BADGES ────────────────────────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .22rem .7rem;
  border-radius: var(--radius-full);
  font-size: .76rem;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
}
.badge-success  { background: var(--success-light); color: #065f46; }
.badge-warning  { background: var(--warning-light); color: #92400e; }
.badge-danger   { background: var(--danger-light);  color: #991b1b; }
.badge-info     { background: var(--info-light);    color: #1e40af; }
.badge-primary  { background: var(--primary-light); color: #1d4ed8; }
.badge-default  { background: var(--border);        color: var(--text-light); }

/* ─── BUTTONS ───────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  padding: .65rem 1.4rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 600;
  transition: var(--transition);
  white-space: nowrap;
}
.btn-primary   { background: var(--primary);  color: #fff; }
.btn-primary:hover  { background: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(58,122,254,.4); }
.btn-accent    { background: var(--accent);   color: #fff; }
.btn-accent:hover   { background: #5b52e0; transform: translateY(-1px); box-shadow: 0 4px 12px rgba(108,99,255,.4); }
.btn-success   { background: var(--success);  color: #fff; }
.btn-success:hover  { background: #059669; }
.btn-danger    { background: var(--danger);   color: #fff; }
.btn-danger:hover   { background: #dc2626; }
.btn-outline   { background: transparent; border: 2px solid var(--primary); color: var(--primary); }
.btn-outline:hover  { background: var(--primary-light); }
.btn-ghost     { background: var(--secondary); color: var(--text-light); }
.btn-ghost:hover    { background: var(--border); color: var(--text); }
.btn-sm  { padding: .4rem .9rem; font-size: .8rem; }
.btn-lg  { padding: .85rem 2rem; font-size: 1rem; }
.btn-icon{ padding: .6rem; width: 38px; height: 38px; border-radius: var(--radius-xs); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none !important; }

/* ─── FORM ELEMENTS ─────────────────────────────────────────── */
.form-group    { margin-bottom: 1.1rem; }
.form-label    { display: block; font-size: .85rem; font-weight: 600; color: var(--text); margin-bottom: .4rem; }
.form-control  {
  width: 100%;
  padding: .65rem 1rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: .9rem;
  color: var(--text);
  background: var(--white);
  transition: var(--transition);
  outline: none;
}
.form-control:focus   { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(58,122,254,.12); }
.form-control::placeholder { color: var(--text-muted); }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }

/* ─── CARDS ─────────────────────────────────────────────────── */
.card {
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  padding: 1.5rem;
  transition: var(--transition);
  border: 1px solid rgba(226,232,240,.7);
}
.card:hover { box-shadow: var(--shadow-md); }
.card-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.2rem; }
.card-title  { font-size: 1.05rem; font-weight: 700; color: var(--text); }
.card-subtitle { font-size: .82rem; color: var(--text-muted); margin-top: .15rem; }

/* ─── STAT CARDS ────────────────────────────────────────────── */
.stat-cards { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; margin-bottom: 1.8rem; }
.stat-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.3rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.1rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226,232,240,.7);
  transition: var(--transition);
  animation: fadeInUp .5s ease both;
}
.stat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.stat-icon {
  width: 52px; height: 52px;
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.3rem;
  flex-shrink: 0;
}
.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.purple { background: var(--accent-light);  color: var(--accent); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.orange { background: var(--warning-light); color: var(--warning); }
.stat-icon.red    { background: var(--danger-light);  color: var(--danger); }
.stat-info { flex: 1; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--text); line-height: 1; }
.stat-label { font-size: .78rem; color: var(--text-muted); margin-top: .25rem; text-transform: uppercase; letter-spacing: .04em; font-weight: 600; }

/* ─── SECTION TITLES ────────────────────────────────────────── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.4rem; flex-wrap: wrap; gap: .8rem; }
.section-title  { font-size: 1.3rem; font-weight: 700; color: var(--text); }
.section-sub    { font-size: .85rem; color: var(--text-muted); margin-top: .15rem; }

/* ─── TABLES ────────────────────────────────────────────────── */
.table-wrapper { overflow-x: auto; border-radius: var(--radius-md); }
.data-table {
  width: 100%;
  border-collapse: collapse;
  font-size: .88rem;
}
.data-table thead th {
  background: var(--secondary);
  padding: .9rem 1rem;
  text-align: left;
  font-size: .78rem;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
  white-space: nowrap;
  border-bottom: 2px solid var(--border);
}
.data-table tbody tr {
  border-bottom: 1px solid rgba(226,232,240,.6);
  transition: var(--transition);
}
.data-table tbody tr:hover { background: rgba(58,122,254,.03); }
.data-table tbody td { padding: .85rem 1rem; color: var(--text); vertical-align: middle; }
.data-table tbody tr:last-child { border-bottom: none; }

/* ─── AVATARS ───────────────────────────────────────────────── */
.avatar {
  width: 36px; height: 36px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: .78rem; font-weight: 700;
  flex-shrink: 0;
}
.avatar-sm { width: 28px; height: 28px; font-size: .68rem; }
.avatar-lg { width: 52px; height: 52px; font-size: 1rem; }
.avatar-xl { width: 72px; height: 72px; font-size: 1.4rem; }
.avatar-group { display: flex; }
.avatar-group .avatar { margin-left: -8px; border: 2px solid var(--white); }
.avatar-group .avatar:first-child { margin-left: 0; }

/* ─── ACTIONS DROPDOWN ──────────────────────────────────────── */
.actions-cell { position: relative; }
.actions-btn  { background: var(--secondary); border: 1px solid var(--border); border-radius: var(--radius-xs); padding: .35rem .7rem; font-size: .8rem; font-weight: 600; color: var(--text-light); transition: var(--transition); display: inline-flex; align-items: center; gap: .3rem; }
.actions-btn:hover { background: var(--border); }
.actions-menu {
  position: absolute; right: 0; top: calc(100% + 4px);
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  min-width: 160px;
  z-index: 100;
  overflow: hidden;
  animation: dropIn .15s ease;
}
.actions-menu a, .actions-menu button {
  display: flex; align-items: center; gap: .6rem;
  width: 100%; padding: .7rem 1rem;
  font-size: .85rem; color: var(--text);
  background: none; border: none; text-align: left;
  cursor: pointer; transition: var(--transition);
}
.actions-menu a:hover, .actions-menu button:hover { background: var(--secondary); color: var(--primary); }
.actions-menu .danger:hover { color: var(--danger); background: var(--danger-light); }
.actions-menu hr { border: none; border-top: 1px solid var(--border); margin: .25rem 0; }

/* ─── MODALS ────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(15,23,42,.45);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex; align-items: center; justify-content: center;
  padding: 1rem;
  animation: fadeIn .2s ease;
}
.modal-overlay.hidden { display: none !important; }
.modal-box {
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
  width: 100%; max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  animation: slideUp .25s ease;
}
.modal-box.modal-lg { max-width: 640px; }
.modal-header {
  padding: 1.4rem 1.8rem 1rem;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title   { font-size: 1.1rem; font-weight: 700; }
.modal-close   { width: 32px; height: 32px; border-radius: var(--radius-xs); background: var(--secondary); color: var(--text-light); font-size: 1.1rem; display: flex; align-items: center; justify-content: center; transition: var(--transition); flex-shrink: 0; }
.modal-close:hover { background: var(--danger-light); color: var(--danger); }
.modal-body    { padding: 1.5rem 1.8rem; }
.modal-footer  { padding: 1rem 1.8rem 1.5rem; display: flex; gap: .8rem; justify-content: flex-end; }

/* ─── TOASTS ─────────────────────────────────────────────────── */
.toast-container { position: fixed; bottom: 1.5rem; right: 1.5rem; z-index: 9999; display: flex; flex-direction: column; gap: .6rem; }
.toast {
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  padding: .9rem 1.2rem;
  display: flex; align-items: flex-start; gap: .8rem;
  min-width: 280px; max-width: 360px;
  animation: slideInRight .3s ease;
  border-left: 4px solid var(--primary);
}
.toast.toast-success { border-color: var(--success); }
.toast.toast-warning { border-color: var(--warning); }
.toast.toast-error   { border-color: var(--danger); }
.toast-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: .05rem; }
.toast-msg  { font-size: .87rem; color: var(--text); }
.toast-title{ font-weight: 700; font-size: .9rem; }

/* ─── FILTER BAR ─────────────────────────────────────────────── */
.filter-bar {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.2rem 1.5rem;
  margin-bottom: 1.3rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid rgba(226,232,240,.7);
}
.filter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-bottom: 1rem; }
.filter-actions { display: flex; gap: .7rem; }

/* ─── RECEIPT CARD ───────────────────────────────────────────── */
.receipt-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.4rem;
  border: 1px solid rgba(226,232,240,.8);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  animation: fadeInUp .4s ease both;
}
.receipt-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.receipt-header { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 1rem; padding-bottom: .8rem; border-bottom: 1px dashed var(--border); }
.receipt-id     { font-size: .8rem; color: var(--text-muted); font-weight: 600; }
.receipt-amount { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.receipt-row    { display: flex; justify-content: space-between; font-size: .85rem; margin-bottom: .4rem; }
.receipt-row span:first-child { color: var(--text-muted); }
.receipt-row span:last-child  { font-weight: 600; color: var(--text); }

/* ─── ROOM GRID CARDS ────────────────────────────────────────── */
.room-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.2rem; }
.room-card {
  background: var(--white);
  border-radius: var(--radius-md);
  padding: 1.3rem;
  border: 1px solid rgba(226,232,240,.8);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  cursor: pointer;
  animation: fadeInUp .4s ease both;
}
.room-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); border-color: var(--primary); }
.room-card-num   { font-size: 1.4rem; font-weight: 800; color: var(--text); }
.room-card-type  { font-size: .78rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: .8rem; }
.room-card-row   { display: flex; justify-content: space-between; font-size: .82rem; margin-bottom: .35rem; }
.room-card-row span:first-child { color: var(--text-muted); }
.room-card-row span:last-child  { font-weight: 700; }
.room-card-avatars { margin-top: .9rem; }
.room-card-bar   { height: 6px; background: var(--border); border-radius: var(--radius-full); margin: .8rem 0 .5rem; overflow: hidden; }
.room-card-fill  { height: 100%; background: var(--primary); border-radius: var(--radius-full); transition: var(--transition-slow); }
.room-card.full .room-card-fill   { background: var(--danger); }
.room-card.almost .room-card-fill { background: var(--warning); }

/* ─── PAYMENT NOTICE ─────────────────────────────────────────── */
.payment-notice {
  padding: .9rem 1.1rem;
  border-radius: var(--radius-sm);
  font-size: .88rem;
  margin-top: .8rem;
  display: flex; align-items: flex-start; gap: .6rem;
  animation: fadeIn .3s ease;
}
.payment-notice.info     { background: var(--info-light);    border-left: 3px solid var(--info);    color: #1e3a8a; }
.payment-notice.warning  { background: var(--warning-light); border-left: 3px solid var(--warning); color: #78350f; }

/* ─── GENERATED CREDS CARD ───────────────────────────────────── */
.creds-card {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: var(--radius-md);
  padding: 1.5rem;
  margin-top: 1rem;
  animation: fadeInUp .4s ease;
}
.creds-card h4    { font-size: .85rem; opacity: .8; text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; }
.creds-field      { background: rgba(255,255,255,.15); border-radius: var(--radius-xs); padding: .6rem .9rem; margin-bottom: .6rem; }
.creds-field-label{ font-size: .72rem; opacity: .8; text-transform: uppercase; letter-spacing: .05em; }
.creds-field-value{ font-size: 1rem; font-weight: 700; letter-spacing: .08em; font-family: monospace; }

/* ─── PROGRESS BAR ───────────────────────────────────────────── */
.progress-bar { height: 8px; background: var(--border); border-radius: var(--radius-full); overflow: hidden; }
.progress-fill { height: 100%; background: linear-gradient(90deg, var(--primary), var(--accent)); border-radius: var(--radius-full); transition: width .6s ease; }

/* ─── EMPTY STATE ────────────────────────────────────────────── */
.empty-state { text-align: center; padding: 3rem 1rem; }
.empty-state i    { font-size: 2.5rem; color: var(--border); margin-bottom: 1rem; display: block; }
.empty-state h4   { color: var(--text-light); margin-bottom: .5rem; }
.empty-state p    { font-size: .85rem; color: var(--text-muted); }

/* ─── DIVIDER ────────────────────────────────────────────────── */
.divider { border: none; border-top: 1px solid var(--border); margin: 1.2rem 0; }

/* ──────────────────────────────────────────────────────────────
   LOGIN PAGE
   ──────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  overflow: hidden;
}

/* Hero Panel */
.login-hero {
  background: linear-gradient(135deg, #1a3a6e 0%, var(--primary) 50%, var(--accent) 100%);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.login-hero::before {
  content: '';
  position: absolute; inset: 0;
  background: 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.04'%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");
}
.login-hero-badge {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.15);
  border: 1px solid rgba(255,255,255,.25);
  border-radius: var(--radius-full);
  padding: .4rem 1rem;
  font-size: .8rem; font-weight: 600;
  margin-bottom: 2rem; width: fit-content;
}
.login-hero h1 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); margin-bottom: 1.2rem; line-height: 1.25; }
.login-hero p  { font-size: .98rem; opacity: .85; max-width: 420px; line-height: 1.7; margin-bottom: 2rem; }
.login-cta {
  display: inline-flex; align-items: center; gap: .6rem;
  background: #fff;
  color: var(--primary);
  border-radius: var(--radius-sm);
  padding: .8rem 1.8rem;
  font-weight: 700; font-size: .95rem;
  transition: var(--transition);
  width: fit-content;
}
.login-cta:hover { transform: translateY(-2px); box-shadow: 0 8px 24px rgba(0,0,0,.2); }
.login-features { display: flex; flex-direction: column; gap: .7rem; margin-top: 2.5rem; }
.login-feature  { display: flex; align-items: center; gap: .7rem; font-size: .88rem; opacity: .9; }
.login-feature i{ font-size: .9rem; opacity: .8; }

/* Form Panel */
.login-form-panel {
  background: var(--white);
  display: flex; align-items: center; justify-content: center;
  padding: 2.5rem;
  overflow-y: auto;
}
.login-form-box { width: 100%; max-width: 420px; }
.login-logo     { display: flex; align-items: center; gap: .8rem; margin-bottom: 2.5rem; }
.login-logo-icon{
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 1.2rem;
}
.login-logo span{ font-size: 1rem; font-weight: 700; color: var(--text); }
.login-form-title{ font-size: 1.6rem; margin-bottom: .4rem; }
.login-form-sub  { font-size: .88rem; color: var(--text-muted); margin-bottom: 2rem; }
.role-tabs { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1.5rem; }
.role-tab {
  padding: .75rem;
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600; font-size: .9rem;
  color: var(--text-muted);
}
.role-tab i { display: block; font-size: 1.2rem; margin-bottom: .3rem; }
.role-tab.active { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.role-tab:hover:not(.active) { border-color: var(--primary); color: var(--primary); }
.login-divider { text-align: center; margin: 1.2rem 0; color: var(--text-muted); font-size: .8rem; position: relative; }
.login-divider::before, .login-divider::after { content: ''; position: absolute; top: 50%; width: 42%; height: 1px; background: var(--border); }
.login-divider::before { left: 0; }
.login-divider::after  { right: 0; }
.demo-hint { background: var(--secondary); border-radius: var(--radius-sm); padding: .8rem 1rem; margin-top: .8rem; }
.demo-hint p { font-size: .78rem; color: var(--text-muted); margin-bottom: .3rem; }
.demo-hint code { background: var(--white); border: 1px solid var(--border); border-radius: 4px; padding: .1rem .4rem; font-size: .75rem; color: var(--primary); font-family: monospace; }

/* ──────────────────────────────────────────────────────────────
   DASHBOARD LAYOUT (Shared by tenant & admin)
   ──────────────────────────────────────────────────────────── */
.dashboard-wrapper { display: flex; min-height: 100vh; overflow: hidden; }

/* ─── SIDEBAR ────────────────────────────────────────────────── */
.sidebar {
  width: var(--sidebar-w);
  background: #0f1629;
  color: #fff;
  display: flex; flex-direction: column;
  position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 500;
  transition: transform .3s ease;
  overflow-y: auto;
  overflow-x: hidden;
}
.sidebar-header {
  padding: 1.4rem 1.3rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: .8rem;
  flex-shrink: 0;
}
.sidebar-logo-icon {
  width: 38px; height: 38px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: var(--radius-xs);
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; color: #fff; flex-shrink: 0;
}
.sidebar-logo-text { font-size: .82rem; font-weight: 700; line-height: 1.3; }
.sidebar-logo-text small { display: block; font-size: .7rem; font-weight: 400; opacity: .5; }
.sidebar-user {
  padding: 1rem 1.3rem;
  border-bottom: 1px solid rgba(255,255,255,.07);
  display: flex; align-items: center; gap: .8rem;
  flex-shrink: 0;
}
.sidebar-user-name  { font-size: .88rem; font-weight: 700; }
.sidebar-user-role  { font-size: .72rem; color: rgba(255,255,255,.45); }
.sidebar-nav { padding: .8rem 0; flex: 1; }
.nav-section-label {
  font-size: .68rem; font-weight: 700; color: rgba(255,255,255,.3);
  text-transform: uppercase; letter-spacing: .08em;
  padding: 1rem 1.3rem .4rem;
}
.nav-item {
  display: flex; align-items: center; gap: .85rem;
  padding: .75rem 1.3rem;
  border-radius: 0;
  font-size: .88rem; font-weight: 500;
  color: rgba(255,255,255,.6);
  transition: var(--transition);
  position: relative;
  cursor: pointer;
}
.nav-item:hover { color: #fff; background: rgba(255,255,255,.07); }
.nav-item.active {
  color: #fff;
  background: rgba(58,122,254,.25);
  border-right: 3px solid var(--primary);
}
.nav-item.active i { color: var(--primary); }
.nav-item i { width: 18px; text-align: center; font-size: .95rem; flex-shrink: 0; }
.nav-item.logout { color: rgba(239,68,68,.7); margin-top: auto; }
.nav-item.logout:hover { color: var(--danger); background: rgba(239,68,68,.1); }
.sidebar-footer {
  padding: 1rem 1.3rem;
  border-top: 1px solid rgba(255,255,255,.07);
  font-size: .72rem; color: rgba(255,255,255,.3);
}

/* ─── MAIN CONTENT ───────────────────────────────────────────── */
.main-content {
  flex: 1;
  margin-left: var(--sidebar-w);
  display: flex; flex-direction: column;
  min-height: 100vh;
  transition: margin .3s ease;
}

/* ─── TOPBAR ─────────────────────────────────────────────────── */
.topbar {
  height: var(--topbar-h);
  background: var(--white);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; gap: 1rem;
  padding: 0 1.8rem;
  position: sticky; top: 0; z-index: 400;
  box-shadow: var(--shadow-sm);
}
.menu-toggle {
  display: none;
  align-items: center; justify-content: center;
  width: 40px; height: 40px;
  border-radius: var(--radius-xs);
  background: var(--secondary);
  color: var(--text);
  font-size: 1rem;
  flex-shrink: 0;
  transition: var(--transition);
}
.menu-toggle:hover { background: var(--primary-light); color: var(--primary); }
.topbar-title { font-size: 1.15rem; font-weight: 700; flex: 1; }
.topbar-right { display: flex; align-items: center; gap: .8rem; }
.topbar-user  { display: flex; align-items: center; gap: .6rem; font-size: .88rem; font-weight: 600; }
.topbar-greeting { color: var(--text-muted); font-weight: 400; font-size: .85rem; }

/* ─── CONTENT AREA ───────────────────────────────────────────── */
.content-area { flex: 1; padding: 2rem 1.8rem; }
.section { display: none; animation: fadeInUp .35s ease; }
.section.active { display: block; }

/* Overlay for mobile sidebar */
.sidebar-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 490;
}
.sidebar-overlay.active { display: block; }

/* ──────────────────────────────────────────────────────────────
   TENANT – SPECIFIC
   ──────────────────────────────────────────────────────────── */
.tenant-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.2rem; margin-bottom: 1.5rem; }
.tenant-profile-card {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: #fff;
  border-radius: var(--radius-md);
  padding: 1.8rem;
  display: flex; align-items: center; gap: 1.2rem;
  box-shadow: var(--shadow-md);
}
.tenant-profile-info h3 { font-size: 1.2rem; margin-bottom: .25rem; }
.tenant-profile-info p  { font-size: .85rem; opacity: .85; }
.tenant-profile-info .meta { display: flex; flex-direction: column; gap: .2rem; margin-top: .6rem; }
.tenant-profile-info .meta span { font-size: .82rem; opacity: .9; }

.room-info-card { border-radius: var(--radius-md); padding: 1.5rem; }
.room-info-num  { font-size: 2.5rem; font-weight: 800; color: var(--primary); }
.room-info-label{ font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; color: var(--text-muted); }
.room-stats     { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; margin-top: 1rem; }
.room-stat      { background: var(--secondary); border-radius: var(--radius-sm); padding: .8rem; text-align: center; }
.room-stat-val  { font-size: 1.3rem; font-weight: 800; color: var(--text); }
.room-stat-lbl  { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .04em; }

/* Payment Form */
.payment-card { max-width: 640px; }
.payment-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: .6rem; margin-top: .4rem; }
.method-option  {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .7rem .5rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: .8rem; font-weight: 600; color: var(--text-light);
}
.method-option:hover { border-color: var(--primary); color: var(--primary); background: var(--primary-light); }
.method-option.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); }
.method-option i { display: block; font-size: 1.1rem; margin-bottom: .25rem; }

/* Receipts grid */
.receipts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.2rem; }

/* ──────────────────────────────────────────────────────────────
   ADMIN – SPECIFIC
   ──────────────────────────────────────────────────────────── */
.admin-dash-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 1.4rem; }
.recent-activity { display: flex; flex-direction: column; gap: .6rem; }
.activity-item   { display: flex; align-items: flex-start; gap: .8rem; padding: .7rem 0; border-bottom: 1px solid rgba(226,232,240,.6); }
.activity-item:last-child { border-bottom: none; }
.activity-dot    { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; margin-top: .45rem; }
.activity-text   { font-size: .85rem; color: var(--text); line-height: 1.5; }
.activity-time   { font-size: .75rem; color: var(--text-muted); margin-top: .15rem; }

/* Account generator */
.account-gen-card { max-width: 580px; }
.account-gen-result { margin-top: 1.2rem; }

/* ──────────────────────────────────────────────────────────────
   ANIMATIONS
   ──────────────────────────────────────────────────────────── */
@keyframes fadeIn      { from { opacity: 0; }              to { opacity: 1; }              }
@keyframes fadeInUp    { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp     { from { opacity: 0; transform: translateY(24px); } to { opacity: 1; transform: translateY(0); } }
@keyframes dropIn      { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideInRight{ from { opacity: 0; transform: translateX(24px); } to { opacity: 1; transform: translateX(0); } }
@keyframes spin        { from { transform: rotate(0deg); }  to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }
.card-enter { animation: fadeInUp .4s ease both; }
.delay-1 { animation-delay: .1s; }
.delay-2 { animation-delay: .2s; }
.delay-3 { animation-delay: .3s; }
.delay-4 { animation-delay: .4s; }

/* ─── PAYMENT SUBMITTED FEEDBACK ────────────────────────────── */
@keyframes payFlash {
  0%   { background: rgba(16,185,129,.18); box-shadow: 0 0 0 2px var(--success); }
  70%  { background: rgba(16,185,129,.06); box-shadow: 0 0 0 2px rgba(16,185,129,.2); }
  100% { background: transparent; box-shadow: none; }
}
.pay-entry-new {
  animation: payFlash 2s ease forwards;
  border-radius: var(--radius-xs);
  padding: .75rem .5rem !important;
  margin: 0 -.5rem;
}
.pay-new-badge {
  display: inline-flex; align-items: center; gap: .25rem;
  background: var(--success); color: #fff;
  border-radius: var(--radius-full);
  font-size: .65rem; font-weight: 700;
  padding: .12rem .5rem; margin-left: .4rem;
  text-transform: uppercase; letter-spacing: .04em;
  animation: fadeIn .3s ease;
}
.pay-status-timeline {
  display: flex; flex-direction: column; gap: 0;
  margin-top: .8rem;
}
.pay-step {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .55rem 0;
  position: relative;
}
.pay-step:not(:last-child)::before {
  content: '';
  position: absolute;
  left: 11px; top: 28px;
  width: 2px; height: calc(100% - 10px);
  background: var(--border);
}
.pay-step-dot {
  width: 22px; height: 22px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; margin-top: .1rem;
}
.pay-step-dot.done    { background: var(--success); color: #fff; }
.pay-step-dot.active  { background: var(--warning-light); color: var(--warning); border: 2px solid var(--warning); animation: pulse 1.6s ease infinite; }
.pay-step-dot.pending { background: var(--border); color: var(--text-muted); }
@keyframes pulse { 0%,100%{transform:scale(1)} 50%{transform:scale(1.15)} }
.pay-step-info { flex: 1; }
.pay-step-title { font-size: .82rem; font-weight: 700; }
.pay-step-sub   { font-size: .74rem; color: var(--text-muted); margin-top: .1rem; }

/* Submit button processing state */
.btn-processing {
  background: var(--primary) !important;
  opacity: .8 !important;
  cursor: not-allowed !important;
}

/* ─── BED GRID (Room Occupancy Visual) ──────────────────────── */
.bed-section { margin-top: .9rem; }
.bed-section-label { font-size: .72rem; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 600; margin-bottom: .45rem; }
.bed-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 4px;
}
.bed {
  width: 100%; aspect-ratio: 1;
  border-radius: 4px;
  cursor: default;
  transition: transform .15s ease, box-shadow .15s ease;
  position: relative;
}
.bed:hover { transform: scale(1.25); z-index: 2; box-shadow: 0 2px 8px rgba(0,0,0,.2); }
.bed.occupied { background: var(--primary); }
.bed.occupied:hover { background: var(--primary-dark); }
.bed.empty    { background: #E2E8F0; }
.bed.empty:hover { background: #cbd5e1; }

/* Custom tooltip for beds */
.bed[data-tip]:hover::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 6px);
  left: 50%;
  transform: translateX(-50%);
  background: #0f1629;
  color: #fff;
  font-size: .68rem;
  white-space: nowrap;
  padding: .25rem .55rem;
  border-radius: 4px;
  pointer-events: none;
  z-index: 20;
}

/* ─── UNIFIED PAYMENT SIMULATION MODAL ──────────────────────── */

/* Branded headers — theme per method */
.ps-header              { color: #fff; }
.ps-header.ps-card      { background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%); }
.ps-header.ps-gcash     { background: linear-gradient(135deg, #00a94f, #007a38); }
.ps-header.ps-maya      { background: linear-gradient(135deg, #00b4d8, #0077b6); }
.ps-header.ps-instapay  { background: linear-gradient(135deg, #3A7AFE, #2563EB); }
.ps-header.ps-banking   { background: linear-gradient(135deg, #1e3a5f, #2d5986); }
.ps-brand {
  display: flex; align-items: center; gap: .6rem;
  margin-bottom: .5rem; font-size: 1.05rem; font-weight: 800;
}
.ps-brand-icon {
  width: 36px; height: 36px;
  background: rgba(255,255,255,.2);
  border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  font-size: .95rem;
}
.ps-amount { font-size: 2rem; font-weight: 900; letter-spacing: -.02em; line-height: 1; }
.ps-meta   { font-size: .8rem; opacity: .8; margin-top: .25rem; }

/* Credit Card live preview */
.cc-preview {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  border-radius: 14px;
  padding: 1.1rem 1.3rem;
  color: #fff;
  margin-bottom: 1.1rem;
  height: 152px;
  display: flex; flex-direction: column; justify-content: space-between;
  font-family: 'Courier New', monospace;
  box-shadow: 0 8px 28px rgba(0,0,0,.28);
  position: relative; overflow: hidden;
  transition: all .3s ease;
}
.cc-preview::after  { content:''; position:absolute; width:180px; height:180px; border-radius:50%; background:rgba(255,255,255,.05); top:-50px; right:-40px; }
.cc-preview::before { content:''; position:absolute; width:130px; height:130px; border-radius:50%; background:rgba(255,255,255,.04); bottom:-40px; left:-25px; }
.cc-chip { width: 38px; height: 28px; background: linear-gradient(135deg, #ffd700, #c8a200); border-radius: 5px; }
.cc-num  { font-size: 1.05rem; letter-spacing: .2em; font-weight: 600; }
.cc-bot  { display: flex; justify-content: space-between; align-items: flex-end; }
.cc-name { font-size: .72rem; text-transform: uppercase; letter-spacing: .05em; opacity: .9; }
.cc-exp  { font-size: .72rem; opacity: .9; }
.cc-network {
  position: absolute; top: .9rem; right: 1.1rem;
  font-size: .68rem; font-weight: 800; opacity: .85;
  background: rgba(255,255,255,.15); padding: .2rem .5rem; border-radius: 4px;
}

/* Bank selector grid */
.bank-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: .45rem;
  margin: .6rem 0;
}
.bank-item {
  border: 2px solid var(--border);
  border-radius: var(--radius-sm);
  padding: .5rem .3rem;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  font-size: .68rem; font-weight: 700; color: var(--text);
}
.bank-item:hover  { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: var(--primary); color: var(--primary); }
.bank-item.selected { border-color: var(--primary); background: var(--primary-light); color: var(--primary); box-shadow: 0 0 0 3px rgba(58,122,254,.15); }
.bank-badge {
  width: 32px; height: 32px;
  border-radius: 7px;
  margin: 0 auto .3rem;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 800; color: #fff;
}

/* Bank portal header bar */
.bank-portal-hdr {
  padding: .7rem 1rem;
  color: #fff; font-weight: 700; font-size: .9rem;
  display: flex; align-items: center; gap: .6rem;
  border-radius: var(--radius-sm);
  margin-bottom: .9rem;
}

/* SSL / Secure badge */
.secure-badge {
  display: inline-flex; align-items: center; gap: .35rem;
  font-size: .74rem; color: var(--success);
  padding: .28rem .65rem;
  background: var(--success-light);
  border-radius: var(--radius-full);
  margin-bottom: .8rem;
  width: fit-content;
}

/* ─── GCASH MODAL (legacy — kept for reference) ──────────────── */
.gcash-modal-header {
  background: linear-gradient(135deg, #00a94f, #007a38);
  color: #fff;
  padding: 1.6rem 1.8rem 1.2rem;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  position: relative;
}
.gcash-logo {
  display: flex; align-items: center; gap: .7rem;
  margin-bottom: .4rem;
}
.gcash-logo-circle {
  width: 40px; height: 40px;
  background: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #00a94f; font-size: 1.1rem; font-weight: 900;
}
.gcash-logo span { font-size: 1.2rem; font-weight: 800; letter-spacing: .02em; }
.gcash-sub { font-size: .82rem; opacity: .85; }
.gcash-amount-display {
  font-size: 2rem; font-weight: 900;
  margin-top: .8rem; letter-spacing: -.02em;
}
.gcash-loading {
  text-align: center;
  padding: 2rem 1rem;
  display: none;
}
.gcash-loading .spinner {
  width: 48px; height: 48px;
  border: 4px solid #e2e8f0;
  border-top-color: #00a94f;
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto 1rem;
}
.gcash-loading p { color: var(--text-muted); font-size: .9rem; }
.gcash-success {
  text-align: center;
  padding: 2rem 1rem;
  display: none;
  animation: fadeInUp .4s ease;
}
.gcash-success-icon {
  width: 64px; height: 64px;
  background: var(--success-light);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  font-size: 1.8rem; color: var(--success);
}
.gcash-success h3 { color: var(--success); margin-bottom: .5rem; }
.gcash-success p  { font-size: .88rem; color: var(--text-muted); }

/* ─── ANALYTICS / CHARTS ─────────────────────────────────────── */
.chart-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; margin-bottom: 1.4rem; }
.chart-card { background: var(--white); border-radius: var(--radius-md); padding: 1.5rem; box-shadow: var(--shadow-sm); border: 1px solid rgba(226,232,240,.7); }
.chart-card-title { font-size: 1rem; font-weight: 700; margin-bottom: .3rem; }
.chart-card-sub   { font-size: .8rem; color: var(--text-muted); margin-bottom: 1.2rem; }
.chart-wrap { position: relative; }

/* ──────────────────────────────────────────────────────────────
   RESPONSIVE — TABLET (≤ 1024px)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .stat-cards  { grid-template-columns: repeat(2, 1fr); }
  .room-grid   { grid-template-columns: repeat(2, 1fr); }
  .receipts-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-grid { grid-template-columns: repeat(2, 1fr); }
  .admin-dash-grid { grid-template-columns: 1fr; }
  .tenant-info-grid { grid-template-columns: 1fr; }
  .chart-grid { grid-template-columns: 1fr; }
  .payment-methods { grid-template-columns: repeat(3, 1fr); }
}

/* ──────────────────────────────────────────────────────────────
   RESPONSIVE — MOBILE (≤ 768px)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  /* Login */
  .login-page { grid-template-columns: 1fr; }
  .login-hero { padding: 2.5rem 1.8rem; min-height: 40vh; justify-content: center; }
  .login-hero h1 { font-size: 1.6rem; }
  .login-features { display: none; }
  .login-form-panel { padding: 2rem 1.5rem; }

  /* Sidebar */
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .menu-toggle  { display: flex; }

  /* Stats */
  .stat-cards { grid-template-columns: repeat(2, 1fr); gap: .8rem; }
  .stat-card  { padding: 1rem 1.1rem; }
  .stat-value { font-size: 1.3rem; }

  /* Room grid */
  .room-grid  { grid-template-columns: 1fr; }

  /* Receipts */
  .receipts-grid { grid-template-columns: 1fr; }

  /* Table */
  .data-table { font-size: .82rem; }
  .data-table thead th,
  .data-table tbody td { padding: .7rem .75rem; }

  /* Filters */
  .filter-grid { grid-template-columns: 1fr; }

  /* Modal */
  .modal-box { max-width: 100%; margin: .5rem; border-radius: var(--radius-md); }
  .modal-header, .modal-body, .modal-footer { padding-left: 1.2rem; padding-right: 1.2rem; }

  /* Forms */
  .form-row  { grid-template-columns: 1fr; }
  .payment-methods { grid-template-columns: repeat(2, 1fr); }

  /* Content */
  .content-area { padding: 1.2rem 1rem; }
  .topbar { padding: 0 1rem; }

  /* Room stat */
  .room-stats { grid-template-columns: 1fr 1fr; }
}

/* ──────────────────────────────────────────────────────────────
   RESPONSIVE — SMALL MOBILE (≤ 480px)
   ──────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .stat-cards { grid-template-columns: 1fr; }
  .topbar-greeting { display: none; }
  .payment-methods { grid-template-columns: 1fr 1fr; }
  .filter-actions { flex-wrap: wrap; }
}
