/* RentalHub — Main Stylesheet */
:root {
  --primary: #1a56db;
  --primary-light: #eff6ff;
  --primary-dark: #1344b5;
  --accent: #f59e0b;
  --success: #10b981;
  --success-light: #d1fae5;
  --danger: #ef4444;
  --danger-light: #fee2e2;
  --warning: #f59e0b;
  --warning-light: #fef3c7;
  --info: #6366f1;
  --info-light: #ede9fe;
  --secondary: #64748b;
  --bg: #f1f5f9;
  --surface: #ffffff;
  --border: #e2e8f0;
  --text: #0f172a;
  --text-muted: #64748b;
  --sidebar-bg: #0f172a;
  --sidebar-text: #94a3b8;
  --sidebar-active: #1a56db;
  --sidebar-w: 248px;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.08), 0 2px 4px -1px rgba(0,0,0,.04);
  --font: 'Plus Jakarta Sans', sans-serif;
  --font-mono: 'Space Mono', monospace;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 15px; }
body { font-family: var(--font); background: var(--bg); color: var(--text); min-height: 100vh; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; }

/* LAYOUT */
.layout { display: flex; min-height: 100vh; }

/* SIDEBAR */
.sidebar {
  width: var(--sidebar-w); min-height: 100vh; background: var(--sidebar-bg);
  display: flex; flex-direction: column; position: fixed; left: 0; top: 0; bottom: 0;
  z-index: 100; transition: transform .25s;
}
.sidebar-brand {
  display: flex; align-items: center; gap: 10px; padding: 20px 18px;
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.brand-icon {
  width: 38px; height: 38px; background: var(--primary); border-radius: 9px;
  display: flex; align-items: center; justify-content: center; color: #fff; flex-shrink: 0;
}
.brand-name { font-size: 1.1rem; font-weight: 700; color: #fff; letter-spacing: -.3px; }
.sidebar-nav { flex: 1; padding: 12px 0; overflow-y: auto; }
.nav-group { padding: 6px 0; }
.nav-label {
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #475569; padding: 8px 18px 4px;
}
.nav-item {
  display: flex; align-items: center; gap: 10px; padding: 9px 18px;
  color: var(--sidebar-text); font-size: .875rem; font-weight: 500;
  transition: background .15s, color .15s; border-radius: 0; cursor: pointer; text-decoration: none;
}
.nav-item:hover { background: rgba(255,255,255,.06); color: #fff; text-decoration: none; }
.nav-item.active { background: rgba(26,86,219,.25); color: #fff; border-right: 3px solid var(--primary); }
.nav-item svg, .nav-item i { width: 17px; height: 17px; flex-shrink: 0; }
.sidebar-footer {
  border-top: 1px solid rgba(255,255,255,.06); padding: 14px 16px;
  display: flex; align-items: center; gap: 10px;
}
.user-info { flex: 1; display: flex; align-items: center; gap: 10px; min-width: 0; }
.user-avatar {
  width: 34px; height: 34px; background: var(--primary); border-radius: 50%;
  display: flex; align-items: center; justify-content: center; color: #fff;
  font-size: .8rem; font-weight: 700; flex-shrink: 0;
}
.user-name { font-size: .8rem; color: #e2e8f0; font-weight: 600; }
.user-role { font-size: .7rem; color: #64748b; }
.logout-btn { color: #64748b; display: flex; padding: 6px; border-radius: 6px; transition: color .15s; }
.logout-btn:hover { color: var(--danger); text-decoration: none; }

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

/* TOPBAR */
.topbar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 14px 28px; display: flex; align-items: center; gap: 16px; position: sticky; top: 0; z-index: 50;
}
.sidebar-toggle { display: none; background: none; border: none; cursor: pointer; color: var(--text); padding: 4px; }
.page-title-area { flex: 1; }
.page-heading { font-size: 1.15rem; font-weight: 700; color: var(--text); line-height: 1.2; }
.breadcrumb { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: .75rem; color: var(--text-muted); }
.breadcrumb a { color: var(--primary); }
.bc-sep { opacity: .4; }
.topbar-actions { display: flex; gap: 8px; }

/* CONTENT */
.content-area { padding: 24px 28px; flex: 1; }

/* CARDS */
.card { background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border); box-shadow: var(--shadow); }
.card-header { padding: 16px 20px; border-bottom: 1px solid var(--border); display: flex; align-items: center; justify-content: space-between; }
.card-title { font-size: .95rem; font-weight: 700; color: var(--text); }
.card-body { padding: 20px; }

/* STAT CARDS */
.stats-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat-card {
  background: var(--surface); border-radius: var(--radius); border: 1px solid var(--border);
  padding: 20px; display: flex; align-items: flex-start; gap: 14px;
}
.stat-icon {
  width: 44px; height: 44px; border-radius: 10px; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0;
}
.stat-icon.blue   { background: var(--primary-light); color: var(--primary); }
.stat-icon.green  { background: var(--success-light); color: var(--success); }
.stat-icon.yellow { background: var(--warning-light); color: var(--warning); }
.stat-icon.red    { background: var(--danger-light); color: var(--danger); }
.stat-icon.purple { background: var(--info-light); color: var(--info); }
.stat-value { font-size: 1.5rem; font-weight: 800; color: var(--text); font-family: var(--font-mono); letter-spacing: -1px; }
.stat-label { font-size: .8rem; color: var(--text-muted); margin-top: 2px; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px;
  border-radius: var(--radius-sm); font-size: .85rem; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; transition: all .15s; text-decoration: none; font-family: var(--font);
}
.btn:hover { text-decoration: none; }
.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); color: #fff; }
.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { background: #059669; color: #fff; }
.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { background: #dc2626; color: #fff; }
.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--border); }
.btn-outline { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline:hover { background: var(--primary); color: #fff; }
.btn-sm { padding: 5px 11px; font-size: .8rem; }
.btn-icon { padding: 7px; }
.btn svg, .btn i { width: 15px; height: 15px; }

/* TABLES */
.table-wrapper { overflow-x: auto; }
table.data-table { width: 100%; border-collapse: collapse; }
.data-table th {
  background: #f8fafc; border-bottom: 2px solid var(--border); padding: 10px 14px;
  text-align: left; font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .05em; color: var(--text-muted); white-space: nowrap;
}
.data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: .875rem; vertical-align: middle; }
.data-table tr:last-child td { border-bottom: none; }
.data-table tbody tr:hover { background: #f8fafc; }
.data-table .actions { display: flex; gap: 6px; }
.no-data { text-align: center; padding: 40px; color: var(--text-muted); }

/* FORMS */
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 18px; }
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.form-group { display: flex; flex-direction: column; gap: 5px; }
.form-group.full { grid-column: 1 / -1; }
label { font-size: .82rem; font-weight: 600; color: var(--text); }
label .req { color: var(--danger); margin-left: 2px; }
input[type=text], input[type=email], input[type=number], input[type=date], input[type=password],
input[type=tel], select, textarea {
  width: 100%; padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius-sm);
  font-size: .875rem; font-family: var(--font); color: var(--text); background: #fff;
  transition: border-color .15s, box-shadow .15s; outline: none;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--primary); box-shadow: 0 0 0 3px rgba(26,86,219,.1);
}
textarea { resize: vertical; min-height: 80px; }
.form-hint { font-size: .75rem; color: var(--text-muted); }
.form-section { margin-bottom: 28px; }
.form-section-title {
  font-size: .8rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--text-muted); padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 16px;
}
.form-actions { display: flex; gap: 10px; padding-top: 16px; border-top: 1px solid var(--border); margin-top: 20px; }

/* BADGES */
.badge {
  display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 20px;
  font-size: .7rem; font-weight: 700; letter-spacing: .03em;
}
.badge-success { background: var(--success-light); color: #065f46; }
.badge-danger  { background: var(--danger-light); color: #991b1b; }
.badge-warning { background: var(--warning-light); color: #92400e; }
.badge-info    { background: var(--info-light); color: #3730a3; }
.badge-secondary { background: #f1f5f9; color: var(--secondary); }

/* ALERTS */
.alert {
  display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-radius: var(--radius-sm); margin-bottom: 18px; font-size: .875rem; font-weight: 500;
}
.alert svg, .alert i { width: 16px; height: 16px; flex-shrink: 0; }
.alert-success { background: var(--success-light); color: #065f46; border: 1px solid #a7f3d0; }
.alert-error   { background: var(--danger-light); color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: var(--warning-light); color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: var(--info-light); color: #3730a3; border: 1px solid #c7d2fe; }

/* FILTER BAR */
.filter-bar { display: flex; gap: 10px; margin-bottom: 18px; flex-wrap: wrap; align-items: center; }
.filter-bar input, .filter-bar select { min-width: 160px; max-width: 220px; }
.filter-bar .spacer { flex: 1; }

/* DETAIL VIEW */
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0; }
.detail-row { padding: 12px 20px; border-bottom: 1px solid var(--border); display: flex; flex-direction: column; gap: 3px; }
.detail-label { font-size: .72rem; font-weight: 700; color: var(--text-muted); text-transform: uppercase; letter-spacing: .05em; }
.detail-value { font-size: .9rem; color: var(--text); font-weight: 500; }

/* PAGINATION */
.pagination { display: flex; gap: 4px; margin-top: 16px; justify-content: flex-end; }
.page-btn {
  padding: 6px 12px; border-radius: var(--radius-sm); font-size: .8rem; font-weight: 600;
  background: var(--surface); border: 1px solid var(--border); color: var(--text); text-decoration: none;
}
.page-btn.active, .page-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); text-decoration: none; }

/* TABS */
.tabs { display: flex; gap: 0; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; font-size: .875rem; font-weight: 600; color: var(--text-muted);
  border: none; background: none; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px;
  font-family: var(--font); transition: color .15s;
}
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); }
.tab-pane { display: none; }
.tab-pane.active { display: block; }

/* PROGRESS BAR */
.progress-bar { height: 6px; background: var(--border); border-radius: 3px; overflow: hidden; }
.progress-fill { height: 100%; border-radius: 3px; background: var(--primary); transition: width .3s; }
.progress-fill.green  { background: var(--success); }
.progress-fill.orange { background: var(--warning); }
.progress-fill.red    { background: var(--danger); }

/* SECTION SPACING */
.section-gap { margin-bottom: 24px; }

/* MODAL */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-box {
  background: var(--surface); border-radius: var(--radius); max-width: 480px; width: 100%;
  padding: 28px; box-shadow: var(--shadow-md);
}
.modal-title { font-size: 1rem; font-weight: 700; margin-bottom: 12px; }

/* RESPONSIVE */
@media (max-width: 768px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); }
  .main-content { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .content-area { padding: 16px; }
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }
  .topbar { padding: 12px 16px; }
}

/* UTILITIES */
.text-right { text-align: right; }
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.fw-bold { font-weight: 700; }
.mt-1 { margin-top: 8px; } .mt-2 { margin-top: 16px; } .mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; } .mb-2 { margin-bottom: 16px; } .mb-3 { margin-bottom: 24px; }
.d-flex { display: flex; } .align-center { align-items: center; } .gap-2 { gap: 8px; } .gap-3 { gap: 12px; }
.mono { font-family: var(--font-mono); }
.amount { font-family: var(--font-mono); font-weight: 700; }

/* Print */
@media print {
  .sidebar, .topbar, .btn, .filter-bar { display: none !important; }
  .main-content { margin: 0; }
  .content-area { padding: 0; }
}
