/* ============================================
   EMLAK DEFTERİM - Global Design System CSS
   Azure Estate Design System
   Font: Inter | Primary: #136dec
   ============================================ */

/* --- Google Fonts --- */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200');

/* --- CSS Variables (Design Tokens) --- */
:root {
  --primary: #136dec;
  --primary-dark: #004299;
  --primary-container: #eef2ff;
  --on-primary: #ffffff;
  --on-primary-container: #136dec;
  --secondary: #475569;
  --on-secondary: #ffffff;
  --secondary-container: #f1f5f9;
  --on-secondary-container: #1e293b;
  --tertiary: #f97316;
  --tertiary-container: #fff7ed;
  --surface: #f6f7f8;
  --surface-container: #ffffff;
  --on-surface: #0f172a;
  --on-surface-variant: #475569;
  --background: #f6f7f8;
  --outline: #e2e8f0;
  --outline-variant: #cbd5e1;
  --error: #dc2626;
  --error-container: #fef2f2;
  --on-error-container: #991b1b;
  --emerald: #059669;
  --emerald-bg: #ecfdf5;
  --amber: #d97706;
  --amber-bg: #fffbeb;
  --slate-50: #f8fafc;
  --slate-100: #f1f5f9;
  --slate-200: #e2e8f0;
  --slate-300: #cbd5e1;
  --slate-400: #94a3b8;
  --slate-500: #64748b;
  --slate-600: #475569;
  --slate-700: #334155;
  --slate-800: #1e293b;
  --slate-900: #0f172a;

  /* Layout */
  --sidebar-width: 256px;
  --topbar-height: 64px;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,.05);
  --shadow: 0 1px 3px 0 rgba(0,0,0,.1), 0 1px 2px -1px rgba(0,0,0,.1);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -2px rgba(0,0,0,.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -4px rgba(0,0,0,.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,.1), 0 8px 10px -6px rgba(0,0,0,.1);
  --shadow-primary: 0 10px 15px -3px rgba(19,109,236,.3);
}

/* --- Reset & Base --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; }
body {
  font-family: 'Inter', sans-serif;
  background-color: var(--background);
  color: var(--on-surface);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, select, textarea { font-family: inherit; }
img { max-width: 100%; display: block; }
ul, ol { list-style: none; }

/* --- Material Symbols --- */
.material-symbols-outlined {
  font-family: 'Material Symbols Outlined', sans-serif;
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  font-size: 1.25rem;
  display: inline-block;
  line-height: 1;
  vertical-align: middle;
  user-select: none;
}
.icon-fill { font-variation-settings: 'FILL' 1, 'wght' 400, 'GRAD' 0, 'opsz' 24; }
.icon-sm  { font-size: 1rem; }
.icon-lg  { font-size: 1.5rem; }
.icon-xl  { font-size: 2rem; }

/* ============================================
   LAYOUT SHELL
   ============================================ */
.app-shell {
  display: flex;
  min-height: 100vh;
}

/* --- Sidebar --- */
.sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  position: fixed;
  top: 0; left: 0;
  background: #fff;
  border-right: 1px solid var(--slate-200);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  padding: 1.5rem 1rem;
  z-index: 50;
  overflow-y: auto;
}
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0 0.5rem;
  margin-bottom: 2rem;
  text-decoration: none;
}
.sidebar-brand-icon {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.75rem;
  background: var(--primary);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(19,109,236,.3);
  flex-shrink: 0;
}
.sidebar-brand-name { font-size: 1.125rem; font-weight: 700; color: var(--primary); line-height: 1.2; }
.sidebar-brand-sub  { font-size: 0.625rem; font-weight: 700; color: var(--slate-500); text-transform: uppercase; letter-spacing: .08em; }
.sidebar-nav { flex: 1; display: flex; flex-direction: column; gap: 0.25rem; }
.nav-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.625rem 0.75rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--slate-600);
  transition: background .15s, color .15s;
  border-right: 4px solid transparent;
}
.nav-link:hover { background: var(--slate-50); color: var(--slate-800); }
.nav-link.active {
  background: #eff6ff;
  color: var(--primary);
  border-right-color: var(--primary);
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
}
.sidebar-bottom {
  margin-top: auto;
  padding-top: 1.5rem;
  border-top: 1px solid var(--slate-100);
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}
.nav-link.nav-danger { color: var(--error); }
.nav-link.nav-danger:hover { background: var(--error-container); }

