/* ===================================================
   Apartman Yönet - Modern Design System
   =================================================== */

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

:root {
  --sidebar-bg: #FFFFFF;
  --sidebar-hover: #F2F6FC;
  --sidebar-active: #EEF4FF;
  --sidebar-active-border: #4169E1;
  --sidebar-text: #64748B;
  --sidebar-text-active: #172554;
  --sidebar-width: 260px;

  --primary: #4169E1;
  --primary-dark: #2949A3;
  --primary-light: #EEF4FF;
  --primary-rgb: 65, 105, 225;

  --success: #16A34A;
  --success-light: #ECFDF5;
  --warning: #F59E0B;
  --warning-light: #FFF7ED;
  --danger: #E11D48;
  --danger-light: #FFF1F2;
  --info: #0EA5E9;
  --info-light: #F0F9FF;
  --purple: #7C3AED;
  --purple-light: #F5F3FF;
  --cyan: #0891B2;
  --cyan-light: #ECFEFF;
  --orange: #F97316;
  --orange-light: #FFF7ED;

  --bg: #F5F7FB;
  --bg-card: #FFFFFF;
  --bg-card2: #F8FAFC;
  --border: #E2E8F0;
  --border-light: #EEF2F7;

  --text: #0F172A;
  --text-secondary: #475569;
  --text-muted: #7A8AA0;
  --text-light: #CBD5E1;

  --header-h: 72px;
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --radius-xl: 20px;
  --radius-2xl: 24px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
  --shadow: 0 1px 3px rgba(0,0,0,0.07), 0 4px 12px rgba(0,0,0,0.04);
  --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 1px 3px rgba(0,0,0,0.05);
  --shadow-lg: 0 10px 40px rgba(0,0,0,0.1), 0 2px 6px rgba(0,0,0,0.06);
  --shadow-primary: 0 8px 24px rgba(65,105,225,0.2);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { height: 100%; }
body {
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }

/* ===================== LAYOUT ===================== */
.app-shell { display: flex; min-height: 100vh; }

/* ===================== SIDEBAR ===================== */
.sidebar {
  width: var(--sidebar-width);
  background:
    linear-gradient(180deg, rgba(238,244,255,0.9), rgba(255,255,255,0.98) 34%),
    var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0; left: 0;
  height: 100vh;
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 100;
  transition: transform 0.3s ease;
}
.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.1); border-radius: 4px; }

.sidebar-header {
  padding: 24px 18px 18px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.brand { display: flex; align-items: center; gap: 12px; }

.brand-icon {
  width: 42px; height: 42px;
  background: linear-gradient(135deg, #4169E1, #7C3AED);
  border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}

.brand-name { font-size: 15px; font-weight: 700; color: var(--text); line-height: 1.2; }
.brand-sub { font-size: 10.5px; color: var(--sidebar-text); letter-spacing: 0.05em; }

.sidebar-nav { flex: 1; padding: 14px 10px; overflow-y: auto; }

.nav-section-label {
  font-size: 11px; font-weight: 800; color: #4169E1;
  letter-spacing: 0.04em;
  padding: 0 12px; margin: 18px 0 8px;
}

.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px; border-radius: 14px;
  color: var(--sidebar-text); font-size: 13.5px; font-weight: 600;
  transition: all 0.2s ease; margin-bottom: 4px; cursor: pointer;
  border: 1px solid transparent;
}
.nav-item:hover {
  background: var(--sidebar-hover);
  color: var(--sidebar-text-active);
  border-color: #D8E4FF;
  transform: translateX(2px);
}
.nav-item.active {
  background: var(--sidebar-active);
  color: var(--sidebar-text-active);
  border-color: #C7D7FE;
  box-shadow: inset 3px 0 0 var(--sidebar-active-border);
}
.nav-item.active .nav-icon { color: var(--primary); background: #E0E9FF; }

.nav-icon {
  width: 30px; height: 30px; display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0; border-radius: 10px;
  background: rgba(255,255,255,0.04);
}
.nav-icon i { font-size: 16px; line-height: 1; }
.nav-badge { margin-left: auto; background: var(--danger); color: #fff; font-size: 10px; font-weight: 700; padding: 2px 7px; border-radius: 20px; }
.nav-divider { height: 1px; background: var(--border); margin: 10px 8px; }

.sidebar-footer {
  padding: 14px 10px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.sidebar-user {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: var(--radius);
  background:
    linear-gradient(135deg, #F8FAFC, #EEF4FF);
  border: 1px solid #DCE7F8;
}

.sidebar-user-avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: linear-gradient(135deg, #4169E1, #7C3AED);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff; flex-shrink: 0;
}

.sidebar-user-name { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.2; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-role { font-size: 10.5px; color: var(--sidebar-text); }
.sidebar-user-logout { margin-left: auto; color: var(--sidebar-text); font-size: 16px; transition: color 0.2s; flex-shrink: 0; }
.sidebar-user-logout:hover { color: var(--danger); }

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

/* ===================== HEADER ===================== */
.header {
  height: var(--header-h); background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; padding: 0 24px; gap: 16px;
  position: sticky; top: 0; z-index: 50; box-shadow: var(--shadow-sm);
}

.header-left { flex: 1; display: flex; align-items: center; gap: 14px; }

.sidebar-toggle {
  width: 36px; height: 36px; border-radius: var(--radius-sm);
  background: none; border: 1px solid var(--border); cursor: pointer;
  display: none; align-items: center; justify-content: center;
  font-size: 18px; color: var(--text-secondary); transition: all 0.2s;
}
.sidebar-toggle:hover { background: var(--bg); color: var(--primary); }

.breadcrumb { display: flex; align-items: center; gap: 8px; color: var(--text-muted); font-size: 13px; }
.breadcrumb-sep { color: var(--text-light); }
.breadcrumb-current { color: var(--text); font-weight: 600; }

.header-right { display: flex; align-items: center; gap: 10px; }
.header-search-form {
  display: flex;
}
.header-search-wrap {
  position: relative;
}
.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 240px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: #fff;
}
.header-search i {
  color: var(--text-muted);
  font-size: 14px;
}
.header-search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 13px;
  color: var(--text);
}
.header-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 220;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 320px;
  overflow-y: auto;
  display: none;
}
.header-search-results.show {
  display: block;
}
.header-search-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  gap: 2px;
}
.header-search-item:last-child {
  border-bottom: 0;
}
.header-search-item strong {
  font-size: 13px;
  color: var(--text);
}
.header-search-item span {
  font-size: 11.5px;
  color: var(--text-muted);
}
.header-search-item:hover,
.header-search-item.is-active {
  background: var(--bg-card2);
}
.header-search-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.header-balance-chip {
  display: grid;
  gap: 2px;
  min-width: 130px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: #fff;
}
.header-balance-chip.bank {
  background: #f4fbf9;
}
.header-balance-label {
  font-size: 10px;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 700;
}
.header-balance-chip strong {
  font-size: 13px;
  color: var(--text);
}

.apartment-selector {
  display: flex; align-items: center; gap: 8px;
  background: var(--bg); border: 1.5px solid var(--border);
  border-radius: var(--radius); padding: 8px 14px; min-width: 210px;
  transition: border-color 0.2s;
}
.apartment-selector:focus-within { border-color: var(--primary); }
.apartment-selector-icon { color: var(--primary); font-size: 16px; flex-shrink: 0; }
.apartment-selector select { background: none; border: none; outline: none; font-size: 13px; font-weight: 500; color: var(--text); cursor: pointer; width: 100%; font-family: inherit; }

.header-btn {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  background: var(--bg); border: 1px solid var(--border);
  display: flex; align-items: center; justify-content: center;
  font-size: 17px; color: var(--text-secondary); cursor: pointer; transition: all 0.2s;
}
.header-btn:hover { background: var(--primary-light); color: var(--primary); border-color: var(--primary); }

/* ===================== CONTENT ===================== */
.content { flex: 1; padding: 24px; }

.page-header {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 16px; margin-bottom: 22px;
}
.page-title { font-size: 22px; font-weight: 800; color: var(--text); line-height: 1.2; }
.page-subtitle { font-size: 13px; color: var(--text-muted); margin-top: 4px; }
.page-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }

/* ===================== STATS ===================== */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px; margin-bottom: 22px;
}

