@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

/* ===== CSS VARIABLES ===== */
:root {
  --primary: #6366f1;
  --primary-dark: #4f46e5;
  --primary-light: #818cf8;
  --primary-bg: #eef2ff;
  --secondary: #0ea5e9;
  --success: #10b981;
  --success-bg: #d1fae5;
  --warning: #f59e0b;
  --warning-bg: #fef3c7;
  --danger: #ef4444;
  --danger-bg: #fee2e2;
  --info: #06b6d4;
  --info-bg: #cffafe;
  --dark: #0f172a;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-400: #9ca3af;
  --gray-300: #d1d5db;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --white: #ffffff;

  --sidebar-width: 260px;
  --sidebar-collapsed: 70px;
  --topbar-height: 64px;
  --border-radius: 12px;
  --border-radius-sm: 8px;
  --border-radius-lg: 16px;
  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 2px 4px -1px rgba(0,0,0,0.04);
  --shadow-md: 0 10px 15px -3px rgba(0,0,0,0.07), 0 4px 6px -2px rgba(0,0,0,0.04);
  --shadow-lg: 0 20px 25px -5px rgba(0,0,0,0.08), 0 10px 10px -5px rgba(0,0,0,0.03);
  --transition: all 0.2s ease;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; scroll-behavior: smooth; }
body { font-family: var(--font); background: var(--gray-50); color: var(--gray-800); line-height: 1.6; -webkit-font-smoothing: antialiased; }
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; display: block; }
input, select, textarea, button { font-family: inherit; font-size: inherit; }

/* ===== SIDEBAR ===== */
.sidebar {
  position: fixed; top: 0; left: 0; z-index: 100;
  width: var(--sidebar-width); height: 100vh;
  background: var(--dark);
  display: flex; flex-direction: column;
  transition: var(--transition);
  overflow: hidden;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 12px;
  padding: 20px 20px;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  min-height: var(--topbar-height);
}
.brand-icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0; font-size: 18px; color: white;
  box-shadow: 0 4px 12px rgba(99,102,241,0.4);
}
.brand-text { display: flex; flex-direction: column; }
.brand-text .app-name { font-size: 1rem; font-weight: 700; color: white; letter-spacing: 0.3px; }
.brand-text .app-version { font-size: 0.7rem; color: var(--gray-500); }

.sidebar-nav { flex: 1; overflow-y: auto; padding: 12px 0; }
.sidebar-nav::-webkit-scrollbar { width: 3px; }
.sidebar-nav::-webkit-scrollbar-track { background: transparent; }
.sidebar-nav::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 99px; }

.nav-section { padding: 8px 16px 4px; font-size: 0.65rem; font-weight: 600; color: var(--gray-600); letter-spacing: 1px; text-transform: uppercase; }
.nav-item { display: flex; align-items: center; gap: 12px; padding: 10px 20px; color: var(--gray-400); font-size: 0.88rem; font-weight: 500; cursor: pointer; position: relative; transition: var(--transition); border-left: 3px solid transparent; }
.nav-item:hover { color: white; background: rgba(255,255,255,0.05); }
.nav-item.active { color: white; background: rgba(99,102,241,0.15); border-left-color: var(--primary); }
.nav-item .nav-icon { width: 20px; text-align: center; font-size: 0.95rem; flex-shrink: 0; }
.nav-item .nav-label { flex: 1; }
.nav-item .nav-badge { background: var(--danger); color: white; font-size: 0.65rem; font-weight: 700; padding: 1px 6px; border-radius: 99px; }

.sidebar-footer {
  padding: 16px 20px;
  border-top: 1px solid rgba(255,255,255,0.07);
}
.sidebar-user { display: flex; align-items: center; gap: 10px; }
.user-avatar { width: 36px; height: 36px; border-radius: 50%; background: linear-gradient(135deg, var(--primary), var(--secondary)); display: flex; align-items: center; justify-content: center; color: white; font-weight: 700; font-size: 0.85rem; flex-shrink: 0; overflow: hidden; }
.user-avatar img { width: 100%; height: 100%; object-fit: cover; }
.user-info .user-name { font-size: 0.85rem; font-weight: 600; color: white; }
.user-info .user-role { font-size: 0.7rem; color: var(--gray-500); text-transform: capitalize; }
.logout-btn { margin-left: auto; color: var(--gray-500); font-size: 0.9rem; cursor: pointer; transition: var(--transition); }
.logout-btn:hover { color: var(--danger); }