/* --- Topbar --- */
.topbar {
  position: fixed;
  top: 0;
  right: 0;
  width: calc(100% - var(--sidebar-width));
  height: var(--topbar-height);
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--slate-200);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 2rem;
  z-index: 40;
  gap: 1rem;
}
.topbar-search {
  position: relative;
  flex: 1;
  max-width: 28rem;
}
.topbar-search .material-symbols-outlined {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
}
.topbar-search input {
  width: 100%;
  padding: 0.5rem 1rem 0.5rem 2.5rem;
  background: var(--slate-100);
  border: none;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  outline: none;
  transition: box-shadow .15s;
}
.topbar-search input:focus { box-shadow: 0 0 0 3px rgba(19,109,236,.15); background: #fff; }
.topbar-actions { display: flex; align-items: center; gap: 0.5rem; }
.topbar-icon-btn {
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--slate-500);
  position: relative;
  transition: background .15s, color .15s;
}
.topbar-icon-btn:hover { background: var(--slate-100); color: var(--primary); }
.notif-dot {
  position: absolute;
  top: 0.5rem; right: 0.5rem;
  width: 0.5rem; height: 0.5rem;
  background: var(--error);
  border-radius: 50%;
  border: 2px solid #fff;
}
.topbar-divider { width: 1px; height: 2rem; background: var(--slate-200); margin: 0 0.5rem; }
.topbar-user { display: flex; align-items: center; gap: 0.75rem; cursor: pointer; }
.topbar-user-info { text-align: right; }
.topbar-user-name { font-size: 0.75rem; font-weight: 700; color: var(--on-surface); }
.topbar-user-role { font-size: 0.625rem; color: var(--slate-500); }
.topbar-avatar {
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--slate-100);
}

/* --- Main Content --- */
.main-content {
  margin-left: var(--sidebar-width);
  padding-top: var(--topbar-height);
  min-height: 100vh;
}
.page-body {
  padding: 2rem;
}

/* ============================================
   COMPONENTS
   ============================================ */

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.625rem 1.25rem;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 600;
  transition: all .15s;
  cursor: pointer;
  border: none;
  white-space: nowrap;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary);
  color: #fff;
  box-shadow: var(--shadow-primary);
}
.btn-primary:hover { background: var(--primary-dark); box-shadow: 0 12px 20px rgba(19,109,236,.35); }
.btn-outline {
  background: #fff;
  color: var(--on-surface);
  border: 1.5px solid var(--outline);
}
.btn-outline:hover { background: var(--slate-50); }
.btn-ghost { background: transparent; color: var(--on-surface); }
.btn-ghost:hover { background: var(--slate-100); }
.btn-danger { background: var(--error-container); color: var(--error); }
.btn-danger:hover { background: #fecaca; }
.btn-sm { padding: 0.375rem 0.75rem; font-size: 0.75rem; }
.btn-lg { padding: 0.875rem 1.75rem; font-size: 1rem; font-weight: 700; }
.btn-icon { padding: 0.5rem; border-radius: 0.5rem; }
.btn-icon:hover { background: var(--slate-100); }
.btn-icon-primary:hover { background: rgba(19,109,236,.08); color: var(--primary); }
.btn-icon-danger:hover { background: var(--error-container); color: var(--error); }
.btn-block { width: 100%; justify-content: center; }

/* --- Cards --- */
.card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-100);
  overflow: hidden;
}
.card-body { padding: 1.5rem; }
.card-header {
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--slate-100);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-header h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--on-surface);
  display: flex; align-items: center; gap: 0.5rem;
}
.card-footer {
  padding: 1rem 1.5rem;
  background: rgba(248,250,252,.5);
  border-top: 1px solid var(--slate-100);
}

/* Stat Cards */
.stat-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid transparent;
  padding: 1.25rem;
  transition: border-color .15s;
}
.stat-card:hover { border-color: rgba(19,109,236,.2); }
.stat-card-icon {
  width: 2.5rem; height: 2.5rem;
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 1rem;
}
.stat-card-value { font-size: 1.5rem; font-weight: 800; color: var(--on-surface); }
.stat-card-label { font-size: 0.625rem; font-weight: 700; color: var(--slate-500); text-transform: uppercase; letter-spacing: .06em; margin-top: 0.125rem; }
.stat-card-badge {
  font-size: 0.625rem; font-weight: 700;
  padding: 0.25rem 0.5rem;
  border-radius: 9999px;
  margin-left: auto;
}
.stat-card-top { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 1rem; }