.stat-card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  padding: 18px; border: 1px solid var(--border); box-shadow: var(--shadow);
  display: flex; align-items: center; gap: 14px;
  transition: transform 0.2s, box-shadow 0.2s;
}
.stat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }

.stat-icon {
  width: 50px; height: 50px; border-radius: var(--radius);
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; flex-shrink: 0;
}
.stat-icon i { font-size: 20px; line-height: 1; }
.stat-icon.primary { background: var(--primary-light); color: var(--primary); }
.stat-icon.success { background: var(--success-light); color: var(--success); }
.stat-icon.warning { background: var(--warning-light); color: var(--warning); }
.stat-icon.danger { background: var(--danger-light); color: var(--danger); }
.stat-icon.info { background: var(--info-light); color: var(--info); }
.stat-icon.purple { background: var(--purple-light); color: var(--purple); }
.stat-icon.cyan { background: var(--cyan-light); color: var(--cyan); }
.stat-icon.orange { background: var(--orange-light); color: var(--orange); }

.stat-body { flex: 1; min-width: 0; }
.stat-value { font-size: 24px; font-weight: 800; color: var(--text); line-height: 1; margin-bottom: 4px; }
.stat-label { font-size: 12px; color: var(--text-muted); font-weight: 500; }

/* ===================== CARDS ===================== */
.card {
  background: var(--bg-card); border-radius: var(--radius-lg);
  border: 1px solid var(--border); box-shadow: var(--shadow); overflow: hidden;
}
.card + .card { margin-top: 0px; }

.card-header {
  padding: 16px 20px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
}
.card-title { font-size: 14.5px; font-weight: 700; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card-title-icon { color: var(--primary); font-size: 16px; }
.card-title-icon i { font-size: 15px; line-height: 1; }
.card-body { padding: 20px; }
.card-footer { padding: 14px 20px; border-top: 1px solid var(--border); background: var(--bg-card2); }

/* ===================== APP FOOTER ===================== */
.app-footer {
  margin-top: 28px;
  padding: 16px 18px;
  border: 1px solid #DCE7F8;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 12% 0%, rgba(65,105,225,0.12), transparent 34%),
    linear-gradient(135deg, #FFFFFF, #F3F7FD);
  color: var(--text);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: 0 12px 30px rgba(15,23,42,0.07);
}
.app-footer-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}
.app-footer-icon {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  background: linear-gradient(135deg, #7C3AED, #D946EF 58%, #22D3EE);
  box-shadow: 0 10px 24px rgba(65,105,225,0.18);
}
.app-footer-brand strong {
  display: block;
  font-size: 13.5px;
  line-height: 1.25;
}
.app-footer-brand span:not(.app-footer-icon) {
  display: block;
  margin-top: 2px;
  font-size: 11.5px;
  color: var(--text-muted);
}
.app-footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: flex-end;
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
}
.app-footer-meta span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #FFFFFF;
  border: 1px solid #DCE7F8;
}