/* ===== TOPBAR ===== */
.topbar {
  position: fixed; top: 0; right: 0;
  left: var(--sidebar-width); z-index: 50;
  height: var(--topbar-height);
  background: white;
  border-bottom: 1px solid var(--gray-200);
  display: flex; align-items: center; gap: 16px;
  padding: 0 24px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}
.topbar-left { flex: 1; display: flex; align-items: center; gap: 16px; }
.topbar-title h1 { font-size: 1.1rem; font-weight: 700; color: var(--gray-900); }
.topbar-title p { font-size: 0.78rem; color: var(--gray-500); }
.topbar-right { display: flex; align-items: center; gap: 12px; }
.topbar-notification { position: relative; cursor: pointer; }
.notif-btn { width: 38px; height: 38px; border-radius: 10px; background: var(--gray-100); border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: var(--gray-600); font-size: 1.05rem; transition: var(--transition); }
.notif-btn:hover { background: var(--primary-bg); color: var(--primary); }
.notif-dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; background: var(--danger); border-radius: 50%; border: 2px solid white; }

.menu-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--gray-600); font-size: 1.3rem; padding: 4px; }

/* ===== MAIN CONTENT ===== */
.main-content {
  margin-left: var(--sidebar-width);
  margin-top: var(--topbar-height);
  padding: 24px;
  min-height: calc(100vh - var(--topbar-height));
  transition: var(--transition);
}

/* ===== CARDS ===== */
.card {
  background: white;
  border-radius: var(--border-radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  border: 1px solid var(--gray-200);
}
.card-header {
  padding: 18px 24px;
  border-bottom: 1px solid var(--gray-100);
  display: flex; align-items: center; gap: 12px;
}
.card-header h2 { font-size: 1rem; font-weight: 700; color: var(--gray-900); flex: 1; }
.card-body { padding: 24px; }
.card-footer { padding: 16px 24px; border-top: 1px solid var(--gray-100); background: var(--gray-50); }

/* ===== STAT CARDS ===== */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: white; border-radius: var(--border-radius); padding: 20px;
  display: flex; align-items: flex-start; gap: 16px;
  border: 1px solid var(--gray-200); box-shadow: var(--shadow);
  transition: var(--transition);
}
.stat-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.stat-icon { width: 48px; height: 48px; border-radius: 12px; display: flex; align-items: center; justify-content: center; font-size: 1.3rem; flex-shrink: 0; }
.stat-content { flex: 1; min-width: 0; }
.stat-label { font-size: 0.78rem; color: var(--gray-500); font-weight: 500; margin-bottom: 2px; }
.stat-value { font-size: 1.6rem; font-weight: 800; color: var(--gray-900); line-height: 1.2; }
.stat-sub { font-size: 0.75rem; color: var(--gray-500); margin-top: 2px; }

.stat-icon.indigo  { background: var(--primary-bg);  color: var(--primary); }
.stat-icon.green   { background: var(--success-bg);  color: var(--success); }
.stat-icon.yellow  { background: var(--warning-bg);  color: var(--warning); }
.stat-icon.red     { background: var(--danger-bg);   color: var(--danger); }
.stat-icon.sky     { background: var(--info-bg);     color: var(--info); }
.stat-icon.purple  { background: #f3e8ff;            color: #9333ea; }

/* ===== BADGES ===== */
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 99px; font-size: 0.72rem; font-weight: 600; white-space: nowrap; }
.badge-success  { background: var(--success-bg); color: var(--success); }
.badge-primary  { background: var(--primary-bg); color: var(--primary); }
.badge-warning  { background: var(--warning-bg); color: #b45309; }
.badge-danger   { background: var(--danger-bg);  color: var(--danger); }
.badge-secondary{ background: var(--gray-100);   color: var(--gray-600); }
.badge-info     { background: var(--info-bg);    color: var(--info); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  padding: 8px 18px; border-radius: var(--border-radius-sm);
  font-size: 0.85rem; font-weight: 600; cursor: pointer;
  border: 1.5px solid transparent; transition: var(--transition);
  white-space: nowrap; text-decoration: none;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--primary); color: white; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 4px 12px rgba(99,102,241,0.35); }
.btn-success { background: var(--success); color: white; border-color: var(--success); }
.btn-success:hover { background: #059669; box-shadow: 0 4px 12px rgba(16,185,129,0.35); }
.btn-danger { background: var(--danger); color: white; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; box-shadow: 0 4px 12px rgba(239,68,68,0.35); }
.btn-warning { background: var(--warning); color: white; border-color: var(--warning); }
.btn-warning:hover { background: #d97706; }
.btn-secondary { background: white; color: var(--gray-700); border-color: var(--gray-300); }
.btn-secondary:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-outline-primary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary); color: white; }
.btn-sm { padding: 5px 12px; font-size: 0.78rem; }
.btn-lg { padding: 12px 28px; font-size: 0.95rem; }
.btn-icon { padding: 7px; width: 34px; height: 34px; border-radius: 8px; }
.btn-block { width: 100%; }