/* --- Status Badges --- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.625rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.badge-dot { width: 0.375rem; height: 0.375rem; border-radius: 50%; }
.badge-green { background: var(--emerald-bg); color: var(--emerald); border: 1px solid #a7f3d0; }
.badge-green .badge-dot { background: var(--emerald); }
.badge-red   { background: var(--error-container); color: var(--error); border: 1px solid #fecaca; }
.badge-red .badge-dot   { background: var(--error); }
.badge-amber { background: var(--amber-bg); color: var(--amber); border: 1px solid #fde68a; }
.badge-amber .badge-dot { background: var(--amber); }
.badge-gray  { background: var(--slate-100); color: var(--slate-600); border: 1px solid var(--slate-200); }
.badge-gray .badge-dot  { background: var(--slate-400); }
.badge-blue  { background: #eff6ff; color: var(--primary); border: 1px solid #bfdbfe; }
.badge-blue .badge-dot  { background: var(--primary); }

/* --- Tables --- */
.data-table-wrap { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; text-align: left; }
.data-table thead tr { background: rgba(248,250,252,.5); border-bottom: 1px solid var(--slate-100); }
.data-table thead th {
  padding: 0.75rem 1.5rem;
  font-size: 0.6875rem;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: .06em;
  white-space: nowrap;
}
.data-table tbody tr { border-bottom: 1px solid var(--slate-50); transition: background .1s; }
.data-table tbody tr:hover { background: rgba(239,246,255,.35); }
.data-table td { padding: 1rem 1.5rem; font-size: 0.875rem; vertical-align: middle; }
.data-table .col-right { text-align: right; }
.data-table .actions { display: flex; align-items: center; gap: 0.25rem; justify-content: flex-end; }
.data-table .actions .btn-icon { color: var(--slate-400); }

/* --- Forms --- */
.form-group { margin-bottom: 1.25rem; }
.form-label {
  display: block;
  font-size: 0.625rem;
  font-weight: 700;
  color: var(--slate-400);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 0.375rem;
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--slate-50);
  border: 1.5px solid transparent;
  border-radius: 0.75rem;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--on-surface);
  outline: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
  font-family: inherit;
}
.form-control:focus {
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(19,109,236,.1);
}
.form-control::placeholder { color: var(--slate-400); font-weight: 400; }
.form-control-icon { position: relative; }
.form-control-icon .material-symbols-outlined {
  position: absolute;
  left: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--slate-400);
  pointer-events: none;
}
.form-control-icon input { padding-left: 2.75rem; }
.form-control-icon .icon-right {
  position: absolute;
  right: 0.875rem;
  top: 50%;
  transform: translateY(-50%);
  pointer-events: all;
  cursor: pointer;
}
select.form-control { cursor: pointer; }
textarea.form-control { resize: vertical; min-height: 6rem; }
.form-error { font-size: 0.75rem; color: var(--error); margin-top: 0.25rem; }
.form-hint  { font-size: 0.75rem; color: var(--slate-400); margin-top: 0.25rem; }
.form-check { display: flex; align-items: center; gap: 0.5rem; }
.form-check input[type="checkbox"],
.form-check input[type="radio"] {
  width: 1.125rem; height: 1.125rem;
  accent-color: var(--primary);
  cursor: pointer;
}
.form-check label { font-size: 0.875rem; color: var(--on-surface-variant); cursor: pointer; }

/* Radio group */
.radio-group { display: flex; gap: 0.75rem; flex-wrap: wrap; }
.radio-card {
  flex: 1;
  min-width: 120px;
  padding: 0.75rem 1rem;
  border: 2px solid var(--outline);
  border-radius: 0.75rem;
  display: flex; align-items: center; gap: 0.5rem;
  cursor: pointer; transition: border-color .15s, background .15s;
  font-size: 0.875rem; font-weight: 500;
}
.radio-card:has(input:checked) { border-color: var(--primary); background: var(--primary-container); color: var(--primary); }
.radio-card input { accent-color: var(--primary); }