/* ===================== GRID ===================== */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; }
.grid-12 { display: grid; grid-template-columns: 1fr 2fr; gap: 18px; }
.grid-21 { display: grid; grid-template-columns: 2fr 1fr; gap: 18px; }

/* ===================== FORMS ===================== */
.form-group { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.form-label { font-size: 13px; font-weight: 600; color: var(--text); }

.form-control, .form-select {
  width: 100%; padding: 9px 13px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; color: var(--text);
  background: var(--bg-card); transition: all 0.2s; outline: none;
}
.form-control:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,0.12);
}
.form-control::placeholder { color: var(--text-light); }
textarea.form-control { resize: vertical; min-height: 80px; }

.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(175px,1fr)); gap: 12px; }
.form-hint { font-size: 12px; color: var(--text-muted); }

.checkbox-group {
  display: flex; flex-wrap: wrap; gap: 8px;
  max-height: 180px; overflow-y: auto; padding: 12px;
  border: 1.5px solid var(--border); border-radius: var(--radius-sm); background: var(--bg);
}

.checkbox-item {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 10px; background: var(--bg-card);
  border: 1px solid var(--border); border-radius: 6px;
  cursor: pointer; font-size: 12.5px; font-weight: 500;
  transition: all 0.2s; user-select: none;
}
.checkbox-item:hover { border-color: var(--primary); color: var(--primary); }
.checkbox-item input[type="checkbox"] { accent-color: var(--primary); }

/* ===================== BUTTONS ===================== */
.btn {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 9px 18px; border-radius: var(--radius-sm);
  font-family: inherit; font-size: 13.5px; font-weight: 600;
  cursor: pointer; border: 1.5px solid transparent;
  transition: all 0.2s ease; text-decoration: none;
  white-space: nowrap; outline: none; line-height: 1;
}
.btn-sm { padding: 6px 12px; font-size: 12.5px; }
.btn-lg { padding: 12px 24px; font-size: 15px; }
.btn-full { width: 100%; justify-content: center; }

.btn-primary { background: var(--primary); color: #fff; border-color: var(--primary); box-shadow: 0 2px 8px rgba(99,102,241,0.3); }
.btn-primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); transform: translateY(-1px); box-shadow: 0 4px 12px rgba(99,102,241,0.4); }