/* ===== FORMS ===== */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-size: 0.83rem; font-weight: 600; color: var(--gray-700); margin-bottom: 6px; }
.form-label .required { color: var(--danger); margin-left: 2px; }
.form-control {
  width: 100%; padding: 9px 14px; font-size: 0.88rem;
  border: 1.5px solid var(--gray-300); border-radius: var(--border-radius-sm);
  background: white; color: var(--gray-800);
  transition: var(--transition); outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(99,102,241,0.1); }
.form-control::placeholder { color: var(--gray-400); }
.form-control:disabled { background: var(--gray-100); color: var(--gray-500); cursor: not-allowed; }
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 90px; }
.form-hint { font-size: 0.75rem; color: var(--gray-500); margin-top: 4px; }
.form-error { font-size: 0.75rem; color: var(--danger); margin-top: 4px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.input-group { position: relative; display: flex; }
.input-group .form-control { border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0; }
.input-group-text { display: flex; align-items: center; padding: 9px 14px; background: var(--gray-100); border: 1.5px solid var(--gray-300); border-right: none; border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm); font-size: 0.85rem; color: var(--gray-600); white-space: nowrap; }

/* ===== TABLE ===== */
.table-wrapper { overflow-x: auto; }
.table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.table th { padding: 12px 16px; text-align: left; font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px; color: var(--gray-500); background: var(--gray-50); border-bottom: 1px solid var(--gray-200); white-space: nowrap; }
.table th:first-child { border-radius: 8px 0 0 0; }
.table th:last-child  { border-radius: 0 8px 0 0; }
.table td { padding: 13px 16px; border-bottom: 1px solid var(--gray-100); color: var(--gray-700); vertical-align: middle; }
.table tr:last-child td { border-bottom: none; }
.table tr:hover td { background: var(--gray-50); }
.table .actions { display: flex; gap: 6px; }