/* --- Section headers --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  gap: 1rem;
}
.page-title { font-size: 1.75rem; font-weight: 800; color: var(--on-surface); letter-spacing: -.02em; }
.page-subtitle { font-size: 0.875rem; color: var(--slate-500); margin-top: 0.25rem; }
.section-title {
  font-size: 1rem; font-weight: 700; color: var(--on-surface);
  display: flex; align-items: center; gap: 0.5rem;
}
.section-title .material-symbols-outlined { color: var(--primary); }

/* --- Grid helpers --- */
.grid   { display: grid; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-6 { display: grid; grid-template-columns: repeat(6, 1fr); gap: 1.5rem; }
.grid-12 { display: grid; grid-template-columns: repeat(12, 1fr); gap: 1.5rem; }
.col-4  { grid-column: span 4; }
.col-5  { grid-column: span 5; }
.col-6  { grid-column: span 6; }
.col-7  { grid-column: span 7; }
.col-8  { grid-column: span 8; }
.col-12 { grid-column: span 12; }
.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-start  { display: flex; align-items: flex-start; }
.items-center { align-items: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.flex-1 { flex: 1; }
.flex-wrap { flex-wrap: wrap; }
.mt-2 { margin-top: 0.5rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.pt-4 { padding-top: 1rem; }
.pt-6 { padding-top: 1.5rem; }
.p-5  { padding: 1.25rem; }
.p-6  { padding: 1.5rem; }
.text-right { text-align: right; }
.text-center { text-align: center; }
.w-full { width: 100%; }

/* --- Pagination --- */
.pagination { display: flex; align-items: center; gap: 0.25rem; }
.page-btn {
  width: 2rem; height: 2rem;
  display: flex; align-items: center; justify-content: center;
  border-radius: 0.5rem;
  font-size: 0.75rem; font-weight: 600;
  color: var(--slate-600);
  border: 1px solid transparent;
  transition: all .15s; cursor: pointer;
}
.page-btn:hover { background: #fff; border-color: var(--slate-200); }
.page-btn.active { background: var(--primary); color: #fff; box-shadow: var(--shadow-sm); }
.page-btn.icon { color: var(--slate-400); border: 1px solid var(--slate-200); }
.page-btn.icon:hover { background: #fff; }
.page-dots { color: var(--slate-400); padding: 0 0.25rem; font-size: 0.75rem; }
.pagination-info { font-size: 0.75rem; color: var(--slate-500); }

/* --- Filter bar --- */
.filter-bar {
  background: #fff;
  padding: 1rem 1.25rem;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--slate-100);
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 1rem;
  margin-bottom: 1.5rem;
}
.filter-field { display: flex; flex-direction: column; min-width: 140px; flex: 1; }
.filter-field label { font-size: 0.625rem; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: .07em; margin-bottom: 0.375rem; }
.filter-field select {
  padding: 0.5rem 0.75rem;
  background: var(--slate-50);
  border: 1px solid var(--slate-100);
  border-radius: 0.5rem;
  font-size: 0.875rem; font-weight: 500;
  color: var(--on-surface);
  outline: none; cursor: pointer;
  font-family: inherit;
}
.filter-divider { width: 1px; height: 2.5rem; background: var(--slate-100); align-self: flex-end; }

/* --- Breadcrumb --- */
.breadcrumb { display: flex; align-items: center; gap: 0.375rem; font-size: 0.75rem; color: var(--slate-400); margin-bottom: 0.375rem; }
.breadcrumb a { color: var(--slate-400); transition: color .15s; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .current { color: var(--slate-600); font-weight: 500; }

/* --- Modals --- */
.modal-overlay {
  display: none;
  position: fixed; inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }
.modal {
  background: #fff;
  border-radius: 1rem;
  width: 100%;
  max-width: 36rem;
  box-shadow: var(--shadow-xl);
  animation: modalIn .2s ease;
  overflow: hidden;
}
.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--slate-100);
  display: flex; align-items: center; justify-content: space-between;
}
.modal-header h2 { font-size: 1.125rem; font-weight: 700; color: var(--on-surface); }
.modal-body { padding: 1.5rem; }
.modal-footer {
  padding: 1rem 1.5rem;
  border-top: 1px solid var(--slate-100);
  display: flex; justify-content: flex-end; gap: 0.75rem;
  background: var(--slate-50);
}
@keyframes modalIn {
  from { opacity: 0; transform: scale(.95) translateY(-8px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.modal-lg { max-width: 48rem; }

/* --- Toast --- */
.toast-container {
  position: fixed;
  top: 1.25rem;
  right: 1.25rem;
  z-index: 200;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-radius: 0.75rem;
  background: var(--slate-800);
  color: #fff;
  font-size: 0.875rem;
  font-weight: 500;
  box-shadow: var(--shadow-xl);
  animation: toastIn .25s ease;
  min-width: 280px;
}
.toast-success { background: var(--emerald); }
.toast-error   { background: var(--error); }
.toast-info    { background: var(--primary); }
@keyframes toastIn {
  from { opacity: 0; transform: translateX(1rem); }
  to   { opacity: 1; transform: translateX(0); }
}

/* --- Avatar --- */
.avatar {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  object-fit: cover;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
  flex-shrink: 0;
}
.avatar-sm { width: 1.75rem; height: 1.75rem; font-size: .5625rem; }
.avatar-md { width: 2.5rem; height: 2.5rem; }
.avatar-lg { width: 4rem;   height: 4rem;   font-size: 1rem; }
.avatar-xl { width: 5rem;   height: 5rem;   font-size: 1.25rem; }
.avatar-blue    { background: #3b82f6; }
.avatar-green   { background: var(--emerald); }
.avatar-orange  { background: var(--tertiary); }
.avatar-purple  { background: #8b5cf6; }
.avatar-primary { background: var(--primary); }

/* --- Tab buttons --- */
.tab-group { display: flex; border: 1px solid var(--slate-200); border-radius: 0.5rem; overflow: hidden; background: #fff; }
.tab-btn {
  padding: 0.4375rem 0.875rem;
  font-size: 0.75rem; font-weight: 700;
  color: var(--slate-500);
  transition: background .15s, color .15s; cursor: pointer;
  border: none; background: transparent; font-family: inherit;
}
.tab-btn:hover { background: var(--slate-50); }
.tab-btn.active { background: var(--slate-100); color: var(--slate-900); }

/* --- Progress bar --- */
.progress-bar { width: 100%; height: 0.375rem; background: rgba(255,255,255,.4); border-radius: 9999px; overflow: hidden; }
.progress-bar-fill { height: 100%; border-radius: 9999px; background: currentColor; transition: width .5s; }
.progress-bar-bg { background: var(--slate-100); }
.progress-bar-bg .progress-bar-fill { background: var(--primary); }
.progress-bar-green .progress-bar-fill { background: var(--emerald); }

/* --- Image upload area --- */
.upload-area {
  border: 2px dashed var(--slate-300);
  border-radius: 0.75rem;
  padding: 2.5rem;
  text-align: center;
  color: var(--slate-400);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  background: var(--slate-50);
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-container); color: var(--primary); }
.upload-area .material-symbols-outlined { font-size: 2.5rem; margin-bottom: 0.5rem; }

/* --- Info rows --- */
.info-row { display: flex; justify-content: space-between; align-items: center; padding: 0.625rem 0; border-bottom: 1px solid var(--slate-100); font-size: 0.875rem; }
.info-row:last-child { border-bottom: none; }
.info-label { color: var(--slate-400); font-weight: 500; }
.info-value { color: var(--on-surface); font-weight: 600; }

/* --- Divider --- */
.divider { width: 100%; height: 1px; background: var(--slate-100); margin: 1.5rem 0; }
.divider-label {
  display: flex; align-items: center; gap: 1rem; margin: 1.5rem 0;
  font-size: 0.75rem; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: .06em;
}
.divider-label::before, .divider-label::after { content: ''; flex: 1; height: 1px; background: var(--outline); }

/* --- Misc --- */
.text-primary { color: var(--primary); }
.text-secondary { color: var(--secondary); }
.text-error { color: var(--error); }
.text-emerald { color: var(--emerald); }
.text-amber { color: var(--amber); }
.text-muted { color: var(--slate-400); }
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-extrabold { font-weight: 800; }
.text-xs  { font-size: 0.75rem; }
.text-sm  { font-size: 0.875rem; }
.text-lg  { font-size: 1.125rem; }
.text-xl  { font-size: 1.25rem; }
.text-2xl { font-size: 1.5rem; }
.text-3xl { font-size: 1.875rem; }
.rounded-xl { border-radius: 0.75rem; }
.rounded-full { border-radius: 9999px; }
.bg-primary    { background: var(--primary); }
.bg-white      { background: #fff; }
.bg-surface    { background: var(--surface); }
.shadow-sm     { box-shadow: var(--shadow-sm); }
.shadow-lg     { box-shadow: var(--shadow-lg); }
.border        { border: 1px solid var(--outline); }
.overflow-hidden { overflow: hidden; }
.truncate      { overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.space-y > * + * { margin-top: 0.75rem; }
.visually-hidden { display: none !important; }

/* --- Notification panel items --- */
.notif-item {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  border-bottom: 1px solid #f1f5f9;
  cursor: pointer;
  transition: background .1s;
}
.notif-item:last-child { border-bottom: none; }
.notif-item:hover { background: #f8fafc; }
.notif-unread { background: #eff6ff; }
.notif-unread:hover { background: #dbeafe; }
.notif-icon {
  width: 2rem; height: 2rem;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  margin-top: 0.125rem;
}
.notif-title { font-size: 0.8125rem; font-weight: 500; color: #0f172a; line-height: 1.4; }
.notif-time  { font-size: 0.6875rem; color: #94a3b8; margin-top: 0.125rem; }

/* Insight card (mini stat) */
.insight-card {
  border-radius: 0.75rem;
  padding: 1.25rem;
  border: 1px solid;
}
.insight-card-blue   { background: rgba(239,246,255,.6); border-color: rgba(19,109,236,.15); }
.insight-card-green  { background: var(--emerald-bg); border-color: #a7f3d0; }
.insight-card-orange { background: var(--amber-bg); border-color: #fde68a; }

/* Gallery */
.gallery-grid { display: grid; grid-template-columns: 3fr 1fr; gap: 0.75rem; height: 20rem; }
.gallery-main { border-radius: 0.5rem; overflow: hidden; position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s; }
.gallery-main:hover img { transform: scale(1.04); }
.gallery-side { display: grid; grid-rows: 1fr 1fr; grid-template-rows: 1fr 1fr; gap: 0.75rem; }
.gallery-thumb { border-radius: 0.5rem; overflow: hidden; position: relative; }
.gallery-thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery-more-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  color: #fff; font-weight: 700; font-size: 0.875rem; cursor: pointer;
}

/* Map placeholder */
.map-placeholder {
  height: 10rem;
  border-radius: 0.5rem;
  overflow: hidden;
  background: var(--slate-100);
  position: relative;
}
.map-placeholder img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(1) opacity(.7); }
.map-pin {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 2rem; height: 2rem;
  background: var(--primary);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  box-shadow: 0 0 0 4px rgba(19,109,236,.2), 0 4px 12px rgba(19,109,236,.4);
}
.map-pin .material-symbols-outlined { font-size: 1rem; font-variation-settings: 'FILL' 1; }

/* Credit score bar */
.credit-row { display: flex; justify-content: space-between; align-items: center; margin-bottom: 0.375rem; }
.credit-label { font-size: 0.75rem; color: var(--slate-400); font-weight: 500; }
.credit-value { font-size: 0.75rem; font-weight: 700; color: var(--emerald); }

/* Sidebar New Record button */
.sidebar-cta {
  width: 100%;
  background: var(--primary);
  color: #fff;
  font-weight: 600;
  font-size: 0.875rem;
  padding: 0.625rem 1rem;
  border-radius: 0.75rem;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  box-shadow: 0 4px 12px rgba(19,109,236,.25);
  cursor: pointer; border: none; font-family: inherit;
  transition: background .15s, box-shadow .15s;
  margin-bottom: 0.75rem;
}
.sidebar-cta:hover { background: var(--primary-dark); box-shadow: 0 6px 16px rgba(19,109,236,.35); }

/* Table row thumbnail */
.tbl-thumb { width: 3rem; height: 3rem; border-radius: 0.5rem; object-fit: cover; background: var(--slate-100); }
.tbl-name  { font-weight: 700; color: var(--on-surface); margin-bottom: 0.125rem; font-size: 0.875rem; }
.tbl-sub   { font-size: 0.75rem; color: var(--slate-500); }
.tbl-cell-flex { display: flex; align-items: center; gap: 0.75rem; }

/* Section form card */
.form-section {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--outline);
  padding: 2rem;
  margin-bottom: 1.5rem;
}
.form-section-title {
  display: flex; align-items: center; gap: 0.5rem;
  font-size: 1rem; font-weight: 700; color: var(--on-surface);
  margin-bottom: 1.5rem;
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--slate-100);
}
.form-section-title .material-symbols-outlined { color: var(--primary); }

/* 2-col form grid */
.form-grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1.25rem; }
.form-col-full { grid-column: 1 / -1; }

/* Floating action summary card */
.summary-card {
  background: #fff;
  border-radius: 0.75rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--outline);
  padding: 1.5rem;
  position: sticky;
  top: calc(var(--topbar-height) + 1.5rem);
}
.summary-card-title { font-size: 0.75rem; font-weight: 700; color: var(--slate-400); text-transform: uppercase; letter-spacing: .06em; margin-bottom: 1rem; }
.summary-row { display: flex; justify-content: space-between; font-size: 0.875rem; margin-bottom: 0.625rem; }
.summary-row .label { color: var(--slate-500); }
.summary-row .value { font-weight: 600; color: var(--on-surface); }

/* Footer */
.page-footer { text-align: center; color: var(--slate-400); font-size: 0.75rem; font-weight: 500; padding: 2.5rem 0 1.5rem; }

/* ============================================
   LOGIN PAGE SPECIFIC
   ============================================ */
.auth-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: var(--background);
  position: relative;
}
.auth-bg-blob-1 {
  position: fixed; top: -10%; right: -5%;
  width: 31rem; height: 31rem;
  background: rgba(19,109,236,.05);
  border-radius: 50%;
  filter: blur(3rem);
  pointer-events: none;
}
.auth-bg-blob-2 {
  position: fixed; bottom: -10%; left: -5%;
  width: 37rem; height: 37rem;
  background: rgba(249,115,22,.05);
  border-radius: 50%;
  filter: blur(3rem);
  pointer-events: none;
}
.auth-card {
  width: 100%; max-width: 75rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  background: #fff;
  border-radius: 1rem;
  box-shadow: var(--shadow-xl);
  overflow: hidden;
  min-height: 44rem;
  position: relative;
  z-index: 1;
}
.auth-brand {
  background: var(--primary);
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  overflow: hidden;
}
.auth-brand-deco-1 {
  position: absolute; top: -10%; right: -10%;
  width: 25rem; height: 25rem;
  border-radius: 50%;
  border: 40px solid rgba(255,255,255,.1);
  pointer-events: none;
}
.auth-brand-deco-2 {
  position: absolute; bottom: -20%; left: -10%;
  width: 37rem; height: 37rem;
  border-radius: 50%;
  border: 80px solid rgba(255,255,255,.05);
  pointer-events: none;
}
.auth-brand-logo { display: flex; align-items: center; gap: 0.75rem; position: relative; z-index: 1; }
.auth-brand-logo-icon {
  width: 2.5rem; height: 2.5rem;
  background: #fff;
  border-radius: 0.5rem;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-lg);
}
.auth-brand-logo-icon .material-symbols-outlined { color: var(--primary); font-size: 1.5rem; font-variation-settings: 'FILL' 1; }
.auth-brand-logo h1 { color: #fff; font-size: 1.375rem; font-weight: 800; }
.auth-brand-content { position: relative; z-index: 1; margin-bottom: 3rem; }
.auth-brand-content h2 { color: #fff; font-size: 2.25rem; font-weight: 700; line-height: 1.2; margin-bottom: 1.25rem; }
.auth-brand-content p  { color: rgba(255,255,255,.75); font-size: 1rem; line-height: 1.6; max-width: 26rem; }
.auth-stats { display: flex; gap: 2rem; margin-top: 3rem; }
.auth-stat span:first-child { color: #fff; font-size: 1.375rem; font-weight: 700; display: block; }
.auth-stat span:last-child  { color: rgba(255,255,255,.5); font-size: 0.625rem; font-weight: 700; text-transform: uppercase; letter-spacing: .07em; }
.auth-testimonial {
  position: relative; z-index: 1;
  display: flex; gap: 1rem; align-items: center;
  padding: 1.25rem;
  background: rgba(255,255,255,.06);
  backdrop-filter: blur(8px);
  border-radius: 0.75rem;
  border: 1px solid rgba(255,255,255,.1);
}
.auth-testimonial img { width: 3rem; height: 3rem; border-radius: 50%; object-fit: cover; border: 2px solid rgba(255,255,255,.2); flex-shrink: 0; }
.auth-testimonial p  { color: #fff; font-size: 0.875rem; font-style: italic; line-height: 1.5; }
.auth-testimonial small { color: rgba(255,255,255,.6); font-size: 0.75rem; }
.auth-form-side {
  padding: 3rem 4rem;
  background: #fff;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.auth-form-inner { max-width: 26rem; width: 100%; margin: 0 auto; }
.auth-form-title { font-size: 1.5rem; font-weight: 700; color: var(--on-surface); margin-bottom: 0.375rem; }
.auth-form-sub   { font-size: 0.875rem; color: var(--on-surface-variant); margin-bottom: 2.25rem; }
.auth-login-btn {
  width: 100%;
  padding: 1rem;
  background: var(--primary);
  color: #fff;
  border: none; border-radius: 0.75rem;
  font-size: 0.9375rem; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 0.5rem;
  box-shadow: 0 8px 20px rgba(19,109,236,.3);
  cursor: pointer; transition: all .15s; font-family: inherit;
  margin-top: 1.5rem;
}
.auth-login-btn:hover { background: var(--primary-dark); box-shadow: 0 10px 24px rgba(19,109,236,.38); transform: translateY(-1px); }
.auth-login-btn:active { transform: scale(.98); }
.auth-social { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.auth-social-btn {
  display: flex; align-items: center; justify-content: center; gap: 0.625rem;
  padding: 0.75rem;
  border: 1.5px solid var(--outline);
  border-radius: 0.75rem;
  font-size: 0.875rem; font-weight: 600;
  color: var(--on-surface);
  background: #fff; cursor: pointer; transition: background .15s; font-family: inherit;
}
.auth-social-btn:hover { background: var(--slate-50); }
.auth-footer-links {
  display: flex; flex-wrap: wrap; justify-content: center; gap: 1.25rem;
  font-size: 0.625rem; font-weight: 700;
  color: var(--slate-400); text-transform: uppercase; letter-spacing: .07em;
  margin-top: 2rem;
}
.auth-footer-links a { transition: color .15s; }
.auth-footer-links a:hover { color: var(--primary); }
.password-field { position: relative; }
.password-toggle {
  position: absolute; right: 0.875rem; top: 50%; transform: translateY(-50%);
  color: var(--slate-400); cursor: pointer; background: none; border: none; padding: 0;
  transition: color .15s;
}
.password-toggle:hover { color: var(--primary); }
.auth-error-box {
  background: var(--error-container);
  color: var(--error);
  border-radius: 0.75rem;
  padding: 0.75rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 1rem;
  display: flex; align-items: center; gap: 0.5rem;
}
.auth-error-box.hidden { display: none; }

/* Inline link */
.link { color: var(--primary); font-weight: 700; cursor: pointer; }
.link:hover { text-decoration: underline; }

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

/* --- Sidebar overlay (mobile) --- */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(15,23,42,.5);
  z-index: 45;
  backdrop-filter: blur(2px);
}
.sidebar-overlay.open { display: block; }
body.sidebar-open { overflow: hidden; }

/* --- Mobile hamburger button --- */
.mobile-menu-btn {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  align-items: center;
  justify-content: center;
  border-radius: 0.5rem;
  color: var(--slate-600);
  transition: background .15s, color .15s;
  flex-shrink: 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
}
.mobile-menu-btn:hover { background: var(--slate-100); color: var(--primary); }

/* ---- Tablet (≤ 1024px) ---- */
@media (max-width: 1024px) {
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .auth-form-side { padding: 3rem 2.5rem; }
  .auth-brand-content h2 { font-size: 1.875rem; }
}

/* ---- Mobile (≤ 768px) ---- */
@media (max-width: 768px) {
  /* Sidebar — slides in from left */
  .sidebar {
    transform: translateX(-100%);
    transition: transform .25s ease;
    z-index: 50;
    box-shadow: var(--shadow-xl);
  }
  .sidebar.open { transform: translateX(0); }

  /* Topbar — full width */
  .topbar {
    left: 0;
    width: 100%;
    padding: 0 1rem;
  }
  .topbar-search { display: none; }
  .mobile-menu-btn { display: flex; }

  /* Main Content — no sidebar offset */
  .main-content { margin-left: 0; }

  /* Page Body — tighter padding */
  .page-body { padding: 1.25rem 1rem; }

  /* Section header — stack vertically */
  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.875rem;
  }
  .section-header .flex,
  .section-header > a,
  .section-header > div:last-child { width: 100%; }
  .section-header .flex { flex-wrap: wrap; }
  .section-header .btn { flex: 1; justify-content: center; }

  /* Page title — smaller on mobile */
  .page-title { font-size: 1.375rem; }

  /* Grids — collapse to single column */
  .grid-2, .grid-3, .grid-4, .grid-6 { grid-template-columns: 1fr; }
  .grid-12 { grid-template-columns: repeat(4, 1fr); }
  .col-4, .col-5, .col-6, .col-7, .col-8 { grid-column: 1 / -1; }

  /* Form grids */
  .form-grid-2, .form-grid-3 { grid-template-columns: 1fr; }

  /* Auth card — single column, hide brand */
  .auth-card {
    grid-template-columns: 1fr;
    min-height: auto;
  }
  .auth-brand { display: none; }
  .auth-form-side { padding: 2.5rem 1.75rem; }

  /* Gallery */
  .gallery-grid { grid-template-columns: 1fr; height: auto; }
  .gallery-main { height: 14rem; }
  .gallery-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; height: 7rem; }

  /* Summary card — de-sticky on mobile */
  .summary-card { position: static; top: auto; }

  /* Filter bar */
  .filter-field { min-width: 100%; }
  .filter-divider { display: none; }

  /* Card header */
  .card-header { flex-direction: column; align-items: flex-start; gap: 0.75rem; }

  /* Topbar user — hide text on mobile */
  .topbar-user-info { display: none; }
  .topbar-divider { display: none; }

  /* Toast — full width on mobile */
  .toast-container { left: 1rem; right: 1rem; top: 5rem; }
  .toast { min-width: auto; width: 100%; }
}

/* ---- Small Mobile (≤ 480px) ---- */
@media (max-width: 480px) {
  .page-body { padding: 1rem 0.75rem; }
  .auth-form-side { padding: 2rem 1.25rem; }
  .form-section { padding: 1.25rem; }
  .btn { padding: 0.5rem 1rem; font-size: 0.8125rem; }
  .page-footer { padding: 1.5rem 0 1rem; font-size: 0.6875rem; }
  .grid-12 { grid-template-columns: repeat(2, 1fr); }
  .section-header .btn { font-size: 0.8125rem; padding: 0.5rem 0.75rem; }
}