.btn-success { background: var(--success); color: #fff; border-color: var(--success); }
.btn-success:hover { filter: brightness(1.05); transform: translateY(-1px); }

.btn-danger { background: var(--danger); color: #fff; border-color: var(--danger); }
.btn-danger:hover { filter: brightness(1.05); transform: translateY(-1px); }

.btn-warning { background: var(--warning); color: #fff; border-color: var(--warning); }

.btn-outline { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-outline:hover { background: var(--bg); color: var(--text); }

.btn-outline-primary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-outline-primary:hover { background: var(--primary-light); }

.btn-ghost { background: transparent; color: var(--text-secondary); border-color: transparent; }
.btn-ghost:hover { background: var(--bg); color: var(--text); }

.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

/* ===================== TABLES ===================== */
.table-container { overflow-x: auto; }

table { width: 100%; border-collapse: collapse; font-size: 13.5px; }

table th {
  background: var(--bg-card2); color: var(--text-muted);
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; padding: 11px 16px; text-align: left;
  border-bottom: 1px solid var(--border); white-space: nowrap;
}

table td {
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  color: var(--text); vertical-align: middle;
}

table tbody tr:last-child td { border-bottom: none; }
table tbody tr { transition: background 0.15s; }
table tbody tr:hover { background: #FAFBFF; }
table tbody tr.clickable { cursor: pointer; }

.td-muted { color: var(--text-muted); font-size: 12.5px; }
.td-actions { text-align: right; white-space: nowrap; }
.td-bold { font-weight: 700; }

/* ===================== BADGES ===================== */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 11.5px; font-weight: 600; white-space: nowrap;
}
.badge-primary { background: var(--primary-light); color: var(--primary); }
.badge-success { background: var(--success-light); color: #047857; }
.badge-warning { background: var(--warning-light); color: #B45309; }
.badge-danger { background: var(--danger-light); color: #B91C1C; }
.badge-info { background: var(--info-light); color: #1D4ED8; }
.badge-purple { background: var(--purple-light); color: #6D28D9; }
.badge-muted { background: var(--bg); color: var(--text-muted); border: 1px solid var(--border); }

/* ===================== ALERTS ===================== */
.alert {
  padding: 13px 18px; border-radius: var(--radius); font-size: 13.5px; font-weight: 500;
  display: flex; align-items: center; gap: 10px; margin-bottom: 16px; border: 1px solid;
}
.alert-success { background: var(--success-light); border-color: #6EE7B7; color: #065F46; }
.alert-error { background: var(--danger-light); border-color: #FCA5A5; color: #991B1B; }
.alert-warning { background: var(--warning-light); border-color: #FCD34D; color: #92400E; }
.alert-info { background: var(--info-light); border-color: #93C5FD; color: #1E40AF; }

/* ===================== TABS ===================== */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 20px; }
.tab-btn {
  padding: 10px 18px; font-size: 13.5px; font-weight: 600;
  color: var(--text-muted); cursor: pointer; border: none; background: none;
  border-bottom: 2px solid transparent; margin-bottom: -2px;
  transition: all 0.2s; font-family: inherit;
  display: flex; align-items: center; gap: 6px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
}
.tab-btn:hover { color: var(--text); background: var(--bg); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: var(--primary-light); }
.tab-content { display: none; }
.tab-content.active { display: block; }

/* ===================== MODALS ===================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(15,23,42,0.6);
  backdrop-filter: blur(4px); z-index: 200;
  display: flex; align-items: center; justify-content: center; padding: 24px;
  opacity: 0; pointer-events: none; transition: opacity 0.25s;
}
.modal-overlay.show { opacity: 1; pointer-events: auto; }

.modal {
  background: var(--bg-card); border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg); width: 100%; max-width: 560px;
  max-height: 90vh; overflow-y: auto;
  transform: translateY(16px) scale(0.98); transition: transform 0.25s ease;
}
.modal-overlay.show .modal { transform: translateY(0) scale(1); }
.modal-lg { max-width: 720px; }
.modal-xl { max-width: 900px; }

.modal-header {
  padding: 20px 24px 16px; border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-title {
  font-size: 16px; font-weight: 700; color: var(--text);
  display: flex; align-items: center; gap: 10px;
}
.modal-title-icon {
  width: 34px; height: 34px; border-radius: var(--radius-sm);
  background: var(--primary-light); display: flex; align-items: center;
  justify-content: center; color: var(--primary); font-size: 16px;
}
.modal-close {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--bg); border: 1px solid var(--border);
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 16px; color: var(--text-muted); transition: all 0.2s;
}
.modal-close:hover { background: var(--danger-light); color: var(--danger); border-color: var(--danger); }
.modal-body { padding: 20px 24px; }
.modal-footer {
  padding: 16px 24px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: flex-end; gap: 10px;
  background: var(--bg-card2); border-radius: 0 0 var(--radius-xl) var(--radius-xl);
}

.account-box-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 10px;
}
.account-box {
  display: block;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: #fff;
  cursor: pointer;
  transition: all 0.2s;
}
.account-box input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.account-box-main {
  display: block;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--text);
}
.account-box-sub {
  display: block;
  margin-top: 4px;
  font-size: 12px;
  color: var(--text-muted);
}
.account-box:has(input:checked) {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.12);
  background: var(--primary-light);
}

.unit-search-wrap {
  position: relative;
}
.unit-search-results {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  z-index: 210;
  background: #fff;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  max-height: 240px;
  overflow-y: auto;
  display: none;
}
.unit-search-results.show {
  display: block;
}
.unit-search-item {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--border-light);
  background: #fff;
  text-align: left;
  padding: 10px 12px;
  cursor: pointer;
  display: grid;
  gap: 2px;
}
.unit-search-item:last-child {
  border-bottom: 0;
}
.unit-search-item strong {
  font-size: 13px;
  color: var(--text);
}
.unit-search-item span {
  font-size: 12px;
  color: var(--text-muted);
}
.unit-search-item:hover,
.unit-search-item.is-active {
  background: var(--bg-card2);
}
.unit-search-empty {
  padding: 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.selected-unit-box {
  border: 1.5px solid var(--primary);
  background: var(--primary-light);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
}
.selected-unit-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  text-transform: uppercase;
  margin-bottom: 8px;
}
.selected-unit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}
.selected-unit-grid strong {
  display: block;
  font-size: 13px;
  color: var(--text);
}
.selected-unit-grid span {
  display: block;
  font-size: 11px;
  color: var(--text-muted);
}

.field-error {
  border-color: var(--danger) !important;
  box-shadow: 0 0 0 3px rgba(239,68,68,0.14) !important;
}

/* ===================== UNITS GRID ===================== */
.units-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px,1fr));
  gap: 10px;
}

.units-grid-enhanced {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.unit-card {
  background: linear-gradient(180deg, rgba(255,255,255,0.92) 0%, rgba(244,248,252,0.92) 100%);
  border: 1px solid var(--border);
  border-radius: 0; 
  padding: 14px 16px;
  min-height: 188px;
  cursor: pointer; transition: all 0.2s; text-align: left;
  box-shadow: var(--shadow-sm);
}
.unit-card:hover { border-color: rgba(var(--primary-rgb), 0.45); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.unit-card.debt {
  border-color: rgba(180,35,24,0.28);
  background: linear-gradient(180deg, rgba(180,35,24,0.06) 0%, rgba(180,35,24,0.10) 100%);
}
.unit-card.paid {
  border-color: rgba(62,107,84,0.25);
  background: linear-gradient(180deg, rgba(62,107,84,0.05) 0%, rgba(62,107,84,0.09) 100%);
}
.unit-card.empty {
  border-color: rgba(114,129,150,0.30);
  background: linear-gradient(180deg, rgba(255,255,255,0.88) 0%, rgba(237,242,247,0.88) 100%);
}
.unit-card.partial { border-color: var(--warning); background: #FFFBF0; }

.unit-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.unit-badge {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(var(--primary-rgb), 0.1);
  color: var(--primary);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.03em;
}
.unit-card.debt .unit-badge {
  background: rgba(239,68,68,0.12);
  color: #b91c1c;
}
.unit-card.paid .unit-badge {
  background: rgba(16,185,129,0.12);
  color: #047857;
}
.unit-card.empty .unit-badge {
  background: rgba(148,163,184,0.16);
  color: #475569;
}
.unit-floor {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 700;
}
.unit-no {
  font-size: 22px; font-weight: 700; color: var(--text); line-height: 1.15; margin-bottom: 8px;
}
.unit-resident-label {
  font-size: 11px;
  color: var(--text-muted);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.unit-resident {
  font-size: 14px;
  color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  margin-bottom: 12px;
  font-weight: 600;
}
.unit-balance { font-size: 13px; font-weight: 700; }
.unit-balance.negative { color: var(--danger); }
.unit-balance.positive { color: var(--success); }
.unit-balance.zero { color: var(--text-muted); }
.unit-meta {
  margin-top: 10px;
  font-size: 12px;
  font-weight: 600;
}
.unit-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(148,163,184,0.18);
  font-size: 12.5px;
  font-weight: 700;
  color: var(--text-secondary);
}

@media (max-width: 1400px) {
  .units-grid-enhanced { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 1024px) {
  .units-grid-enhanced { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .units-grid-enhanced { grid-template-columns: 1fr; }
}
.unit-card-footer i {
  font-size: 14px;
}

.units-legend {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}
.units-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
}
.units-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}
.units-legend-dot.paid { background: var(--success); }
.units-legend-dot.debt { background: var(--danger); }
.units-legend-dot.empty { background: #94A3B8; }

/* ===================== LIST ITEMS ===================== */
.list-item {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 16px; border-bottom: 1px solid var(--border-light);
  transition: background 0.15s;
}
.list-item:last-child { border-bottom: none; }
.list-item:hover { background: var(--bg-card2); }
.list-item-icon {
  width: 38px; height: 38px; border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-size: 16px; flex-shrink: 0;
}
.list-item-body { flex: 1; min-width: 0; }
.list-item-title { font-size: 13.5px; font-weight: 600; color: var(--text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.list-item-sub { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.list-item-right { flex-shrink: 0; text-align: right; }

/* ===================== SEARCH ===================== */
.search-bar { position: relative; }
.search-bar-icon { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 15px; pointer-events: none; }
.search-bar .form-control { padding-left: 38px; }

/* ===================== EMPTY STATE ===================== */
.empty-state { text-align: center; padding: 48px 24px; color: var(--text-muted); }
.empty-state-icon { font-size: 48px; opacity: 0.3; margin-bottom: 12px; }
.empty-state-title { font-size: 16px; font-weight: 600; color: var(--text); margin-bottom: 6px; }
.empty-state-desc { font-size: 13px; }

/* ===================== CHARTS ===================== */
.chart-container { position: relative; height: 260px; }

/* ===================== LEGAL LEDGER ===================== */
.legal-ledger-card {
  border-color: #CBD5E1;
}
.legal-ledger-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  border-bottom: 1px solid var(--border);
  background: #F8FAFC;
}
.legal-ledger-summary div {
  padding: 12px 18px;
  border-right: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.legal-ledger-summary div:last-child {
  border-right: 0;
}
.legal-ledger-summary span {
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.legal-ledger-summary strong {
  font-size: 15px;
}
.legal-ledger-wrap {
  overflow-x: auto;
  background: #fff;
}
.legal-ledger-table {
  min-width: 1120px;
  border-collapse: collapse;
  font-size: 12.5px;
}
.legal-ledger-table th,
.legal-ledger-table td {
  border: 1px solid #CBD5E1;
  padding: 8px 10px;
  vertical-align: top;
}
.legal-ledger-table th {
  background: #E2E8F0;
  color: #334155;
  text-align: center;
  letter-spacing: 0.04em;
}
.legal-ledger-table tbody tr:hover {
  background: #FFFEF7;
}
.legal-ledger-side-head th {
  font-size: 14px;
  color: #0F172A;
}
.legal-ledger-income-head {
  background: #DCFCE7 !important;
}
.legal-ledger-expense-head {
  background: #FEE2E2 !important;
}
.legal-ledger-table th:nth-child(5),
.legal-ledger-table td:nth-child(5) {
  border-right-width: 3px;
  border-right-color: #64748B;
}
.legal-ledger-no {
  width: 44px;
  text-align: center;
  color: var(--text-muted);
  font-weight: 700;
}
.legal-ledger-amount {
  text-align: right;
  white-space: nowrap;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.legal-ledger-empty {
  background: #F8FAFC;
}
.legal-ledger-table tfoot td {
  background: #F1F5F9;
  font-weight: 800;
}

/* ===================== FILTERS ===================== */
.filters-bar { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-bottom: 16px; }

/* ===================== PACKAGES ===================== */
.packages-grid { display: grid; grid-template-columns: repeat(auto-fit,minmax(220px,1fr)); gap: 16px; }
.package-card {
  background: var(--bg-card); border: 2px solid var(--border);
  border-radius: var(--radius-xl); padding: 24px 20px;
  position: relative; transition: all 0.2s; text-align: center;
}
.package-card:hover { border-color: var(--primary); transform: translateY(-4px); box-shadow: var(--shadow-md); }
.package-card.featured { border-color: var(--primary); }
.package-badge {
  position: absolute; top: -12px; left: 50%; transform: translateX(-50%);
  background: linear-gradient(135deg, var(--primary), var(--purple));
  color: #fff; padding: 4px 14px; border-radius: 20px;
  font-size: 10.5px; font-weight: 700; white-space: nowrap;
}
.package-name { font-size: 16px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.package-price { font-size: 30px; font-weight: 800; color: var(--primary); line-height: 1; margin: 12px 0 4px; }
.package-price span { font-size: 14px; font-weight: 500; color: var(--text-muted); }
.package-features { list-style: none; margin: 14px 0; text-align: left; display: flex; flex-direction: column; gap: 8px; }
.package-features li { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text-secondary); }
.package-features li .check { color: var(--success); }

/* ===================== AUTH ===================== */
.auth-body {
  background: linear-gradient(135deg, #0F172A 0%, #1E293B 50%, #0F172A 100%);
  min-height: 100vh; display: flex; align-items: center;
  justify-content: center; padding: 24px; position: relative; overflow: hidden;
}
.auth-body::before {
  content: ''; position: absolute; width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(99,102,241,0.15) 0%, transparent 70%);
  top: -200px; right: -200px; pointer-events: none;
}
.auth-body::after {
  content: ''; position: absolute; width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(139,92,246,0.1) 0%, transparent 70%);
  bottom: -100px; left: -100px; pointer-events: none;
}
.auth-box {
  width: 100%; max-width: 440px; background: #fff;
  border-radius: var(--radius-2xl); box-shadow: 0 25px 60px rgba(0,0,0,0.3);
  overflow: hidden; position: relative; z-index: 1;
}
.auth-header { background: linear-gradient(135deg, var(--primary), var(--purple)); padding: 32px 32px 28px; text-align: center; color: #fff; }
.auth-logo {
  width: 60px; height: 60px; background: rgba(255,255,255,0.15); border-radius: var(--radius-lg);
  display: flex; align-items: center; justify-content: center; font-size: 26px; margin: 0 auto 14px;
  backdrop-filter: blur(10px);
}
.auth-header h1 { font-size: 21px; font-weight: 800; margin-bottom: 4px; }
.auth-header p { font-size: 13px; opacity: 0.8; }
.auth-body-inner { padding: 28px 32px; }
.auth-link { text-align: center; margin-top: 14px; font-size: 13px; color: var(--text-muted); }
.auth-link a { color: var(--primary); font-weight: 600; }

/* ===================== SETUP ===================== */
.setup-body { background: linear-gradient(135deg, #0F172A 0%, #1E293B 100%); min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 32px 24px; }
.setup-card { background: #fff; border-radius: var(--radius-2xl); box-shadow: 0 25px 60px rgba(0,0,0,0.3); width: 100%; max-width: 720px; overflow: hidden; }
.setup-card-header { background: linear-gradient(135deg, var(--primary), var(--purple)); padding: 36px; color: #fff; text-align: center; }
.setup-card-header h1 { font-size: 24px; font-weight: 800; margin-bottom: 8px; }
.setup-card-header p { opacity: 0.8; font-size: 14px; }
.setup-card-body { padding: 32px; }

/* ===================== TOAST ===================== */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.toast {
  background: var(--text); color: #fff; padding: 14px 20px; border-radius: var(--radius);
  box-shadow: var(--shadow-lg); font-size: 13.5px; font-weight: 500;
  min-width: 280px; max-width: 380px; display: flex; align-items: center; gap: 10px;
  pointer-events: auto; animation: toastIn 0.3s ease;
}
.toast.success { background: #065F46; }
.toast.error { background: #991B1B; }
.toast.warning { background: #92400E; }
@keyframes toastIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* ===================== MISC ===================== */
.text-primary { color: var(--primary); }
.text-success { color: var(--success); }
.text-danger { color: var(--danger); }
.text-warning { color: var(--warning); }
.text-muted { color: var(--text-muted); }
.fw-bold { font-weight: 700; }
.fw-800 { font-weight: 800; }
.text-sm { font-size: 12px; }
.text-center { text-align: center; }
.text-right { text-align: right; }
.mt-4 { margin-top: 4px; } .mt-8 { margin-top: 8px; } .mt-12 { margin-top: 12px; }
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.mb-4 { margin-bottom: 4px; } .mb-8 { margin-bottom: 8px; } .mb-12 { margin-bottom: 12px; }
.mb-16 { margin-bottom: 16px; } .mb-20 { margin-bottom: 20px; } .mb-24 { margin-bottom: 24px; }
.d-flex { display: flex; }
.align-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }
.divider { height: 1px; background: var(--border); margin: 18px 0; }
.progress { height: 6px; background: var(--border); border-radius: 20px; overflow: hidden; }
.progress-bar { height: 100%; border-radius: 20px; transition: width 0.5s ease; }
.progress-bar.primary { background: var(--primary); }
.progress-bar.success { background: var(--success); }
.progress-bar.warning { background: var(--warning); }
.progress-bar.danger { background: var(--danger); }
.input-group { display: flex; align-items: stretch; }
.input-group .form-control { border-radius: var(--radius-sm) 0 0 var(--radius-sm); border-right: none; }
.input-group .btn { border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }
.spinner { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,0.3); border-top-color: #fff; border-radius: 50%; animation: spin 0.7s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 20px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-light); }

/* ===================== APARTMENT CARD ===================== */
.apartment-card {
  background: var(--bg-card); border: 1.5px solid var(--border); border-radius: var(--radius-lg);
  padding: 18px; cursor: pointer; transition: all 0.2s; display: flex; gap: 16px; align-items: flex-start;
}
.apartment-card:hover { border-color: var(--primary); box-shadow: var(--shadow-md); transform: translateY(-2px); }
.apartment-card-icon {
  width: 48px; height: 48px; border-radius: var(--radius); flex-shrink: 0;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  display: flex; align-items: center; justify-content: center; font-size: 20px; color: #fff;
}
.apartment-card-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.apartment-card-meta { font-size: 12px; color: var(--text-muted); }
.apartment-card-stats { display: flex; gap: 16px; margin-top: 10px; }
.apartment-card-stat-val { font-size: 18px; font-weight: 800; color: var(--text); }
.apartment-card-stat-lbl { font-size: 11px; color: var(--text-muted); }

/* ===================== RESPONSIVE ===================== */
@media (max-width: 1024px) {
  .sidebar { transform: translateX(-100%); }
  .sidebar.open { transform: translateX(0); box-shadow: var(--shadow-lg); }
  .main { margin-left: 0; }
  .sidebar-toggle { display: flex; }
  .grid-12, .grid-21 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 768px) {
  .content { padding: 16px; }
  .stats-grid { grid-template-columns: 1fr 1fr; }
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: 1fr; }
  .packages-grid { grid-template-columns: 1fr; }
  .selected-unit-grid { grid-template-columns: 1fr; }
  .page-header { flex-direction: column; }
  .header { padding: 0 16px; gap: 10px; }
  .header-search { min-width: 170px; }
  .apartment-selector { min-width: 150px; }
  .units-grid-enhanced { grid-template-columns: 1fr; }
  .units-legend { width: 100%; }
  .legal-ledger-summary { grid-template-columns: 1fr; }
  .legal-ledger-summary div { border-right: 0; border-bottom: 1px solid var(--border); }
  .legal-ledger-summary div:last-child { border-bottom: 0; }
  .app-footer { align-items: flex-start; flex-direction: column; }
  .app-footer-meta { justify-content: flex-start; }
}
@media (max-width: 480px) {
  .stats-grid { grid-template-columns: 1fr; }
}

@media print {
  .sidebar,
  .header,
  .page-actions,
  .stats-grid,
  .legal-ledger-print,
  .legal-ledger-card ~ .card,
  .sidebar-overlay {
    display: none !important;
  }
  .main {
    margin-left: 0 !important;
  }
  .content {
    padding: 0 !important;
  }
  .page-header {
    margin-bottom: 12px;
  }
  .legal-ledger-card {
    box-shadow: none;
    border: 0;
  }
  .legal-ledger-wrap {
    overflow: visible;
  }
  .legal-ledger-table {
    min-width: 0;
    font-size: 10px;
  }
  .legal-ledger-table th,
  .legal-ledger-table td {
    padding: 5px 6px;
  }
}

.sidebar-overlay { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 99; }
.sidebar-overlay.show { display: block; }

/* ===================== CORPORATE THEME OVERRIDES ===================== */
:root {
  --primary: #35516B;
  --primary-dark: #2A4258;
  --primary-light: #DCE6EF;
  --primary-rgb: 53, 81, 107;
  --success: #3E6B54;
  --warning: #87683D;
  --danger: #8A4E4E;
  --info: #3F6278;
  --purple: #4E5672;

  --bg: #E9EEF3;
  --bg-card: #F8FAFC;
  --bg-card2: #F1F5F9;
  --border: #C5D0DB;
  --border-light: #D6DEE7;
  --text: #1B2632;
  --text-secondary: #344454;
  --text-muted: #526171;
  --text-light: #728196;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(16,24,40,0.06);
  --shadow: 0 1px 3px rgba(16,24,40,0.08), 0 10px 24px rgba(16,24,40,0.04);
  --shadow-md: 0 8px 20px rgba(16,24,40,0.08);
}

body {
  font-family: 'IBM Plex Sans', 'Segoe UI', Tahoma, sans-serif;
  font-size: 13.5px;
  letter-spacing: 0.01em;
  background: linear-gradient(180deg, #F1F5F9 0%, #E9EEF3 260px) no-repeat, var(--bg);
}

.sidebar {
  background: linear-gradient(180deg, #2B3440 0%, #232B36 100%);
  border-right: 1px solid #1C2430;
}
.sidebar-header {
  background: linear-gradient(180deg, #313C49, #2B3440);
  border-bottom: 1px solid #3A4654;
}
.brand-icon {
  background: linear-gradient(135deg, #5D7B99, #7E98B0);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.25);
}
.brand-name { font-size: 14px; letter-spacing: 0.02em; color: #F2F6FA; }
.brand-sub { font-size: 10px; text-transform: uppercase; letter-spacing: 0.08em; color: #A8B6C7; }
.sidebar-footer { border-top-color: #3A4654; }
.sidebar-user {
  background: linear-gradient(180deg, #2E3946, #293341);
  border-color: #3E4A58;
}
.sidebar-user-name { color: #EAF0F6; }
.sidebar-user-role { color: #AAB8C7; }
.sidebar-user-logout { color: #C1CCDA; }
.sidebar-user-logout:hover { color: #FFFFFF; }
.nav-section-label { color: #9FB0C2; text-transform: uppercase; letter-spacing: 0.12em; font-size: 10px; }
.nav-item {
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 13px;
  font-weight: 600;
  color: #C3CFDC;
  border-color: transparent;
}
.nav-item:hover {
  transform: none;
  background: #364353;
  border-color: #4A596B;
  color: #F0F5FA;
}
.nav-item.active {
  background: linear-gradient(180deg, #405066, #3A4A5E);
  border-color: #5B6E84;
  box-shadow: inset 3px 0 0 #9FC3E6;
  color: #FFFFFF;
}
.nav-icon {
  border-radius: 8px;
  background: rgba(255,255,255,0.08);
  color: #C4D2E1;
}
.nav-item.active .nav-icon {
  background: rgba(159,195,230,0.22);
  color: #EAF4FF;
}

.header {
  height: 68px;
  background: rgba(244, 248, 252, 0.97);
  backdrop-filter: blur(4px);
  border-bottom: 1px solid #C5D0DB;
}
.breadcrumb { font-size: 12.5px; }
.breadcrumb-current { font-weight: 700; }
.header-search {
  border-color: #BCC9D6;
  min-width: 280px;
  background: #F5F8FB;
}
.header-balance-chip,
.apartment-selector {
  background: #F4F7FA;
  border-color: #C2CFDB;
}

.page-title {
  font-size: 21px;
  letter-spacing: 0.01em;
  font-weight: 700;
}
.page-subtitle {
  color: #667085;
  font-size: 13px;
}

.card {
  border: 1px solid #C7D2DD;
  box-shadow: var(--shadow-sm);
  border-radius: 12px;
  background: #F8FAFC;
}
.card-header {
  padding: 14px 18px;
  background: linear-gradient(180deg, #F9FBFD, #F1F5F9);
  border-bottom: 1px solid #D1DAE4;
}
.card-body { padding: 18px; }

.stat-card {
  border: 1px solid #C7D2DD;
  background: #F6F9FC;
  box-shadow: var(--shadow-sm);
}
.stat-card:hover { transform: none; box-shadow: var(--shadow-sm); }
.stat-value { font-size: 24px; font-weight: 700; color: #0F172A; }
.stat-label { font-size: 11.5px; text-transform: uppercase; letter-spacing: 0.06em; color: #667085; }

.btn {
  border-radius: 8px;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.btn-primary {
  background: linear-gradient(180deg, #476681, #3A576F);
  border-color: #36536A;
  box-shadow: none;
}
.btn-primary:hover { background: #334E64; border-color: #334E64; transform: none; }
.btn-success { background: #476E5A; border-color: #476E5A; }
.btn-danger { background: #8A5353; border-color: #8A5353; }
.btn-outline {
  background: #F3F7FA;
  border-color: #BDC9D5;
  color: #344454;
}
.btn-outline:hover { background: #EAF0F5; }

.form-control, .form-select {
  border: 1px solid #BCC9D6;
  background: #F6F9FC;
  border-radius: 8px;
  font-size: 13px;
}
.form-control:focus, .form-select:focus {
  border-color: #53718A;
  box-shadow: 0 0 0 3px rgba(53,81,107,0.12);
}

table {
  border-collapse: separate;
  border-spacing: 0;
}
th {
  background: #EAF0F5;
  color: #3C4D5E;
  font-size: 12px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-bottom: 1px solid #D6DEE7;
}
td {
  border-bottom: 1px solid #E7EDF4;
  color: #1D2939;
}
tbody tr:hover td { background: #FAFCFF; }
tbody tr:hover td { background: #EEF3F8; }

.badge {
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
}
.badge-muted {
  background: #F2F4F7;
  color: #475467;
  border-color: #D0D5DD;
}

.tabs {
  border-bottom: 1px solid var(--border);
  gap: 8px;
}
.tab-btn {
  border: 1px solid transparent;
  border-radius: 8px 8px 0 0;
  padding: 9px 12px;
  font-weight: 600;
  color: #475467;
}
.tab-btn.active {
  background: #FFFFFF;
  color: #1F4E79;
  border-color: var(--border);
  border-bottom-color: #FFFFFF;
}

.modal {
  border: 1px solid #C9D5E2;
  border-radius: 12px;
  box-shadow: 0 20px 45px rgba(16,24,40,0.18);
}
.modal-header {
  border-bottom: 1px solid var(--border);
  background: #FAFCFF;
}

.app-footer {
  margin-top: 26px;
  padding: 14px 16px;
  border: 1px solid #B9C7D5;
  background: linear-gradient(180deg, #F0F5FA, #E7EEF5);
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 14px;
  align-items: center;
  box-shadow: none;
}
.app-footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.app-footer-icon {
  width: 34px;
  height: 34px;
  border-radius: 0;
  background: linear-gradient(135deg, #4B667F, #3E556B);
  color: #fff;
}
.app-footer-brand strong {
  font-size: 13px;
  letter-spacing: 0.02em;
}
.app-footer-brand span:not(.app-footer-icon) {
  font-size: 11px;
  color: #5C6D7D;
}
.app-footer-center {
  display: flex;
  align-items: center;
}
.app-footer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #334E68;
  border: 1px solid #B8C7D6;
  background: #F6FAFD;
  padding: 6px 10px;
}
.app-footer-meta {
  display: flex;
  align-items: center;
  gap: 8px;
}
.app-footer-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #3F5366;
  border: 1px solid #C4D0DC;
  background: #F8FBFE;
  padding: 5px 8px;
}

@media (max-width: 960px) {
  .app-footer {
    grid-template-columns: 1fr;
    align-items: flex-start;
  }
}

.header-datetime {
  display: grid;
  gap: 1px;
  min-width: 138px;
  padding: 6px 10px;
  border: 1px solid #BCC9D6;
  background: #F2F6FA;
}
.header-datetime-time {
  font-size: 14px;
  font-weight: 700;
  color: #243B53;
  letter-spacing: 0.04em;
  line-height: 1.1;
}
.header-datetime-date {
  font-size: 11px;
  color: #526171;
  line-height: 1.1;
}

/* Apartments view: sharp, accounting-like blocks */
.apartments-view-sharp .stat-card,
.apartments-view-sharp .card,
.apartments-view-sharp .unit-card,
.apartments-view-sharp .btn,
.apartments-view-sharp .form-control,
.apartments-view-sharp .form-select,
.apartments-view-sharp .modal,
.apartments-view-sharp .unit-badge,
.apartments-view-sharp .badge {
  border-radius: 0 !important;
}
.apartments-view-sharp .unit-card {
  box-shadow: none;
  border-width: 1px;
}
.apartments-view-sharp .unit-card:hover {
  transform: none;
  box-shadow: none;
}