/* ===== ALERTS ===== */
.alert {
  padding: 12px 18px; border-radius: var(--border-radius-sm);
  font-size: 0.85rem; font-weight: 500;
  display: flex; align-items: flex-start; gap: 10px;
  margin-bottom: 16px; border: 1px solid transparent;
}
.alert i { margin-top: 1px; flex-shrink: 0; }
.alert-success { background: var(--success-bg); color: #065f46; border-color: #6ee7b7; }
.alert-error   { background: var(--danger-bg);  color: #991b1b; border-color: #fca5a5; }
.alert-warning { background: var(--warning-bg); color: #78350f; border-color: #fcd34d; }
.alert-info    { background: var(--info-bg);    color: #0c4a6e; border-color: #67e8f9; }

/* ===== PAGE HEADER ===== */
.page-header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.page-header-left h2 { font-size: 1.3rem; font-weight: 800; color: var(--gray-900); }
.page-header-left p { font-size: 0.83rem; color: var(--gray-500); margin-top: 2px; }
.page-header-right { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== SEARCH/FILTER BAR ===== */
.filter-bar { display: flex; gap: 10px; margin-bottom: 20px; flex-wrap: wrap; }
.filter-bar .form-control { min-width: 160px; }
.search-input-wrapper { position: relative; flex: 1; min-width: 200px; }
.search-input-wrapper .form-control { padding-left: 36px; }
.search-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--gray-400); font-size: 0.85rem; }

/* ===== EMPTY STATE ===== */
.empty-state {
  text-align: center; padding: 60px 24px;
  color: var(--gray-500);
}
.empty-state i { font-size: 3rem; margin-bottom: 16px; opacity: 0.4; }
.empty-state h3 { font-size: 1.05rem; font-weight: 700; color: var(--gray-700); margin-bottom: 6px; }
.empty-state p { font-size: 0.85rem; margin-bottom: 20px; }

/* ===== PAGINATION ===== */
.pagination-nav { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0 0; flex-wrap: wrap; }
.pagination { list-style: none; display: flex; gap: 4px; flex-wrap: wrap; }
.page-btn {
  display: flex; align-items: center; justify-content: center;
  min-width: 34px; height: 34px; padding: 0 10px;
  border-radius: 8px; font-size: 0.82rem; font-weight: 600;
  color: var(--gray-600); background: white;
  border: 1.5px solid var(--gray-200); cursor: pointer; transition: var(--transition);
}
.page-btn:hover:not(.disabled):not(.dots) { background: var(--primary-bg); color: var(--primary); border-color: var(--primary-light); }
.page-btn.active { background: var(--primary); color: white; border-color: var(--primary); }
.page-btn.disabled { opacity: 0.4; cursor: not-allowed; }
.page-btn.dots { cursor: default; border: none; background: none; }
.pagination-info { font-size: 0.78rem; color: var(--gray-500); }

/* ===== KAMAR GRID ===== */
.kamar-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.kamar-card {
  background: white; border-radius: var(--border-radius); overflow: hidden;
  border: 1px solid var(--gray-200); box-shadow: var(--shadow); transition: var(--transition);
  display: flex; flex-direction: column;
}
.kamar-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.kamar-img { height: 160px; background: linear-gradient(135deg, var(--primary-bg), var(--info-bg)); overflow: hidden; position: relative; }
.kamar-img img { width: 100%; height: 100%; object-fit: cover; }
.kamar-img-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--primary-light); }
.kamar-status-badge { position: absolute; top: 10px; right: 10px; }
.kamar-body { padding: 16px; flex: 1; display: flex; flex-direction: column; gap: 8px; }
.kamar-number { font-size: 1.2rem; font-weight: 800; color: var(--gray-900); }
.kamar-name { font-size: 0.83rem; color: var(--gray-600); }
.kamar-price { font-size: 0.95rem; font-weight: 700; color: var(--primary); margin-top: auto; }
.kamar-footer { padding: 12px 16px; border-top: 1px solid var(--gray-100); display: flex; gap: 6px; background: var(--gray-50); }

/* ===== CHART ===== */
.chart-container { position: relative; height: 280px; }

/* ===== MODAL ===== */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 200; display: none; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(3px); }
.modal-overlay.open { display: flex; }
.modal { background: white; border-radius: var(--border-radius-lg); box-shadow: var(--shadow-lg); width: 100%; max-width: 480px; max-height: 90vh; overflow-y: auto; animation: modalIn 0.2s ease; }
.modal-header { padding: 20px 24px; border-bottom: 1px solid var(--gray-200); display: flex; align-items: center; gap: 12px; }
.modal-header h3 { flex: 1; font-size: 1rem; font-weight: 700; }
.modal-close { background: none; border: none; cursor: pointer; font-size: 1.1rem; color: var(--gray-500); transition: var(--transition); }
.modal-close:hover { color: var(--gray-900); }
.modal-body { padding: 24px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--gray-200); display: flex; gap: 10px; justify-content: flex-end; }

@keyframes modalIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }

/* ===== DETAIL GRID ===== */
.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-label { font-size: 0.73rem; font-weight: 600; color: var(--gray-500); text-transform: uppercase; letter-spacing: 0.5px; }
.detail-value { font-size: 0.9rem; color: var(--gray-800); font-weight: 500; }

/* ===== UPLOAD PHOTO ===== */
.upload-area { border: 2px dashed var(--gray-300); border-radius: var(--border-radius); padding: 32px 16px; text-align: center; cursor: pointer; transition: var(--transition); }
.upload-area:hover { border-color: var(--primary); background: var(--primary-bg); }
.upload-area i { font-size: 2rem; color: var(--gray-400); margin-bottom: 8px; }
.upload-area p { font-size: 0.83rem; color: var(--gray-500); }
.upload-preview { margin-top: 12px; border-radius: var(--border-radius-sm); overflow: hidden; max-height: 160px; }
.upload-preview img { width: 100%; object-fit: cover; }

/* ===== AUTH LAYOUT ===== */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, #0f172a 0%, #1e1b4b 50%, #0f172a 100%); position: relative; overflow: hidden; }
.auth-bg-decoration { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
.auth-bg-decoration .circle { position: absolute; border-radius: 50%; }
.auth-bg-decoration .c1 { width: 400px; height: 400px; background: rgba(99,102,241,0.1); top: -100px; right: -100px; }
.auth-bg-decoration .c2 { width: 300px; height: 300px; background: rgba(14,165,233,0.08); bottom: -80px; left: -80px; }
.auth-bg-decoration .c3 { width: 200px; height: 200px; background: rgba(168,85,247,0.07); top: 40%; left: 30%; }
.auth-card { background: white; border-radius: var(--border-radius-lg); box-shadow: 0 25px 50px rgba(0,0,0,0.3); width: 100%; max-width: 420px; padding: 40px; position: relative; z-index: 1; }
.auth-logo { text-align: center; margin-bottom: 28px; }
.auth-logo .logo-icon { width: 56px; height: 56px; border-radius: 16px; background: linear-gradient(135deg, var(--primary), var(--primary-dark)); display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: white; margin: 0 auto 12px; box-shadow: 0 8px 24px rgba(99,102,241,0.4); }
.auth-logo h1 { font-size: 1.4rem; font-weight: 800; color: var(--gray-900); }
.auth-logo p { font-size: 0.83rem; color: var(--gray-500); margin-top: 4px; }

/* ===== TIMELINE ===== */
.timeline { display: flex; flex-direction: column; gap: 0; }
.timeline-item { display: flex; gap: 16px; padding-bottom: 20px; position: relative; }
.timeline-item:last-child { padding-bottom: 0; }
.timeline-icon { width: 36px; height: 36px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.85rem; position: relative; z-index: 1; }
.timeline-line { position: absolute; left: 18px; top: 36px; bottom: 0; width: 2px; background: var(--gray-200); transform: translateX(-50%); }
.timeline-item:last-child .timeline-line { display: none; }
.timeline-content { flex: 1; padding-top: 6px; }
.timeline-content h4 { font-size: 0.88rem; font-weight: 600; color: var(--gray-800); }
.timeline-content p { font-size: 0.78rem; color: var(--gray-500); }

/* ===== NOTIFICATION ITEM ===== */
.notif-list { display: flex; flex-direction: column; gap: 0; }
.notif-item { padding: 14px 0; border-bottom: 1px solid var(--gray-100); display: flex; gap: 12px; align-items: flex-start; }
.notif-item:last-child { border-bottom: none; }
.notif-dot-icon { width: 38px; height: 38px; border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; font-size: 0.9rem; }
.notif-text h4 { font-size: 0.85rem; font-weight: 600; color: var(--gray-800); }
.notif-text p { font-size: 0.78rem; color: var(--gray-500); }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
  :root { --sidebar-width: 220px; }
}

@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); z-index: 300; }
  .sidebar.open { transform: translateX(0); }
  .topbar { left: 0; padding: 0 16px; }
  .main-content { margin-left: 0; padding: 16px; }
  .menu-toggle { display: flex; }
  .form-row, .form-row-3 { grid-template-columns: 1fr; }
  .detail-grid { grid-template-columns: 1fr; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .kamar-grid { grid-template-columns: 1fr 1fr; }
  .page-header { flex-direction: column; }
  .page-header-right { width: 100%; }
  .filter-bar { flex-direction: column; }
}

@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
  .kamar-grid { grid-template-columns: 1fr; }
  .topbar-title p { display: none; }
  .auth-card { padding: 28px 20px; }
}

/* ===== SIDEBAR OVERLAY (mobile) ===== */
.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 299; }
.sidebar-overlay.open { display: block; }

/* ===== UTILITIES ===== */
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--gray-500); }
.text-small  { font-size: 0.78rem; }
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger  { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold { font-weight: 700; }
.fw-semi { font-weight: 600; }
.d-flex  { display: flex; }
.align-center { align-items: center; }
.gap-8  { gap: 8px; }
.gap-12 { gap: 12px; }
.mt-4   { margin-top: 4px; }
.mt-8   { margin-top: 8px; }
.mt-16  { margin-top: 16px; }
.mt-24  { margin-top: 24px; }
.mb-8   { margin-bottom: 8px; }
.mb-16  { margin-bottom: 16px; }
.mb-24  { margin-bottom: 24px; }
.p-0    { padding: 0; }
.w-full { width: 100%; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== SPINNER ===== */
.spinner { width: 20px; height: 20px; border: 2px solid rgba(255,255,255,0.3); border-top-color: white; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ===== SCROLL TO TOP ===== */
.scroll-top { position: fixed; bottom: 24px; right: 24px; width: 40px; height: 40px; background: var(--primary); color: white; border: none; border-radius: 50%; cursor: pointer; display: none; align-items: center; justify-content: center; box-shadow: var(--shadow-md); z-index: 99; transition: var(--transition); font-size: 0.9rem; }
.scroll-top.visible { display: flex; }
.scroll-top:hover { background: var(--primary-dark); transform: translateY(-2px); }

/* Print */
@media print {
  .sidebar, .topbar, .no-print { display: none !important; }
  .main-content { margin: 0; padding: 0; }
  body { background: white; }
}

/* ===== PAGE ACTIONS BAR ===== */
.page-actions {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 20px; flex-wrap: wrap;
}
.page-actions .filter-form {
  display: flex; align-items: center; gap: 8px; flex: 1; flex-wrap: wrap;
}
.page-back { margin-bottom: 16px; }
.action-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ===== SEARCH BOX ===== */
.search-box {
  position: relative; display: flex; align-items: center; flex: 1; min-width: 200px;
}
.search-box i {
  position: absolute; left: 12px; color: var(--gray-400); font-size: 0.85rem; pointer-events: none;
}
.search-box .form-control { padding-left: 36px; }

/* ===== FORM GRIDS ===== */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 16px; }
.form-card { max-width: 860px; }
.form-section-title {
  font-size: 0.78rem; font-weight: 700; color: var(--gray-500);
  text-transform: uppercase; letter-spacing: 0.8px;
  padding-bottom: 8px; border-bottom: 1px solid var(--gray-100);
  margin-bottom: 16px;
}
.form-actions {
  display: flex; gap: 10px; justify-content: flex-end;
  padding-top: 20px; border-top: 1px solid var(--gray-100); margin-top: 8px;
}
.input-prefix {
  display: flex; align-items: center; padding: 9px 12px;
  background: var(--gray-100); border: 1.5px solid var(--gray-300);
  border-right: none; border-radius: var(--border-radius-sm) 0 0 var(--border-radius-sm);
  font-size: 0.85rem; color: var(--gray-600); white-space: nowrap;
}
.input-addon {
  display: flex; align-items: center; padding: 9px 12px;
  background: var(--gray-100); border: 1.5px solid var(--gray-300);
  border-left: none; border-radius: 0 var(--border-radius-sm) var(--border-radius-sm) 0;
  cursor: pointer; color: var(--gray-500); transition: var(--transition); flex-shrink: 0;
}
.input-addon:hover { color: var(--primary); }
.form-select { 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'%3E%3Cpath fill='%236b7280' d='M7 10l5 5 5-5z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.foto-preview { max-width: 200px; border-radius: 8px; overflow: hidden; border: 1px solid var(--gray-200); }
.preview-img { width: 100%; height: auto; display: block; max-height: 160px; object-fit: cover; }

/* ===== STAT ICON VARIANTS ===== */
.stat-body { flex: 1; }
.stat-icon-blue   { background: #eff6ff; color: #3b82f6; }
.stat-icon-green  { background: var(--success-bg); color: var(--success); }
.stat-icon-purple { background: #f3e8ff; color: #9333ea; }
.stat-icon-orange { background: #fff7ed; color: #f97316; }
.stat-icon-red    { background: var(--danger-bg); color: var(--danger); }
.stat-value-sm  { font-size: 1.15rem; font-weight: 800; color: var(--gray-900); line-height: 1.3; }
.stat-meta      { font-size: 0.72rem; color: var(--gray-500); margin-top: 2px; }
.stats-grid-2   { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); }
.stats-grid-3   { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
.stats-grid-4   { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
.stats-row      { display: flex; gap: 12px; margin-bottom: 16px; flex-wrap: wrap; }
.stat-pill      { display: flex; align-items: center; gap: 8px; padding: 8px 16px; background: white; border: 1px solid var(--gray-200); border-radius: 99px; font-size: 0.82rem; color: var(--gray-600); box-shadow: var(--shadow-sm); }

/* ===== KAMAR CARD ===== */
.kamar-foto { height: 160px; position: relative; background: linear-gradient(135deg, var(--primary-bg), #e0f2fe); overflow: hidden; }
.kamar-foto img { width: 100%; height: 100%; object-fit: cover; }
.kamar-foto-placeholder { height: 100%; display: flex; align-items: center; justify-content: center; font-size: 3rem; color: var(--primary-light); }
.kamar-status-badge { position: absolute; top: 10px; right: 10px; }
.kamar-body { padding: 14px; flex: 1; display: flex; flex-direction: column; gap: 6px; }
.kamar-header { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.kamar-nomor { font-size: 1.05rem; font-weight: 800; color: var(--gray-900); }
.kamar-tipe  { font-size: 0.72rem; background: var(--primary-bg); color: var(--primary); padding: 2px 8px; border-radius: 99px; font-weight: 600; }
.kamar-nama  { font-size: 0.83rem; color: var(--gray-600); }
.kamar-info  { display: flex; gap: 10px; flex-wrap: wrap; }
.kamar-info span { font-size: 0.75rem; color: var(--gray-500); display: flex; align-items: center; gap: 4px; }
.kamar-fasilitas { font-size: 0.75rem; color: var(--gray-500); }
.kamar-harga { font-size: 1rem; font-weight: 700; color: var(--primary); margin-top: auto; }
.kamar-harga span { font-size: 0.72rem; font-weight: 400; color: var(--gray-400); }
.kamar-actions { display: flex; gap: 6px; padding: 10px 14px; border-top: 1px solid var(--gray-100); background: var(--gray-50); }

/* ===== DETAIL LAYOUT ===== */
.detail-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; align-items: start; }
.detail-main { display: flex; flex-direction: column; gap: 16px; }
.detail-sidebar { display: flex; flex-direction: column; gap: 16px; }
.detail-foto { height: 240px; overflow: hidden; background: var(--gray-100); }
.detail-foto img { width: 100%; height: 100%; object-fit: cover; }
.detail-foto-placeholder { height: 240px; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--primary-bg), #e0f2fe); font-size: 5rem; color: var(--primary-light); }
.detail-title-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.detail-name { font-size: 1.3rem; font-weight: 800; color: var(--gray-900); }
.detail-sub  { color: var(--gray-500); font-size: 0.85rem; }
.detail-info-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 20px; }
.detail-info-item { display: flex; flex-direction: column; gap: 3px; }
.detail-info-full { grid-column: 1 / -1; }
.info-label { font-size: 0.72rem; font-weight: 600; color: var(--gray-400); text-transform: uppercase; letter-spacing: 0.5px; }
.info-value { font-size: 0.88rem; color: var(--gray-800); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; }

/* ===== ALERT LIST (sidebar items) ===== */
.alert-list { list-style: none; }
.alert-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--gray-100);
}
.alert-item:last-child { border-bottom: none; }
.alert-item-icon {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 0.9rem;
}
.alert-item-body { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.alert-item-name { font-size: 0.85rem; font-weight: 600; color: var(--gray-800); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.alert-item-sub  { font-size: 0.72rem; color: var(--gray-500); }
.bg-warning-soft { background: var(--warning-bg); color: #b45309; }
.bg-danger-soft  { background: var(--danger-bg);  color: var(--danger); }
.bg-success-soft { background: var(--success-bg); color: var(--success); }
.bg-primary-soft { background: var(--primary-bg); color: var(--primary); }

/* ===== DASHBOARD LAYOUT ===== */
.dashboard-grid { display: grid; grid-template-columns: 1.5fr 1fr; gap: 20px; margin-top: 20px; }
.dashboard-alerts { display: flex; flex-direction: column; gap: 16px; }
.chart-container { position: relative; height: 280px; }
.chart-lg { height: 340px; }
.mt-4 { margin-top: 16px; }
.mt-3 { margin-top: 12px; }
.mt-2 { margin-top: 8px; }
.mb-4 { margin-bottom: 16px; }
.p-0 { padding: 0 !important; }
.px-4 { padding-left: 16px; padding-right: 16px; }
.py-3 { padding-top: 12px; padding-bottom: 12px; }

/* ===== TABLE VARIANTS ===== */
.table-responsive { overflow-x: auto; }
.table-hover tr:hover td { background: var(--gray-50); }
.table-user { display: flex; align-items: center; gap: 10px; }
.table-avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 0.82rem; overflow: hidden;
}
.table-name { font-weight: 600; color: var(--gray-800); font-size: 0.85rem; }
.table-sub  { font-size: 0.72rem; color: var(--gray-500); }
.action-btns { display: flex; gap: 5px; }
.btn-xs { padding: 4px 8px; font-size: 0.72rem; border-radius: 6px; }
.row-danger td  { background: #fff5f5 !important; }
.row-warning td { background: #fffbeb !important; }
.btn-ghost { background: transparent; color: var(--gray-600); border-color: transparent; }
.btn-ghost:hover { background: var(--gray-100); color: var(--gray-800); }
.btn-outline { background: white; color: var(--gray-700); border-color: var(--gray-300); }
.btn-outline:hover { background: var(--gray-50); border-color: var(--gray-400); }
.btn-sm { padding: 6px 12px; font-size: 0.8rem; }
.btn-block { width: 100%; }
.text-green { color: var(--success); }
.font-semibold { font-weight: 600; }
.font-bold { font-weight: 700; }
.link-primary { color: var(--primary); text-decoration: underline; }
.link-primary:hover { color: var(--primary-dark); }

/* ===== EMPTY STATES ===== */
.empty-state-sm { text-align: center; padding: 28px 16px; color: var(--gray-400); }
.empty-state-sm i { font-size: 2rem; margin-bottom: 8px; display: block; opacity: 0.4; }
.empty-state-sm p { font-size: 0.83rem; }
.empty-icon { font-size: 3.5rem; margin-bottom: 16px; opacity: 0.3; }

/* ===== TENANT PROFILE ===== */
.tenant-profile { display: flex; align-items: center; gap: 16px; padding-bottom: 20px; border-bottom: 1px solid var(--gray-100); }
.tenant-avatar-xl {
  width: 72px; height: 72px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 1.6rem;
}
.tenant-avatar-lg {
  width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), #06b6d4);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 700; font-size: 1.2rem; margin: 0 auto 12px;
}
.tenant-current { text-align: center; }
.tenant-current h3 { font-size: 1rem; font-weight: 700; color: var(--gray-900); }
.tenant-current p { font-size: 0.83rem; color: var(--gray-500); }
.tenant-profile-info h2 { font-size: 1.2rem; font-weight: 800; color: var(--gray-900); }
.tenant-profile-info p { font-size: 0.85rem; color: var(--gray-500); }

/* ===== PEMBAYARAN FORM WITH INFO PANEL ===== */
.form-with-sidebar { display: grid; grid-template-columns: 1fr 320px; gap: 20px; align-items: start; }
.info-panel { position: sticky; top: calc(var(--topbar-height) + 16px); }
.pembayaran-summary { display: flex; justify-content: space-between; align-items: center; border-bottom: 1px solid var(--gray-100); }

/* ===== PROFILE PAGE ===== */
.profile-grid { display: grid; grid-template-columns: 280px 1fr; gap: 24px; align-items: start; }
.profile-card .card-body { display: flex; flex-direction: column; align-items: center; }
.profile-avatar-wrap { position: relative; display: inline-block; }
.profile-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #8b5cf6);
  display: flex; align-items: center; justify-content: center;
  color: white; font-weight: 800; font-size: 2rem; overflow: hidden;
  border: 3px solid white; box-shadow: 0 4px 20px rgba(99,102,241,0.3);
}
.profile-avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-upload-btn {
  position: absolute; bottom: 2px; right: 2px;
  width: 28px; height: 28px; border-radius: 50%;
  background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.7rem; cursor: pointer; box-shadow: 0 2px 8px rgba(0,0,0,0.2);
  transition: var(--transition);
}
.avatar-upload-btn:hover { background: var(--primary-dark); }
.profile-name  { font-size: 1.1rem; font-weight: 800; color: var(--gray-900); }
.profile-role  { margin: 4px 0; }
.profile-username, .profile-email, .profile-since { font-size: 0.82rem; color: var(--gray-500); margin-top: 4px; }
.profile-form-panel { display: flex; flex-direction: column; gap: 20px; }

/* ===== OCCUPANCY BAR ===== */
.occupancy-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.occupancy-label { font-size: 0.85rem; font-weight: 600; color: var(--gray-700); }
.occupancy-pct   { font-size: 1.3rem; font-weight: 800; color: var(--primary); }
.occupancy-bar   { height: 12px; background: var(--gray-100); border-radius: 99px; overflow: hidden; margin-bottom: 12px; }
.occupancy-fill  { height: 100%; background: linear-gradient(90deg, var(--primary), var(--success)); border-radius: 99px; transition: width 0.8s ease; }
.occupancy-legend { display: flex; gap: 16px; flex-wrap: wrap; }
.occupancy-legend span { font-size: 0.78rem; color: var(--gray-500); display: flex; align-items: center; gap: 6px; }
.dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; flex-shrink: 0; }
.dot-terisi     { background: var(--primary); }
.dot-kosong     { background: var(--success); }
.dot-maintenance{ background: var(--warning); }

/* ===== BADGES EXTENDED ===== */
.badge-primary-soft { background: var(--primary-bg); color: var(--primary); }
.card-title { font-size: 0.95rem; font-weight: 700; color: var(--gray-900); flex: 1; display: flex; align-items: center; gap: 8px; }

/* ===== RESPONSIVE ADDITIONS ===== */
@media (max-width: 1024px) {
  .dashboard-grid { grid-template-columns: 1fr; }
  .detail-grid    { grid-template-columns: 1fr; }
  .form-with-sidebar { grid-template-columns: 1fr; }
  .profile-grid   { grid-template-columns: 1fr; }
  .info-panel     { position: static; }
}
@media (max-width: 768px) {
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .page-actions { flex-direction: column; align-items: stretch; }
  .page-actions .filter-form { flex-direction: column; }
  .action-group { width: 100%; }
  .detail-info-grid { grid-template-columns: 1fr; }
  .stats-grid-3, .stats-grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 480px) {
  .stats-grid-3, .stats-grid-4 { grid-template-columns: 1fr; }
}
