/* ===========================
   STUDIOLINK CRM - STYLESHEET
   =========================== */

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

:root {
  /* Palette: #20323F · #13678A · #93C2D7 · #E8F6FD */
  --primary-700: #20323F;
  --primary-600: #1a4a63;
  --primary-500: #13678A;
  --primary-400: #93C2D7;
  --primary-300: #E8F6FD;
  --neutral-500: #828282;
  --neutral-400: #ABA9B6;
  --neutral-300: #E0E0E0;
  --bg-color: #ECEEF0;
  --white: #FFF;
  --black: #333;
  --lines: #DCDFE2;
  --success: #6DBC9B;
  --warning: #FE9B0E;
  --violet: #7000F9;
  --green: #219653;
  --sidebar-width: 212px;
  --shadow: 0 2px 12px 0 rgba(30, 34, 67, 0.06);
  --radius-card: 16px;
  --radius-btn: 999px;
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Satoshi', -apple-system, Roboto, Helvetica, sans-serif;
  background: var(--bg-color);
  color: var(--black);
  min-height: 100vh;
  overflow: hidden;
}

.hidden { display: none !important; }

/* ===========================
   LOGIN PAGE
   =========================== */
.login-page {
  width: 100vw;
  height: 100vh;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.login-bg-circle {
  position: absolute;
  width: 1120px;
  height: 1120px;
  border-radius: 50%;
  left: 145px;
  top: 202px;
  background: radial-gradient(circle, rgba(18,60,78,0.15) 0%, transparent 60%);
  pointer-events: none;
}

.login-card {
  position: relative;
  width: 454px;
  padding: 40px 20px;
  background: #fff;
  border-radius: 24px;
  box-shadow: 0 4px 14px 0 rgba(33,32,41,0.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
}

.login-logo {
  width: 240px;
  height: 32px;
}

.login-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
  width: 100%;
}

.login-input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.login-input {
  width: 100%;
  padding: 12px 16px;
  border: 1.264px solid var(--lines);
  border-radius: 12px;
  font-family: inherit;
  font-size: 16px;
  color: var(--black);
  outline: none;
  transition: border-color 0.2s;
}

.login-input:focus {
  border-color: var(--primary-500);
}

.login-input::placeholder {
  color: var(--neutral-500);
}

.login-eye-icon {
  position: absolute;
  right: 16px;
  width: 16px;
  height: 16px;
  cursor: pointer;
}

.login-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
}

.btn-login {
  width: 100%;
  height: 48px;
  background: var(--primary-700);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-login:hover { background: var(--primary-600); }

.forgot-password {
  color: var(--primary-700);
  font-size: 16px;
  font-weight: 500;
  text-decoration: underline;
}

/* ===========================
   APP SHELL
   =========================== */
.app-shell {
  display: flex;
  height: 100vh;
  background: var(--bg-color);
  padding: 20px 16px 0 16px;
  gap: 16px;
}

/* ===========================
   SIDEBAR
   =========================== */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  height: calc(100vh - 40px);
  background: var(--white);
  border-radius: var(--radius-card);
  border-right: 1px solid var(--neutral-300);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  padding: 20px 16px;
  gap: 24px;
  overflow-y: auto;
  flex-shrink: 0;
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sidebar-logo-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.sidebar-close-btn {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  color: var(--neutral-500);
  border-radius: 8px;
  transition: background 0.15s;
}

.sidebar-close-btn:hover { background: var(--bg-color); }
.sidebar-close-btn svg { width: 18px; height: 18px; }

.sidebar-logo {
  width: 162px;
  height: 22px;
}

.search-bar {
  display: flex;
  height: 36px;
  padding: 4px 4px 4px 12px;
  justify-content: space-between;
  align-items: center;
  border-radius: 400px;
  border: 1px solid var(--lines);
  background: var(--white);
}

.search-placeholder {
  color: var(--neutral-500);
  font-size: 14px;
  font-weight: 500;
}

.search-btn {
  width: 28px;
  height: 28px;
  background: var(--primary-700);
  border: none;
  border-radius: 87.5px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.search-btn svg { width: 14px; height: 14px; }

.sidebar-nav {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}

.nav-section-label {
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  padding: 0 8px;
  margin-bottom: 4px;
}

.nav-items {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.nav-item {
  display: flex;
  padding: 6px 8px;
  align-items: center;
  gap: 8px;
  border-radius: 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--neutral-500);
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
  font-family: 'Visby CF', 'Satoshi', sans-serif;
}

.nav-item svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: currentColor;
}

.nav-item:hover {
  background: var(--primary-300);
  color: var(--primary-500);
}

.nav-item.active {
  background: var(--primary-300);
  color: var(--primary-500);
  font-weight: 600;
}

.sidebar-bottom {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--lines);
}

.sidebar-section-label {
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 1.2px;
  text-transform: uppercase;
}

.sidebar-settings-icons {
  display: flex;
  align-items: center;
  gap: 8px;
}

.settings-icon-btn {
  width: 32px;
  height: 32px;
  background: none;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background 0.15s;
}

.settings-icon-btn:hover { background: var(--bg-color); }
.settings-icon-btn svg { width: 16px; height: 16px; }

.settings-divider {
  width: 1px;
  height: 24px;
  background: var(--lines);
}

/* ===========================
   MAIN CONTENT
   =========================== */
.main-content {
  flex: 1;
  overflow-y: auto;
  min-height: 0;
  padding-bottom: 20px;
}

.page {
  min-height: 100%;
}

/* ===========================
   PAGE HEADER
   =========================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.page-breadcrumb {
  color: var(--primary-700);
  font-size: 12px;
  font-weight: 400;
}

.page-title {
  color: var(--black);
  font-size: 18px;
  font-weight: 700;
}

/* ===========================
   BUTTONS
   =========================== */
.btn-primary {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  background: var(--primary-700);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-primary:hover { background: var(--primary-600); }
.btn-primary svg { width: 16px; height: 16px; flex-shrink: 0; }

.btn-primary-sm {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 16px;
  background: var(--primary-700);
  color: #fff;
  border: none;
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s;
  white-space: nowrap;
}

.btn-primary-sm:hover { background: var(--primary-600); }

.btn-outline {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 20px;
  background: transparent;
  color: var(--primary-700);
  border: 1px solid var(--primary-700);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline:hover { background: var(--primary-300); }

.btn-outline-sm {
  display: flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 16px;
  background: transparent;
  color: var(--primary-700);
  border: 1px solid var(--primary-700);
  border-radius: var(--radius-btn);
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-outline-sm:hover { background: var(--primary-300); }
.btn-outline-sm svg { width: 14px; height: 14px; }

.btn-map {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 16px;
  background: var(--primary-700);
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  width: 100%;
  margin-top: 12px;
}

/* ===========================
   FORM ELEMENTS
   =========================== */
.field-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
  width: 100%;
}

.field-label {
  color: var(--neutral-500);
  font-size: 12px;
  font-weight: 500;
  padding-left: 4px;
}

.text-input {
  width: 100%;
  height: 34px;
  padding: 0 14px 0 18px;
  border: 1px solid var(--lines);
  border-radius: 12px;
  font-family: inherit;
  font-size: 11px;
  color: var(--black);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.text-input:focus { border-color: var(--primary-500); }

.textarea-input {
  width: 100%;
  height: 122px;
  padding: 12px 14px 12px 18px;
  border: 1px solid var(--lines);
  border-radius: 12px;
  font-family: inherit;
  font-size: 11px;
  color: var(--black);
  background: var(--white);
  outline: none;
  resize: vertical;
  transition: border-color 0.2s;
}

.textarea-input:focus { border-color: var(--primary-500); }

.select-field {
  display: flex;
  height: 34px;
  padding: 0 14px 0 18px;
  justify-content: space-between;
  align-items: center;
  border: 1px solid var(--lines);
  border-radius: 12px;
  background: var(--white);
  cursor: pointer;
  font-size: 11px;
  color: var(--black);
  user-select: none;
}

.select-field svg { width: 12px; height: 12px; flex-shrink: 0; }

.select-sm {
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--lines);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--black);
  background: var(--white);
  outline: none;
  cursor: pointer;
}

.filter-input {
  width: 100%;
  height: 36px;
  padding: 0 12px;
  border: 1px solid var(--lines);
  border-radius: 8px;
  font-family: inherit;
  font-size: 13px;
  color: var(--black);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.filter-input:focus { border-color: var(--primary-500); }

.form-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.form-row-3 {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

/* ===========================
   TAGS / BADGES
   =========================== */
.tag-light {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-300);
  color: var(--primary-500);
  font-size: 12px;
  font-weight: 500;
  font-family: 'Visby CF', sans-serif;
}

.tag-dark {
  display: inline-flex;
  padding: 5px 12px;
  border-radius: 999px;
  background: var(--primary-500);
  color: #fff;
  font-size: 12px;
  font-weight: 500;
  font-family: 'Visby CF', sans-serif;
}

.badge-vendita {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-300);
  color: var(--primary-500);
  font-size: 11px;
  font-weight: 500;
}

.badge-affitto {
  display: inline-flex;
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--primary-500);
  color: #fff;
  font-size: 11px;
  font-weight: 500;
}

.status-badge {
  display: inline-flex;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
}

.status-disponibile { background: #E9F9F2; color: var(--green); }
.status-trattativa { background: var(--primary-300); color: var(--primary-500); }
.status-venduto { background: #F5F5F5; color: var(--neutral-500); }

.card-badge {
  color: var(--primary-500);
  font-size: 12px;
  font-weight: 400;
}

/* ===========================
   DASHBOARD
   =========================== */
.dashboard-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 12px;
}

.dashboard-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dashboard-card--full {
  grid-column: 1 / -1;
}

.card-header-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 14px;
  border-bottom: 1px solid var(--primary-700);
}

.card-title {
  color: var(--primary-700);
  font-size: 16px;
  font-weight: 500;
}

.card-date {
  color: var(--primary-500);
  font-size: 12px;
  font-weight: 400;
}

.card-link-btn {
  color: var(--primary-500);
  font-size: 12px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
}

.stat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 16px;
}

.stat-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}

.stat-label {
  color: var(--neutral-400);
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  line-height: 1.4;
}

.stat-label small {
  display: block;
  font-size: 11px;
}

.stat-value {
  color: var(--black);
  font-size: 14px;
  font-weight: 500;
}

.stage-list {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 16px;
}

.stage-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
}

.events-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.event-item {
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.event-blue { background: var(--primary-300); color: var(--primary-500); }
.event-yellow { background: #FFF7E1; color: var(--warning); }
.event-purple { background: #EDDFFF; color: var(--violet); }
.event-green { background: #E9F9F2; color: var(--green); }

.task-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
}

.task-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 8px 12px;
  border-radius: 9.5px;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.task-card:hover { box-shadow: 0 4px 16px rgba(30,34,67,0.12); }

.task-card-title {
  color: var(--primary-700);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.task-card-sub { font-size: 12px; color: var(--black); margin-bottom: 2px; }
.task-card-org { font-size: 12px; color: var(--primary-500); font-weight: 700; }

.task-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

.task-card-person { font-size: 12px; color: var(--black); font-weight: 500; }
.task-card-date { font-size: 12px; color: var(--primary-500); }

.visit-card {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 12px;
  border-radius: 12px;
  background: var(--white);
  box-shadow: var(--shadow);
  cursor: pointer;
  transition: box-shadow 0.2s;
}

.visit-card:hover { box-shadow: 0 4px 16px rgba(30,34,67,0.12); }

.visit-card-title {
  color: var(--black);
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.visit-card-org { font-size: 12px; color: var(--neutral-500); font-weight: 700; }

.visit-card-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* ===========================
   TASK PAGE
   =========================== */
.task-view {
  display: grid;
  grid-template-columns: 300px 1fr 360px;
  gap: 0;
  height: calc(100vh - 180px);
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.task-list-panel {
  border-right: 1px solid var(--lines);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.task-filters {
  padding: 12px;
  border-bottom: 1px solid var(--lines);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 4px 10px;
  border: 1px solid var(--lines);
  border-radius: 999px;
  background: none;
  font-family: inherit;
  font-size: 12px;
  color: var(--neutral-500);
  cursor: pointer;
  transition: all 0.15s;
}

.filter-tab.active {
  background: var(--primary-300);
  border-color: var(--primary-500);
  color: var(--primary-500);
}

.task-items {
  flex: 1;
  overflow-y: auto;
}

.task-list-item {
  padding: 12px;
  border-bottom: 1px solid var(--lines);
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.task-list-item:hover { background: var(--bg-color); }
.task-list-item.active { background: var(--primary-300); }

.tli-title { font-size: 14px; font-weight: 600; color: var(--primary-700); }
.tli-meta { font-size: 12px; color: var(--neutral-500); }
.tli-date { font-size: 11px; color: var(--primary-500); }

.tli-badges { display: flex; gap: 4px; flex-wrap: wrap; }

.task-detail-panel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.task-detail-header {
  background: var(--primary-700);
  color: #fff;
  padding: 16px;
  font-size: 16px;
  font-weight: 500;
}

.task-detail-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.task-sector-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.task-fields-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.reminder-btn {
  align-self: flex-start;
  margin: 4px 0;
}

.task-detail-footer {
  padding: 12px 16px;
  border-top: 1px solid var(--lines);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.task-share {
  display: flex;
  align-items: center;
  gap: 8px;
}

.share-label { color: var(--primary-500); font-size: 14px; font-weight: 500; }
.share-person { color: var(--black); font-size: 14px; }

.task-sidebar-panel {
  border-left: 1px solid var(--lines);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.tsp-tabs {
  display: flex;
  align-items: center;
  padding: 12px 16px 16px;
  border-bottom: 1px solid var(--lines);
  gap: 4px;
}

.tsp-tab {
  padding: 6px 14px;
  border: none;
  background: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  color: var(--neutral-500);
  cursor: pointer;
  transition: all 0.15s;
}

.tsp-tab.active {
  background: var(--primary-300);
  color: var(--primary-500);
}

.tsp-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid var(--lines);
}

.checklist-item input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--primary-500);
  cursor: pointer;
}

.checklist-item label {
  font-size: 14px;
  color: var(--black);
  cursor: pointer;
}

/* ===========================
   LISTING / TABLE
   =========================== */
.listing-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.listing-search { flex: 1; max-width: 300px; }

.listing-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.view-toggle {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.view-btn {
  width: 36px;
  height: 36px;
  background: none;
  border: 1px solid var(--lines);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--neutral-500);
  transition: all 0.15s;
  font-size: 13px;
}

.view-btn svg { width: 16px; height: 16px; }

.view-btn.active {
  background: var(--primary-300);
  border-color: var(--primary-500);
  color: var(--primary-500);
}

.immobili-table-wrap {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: auto;
}

.data-table {
  width: 100%;
  border-collapse: collapse;
}

.data-table thead th {
  padding: 12px 16px;
  text-align: left;
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-500);
  border-bottom: 1px solid var(--lines);
  white-space: nowrap;
}

.data-table tbody tr {
  cursor: pointer;
  transition: background 0.15s;
}

.data-table tbody tr:hover { background: var(--bg-color); }

.data-table tbody td {
  padding: 12px 16px;
  font-size: 13px;
  color: var(--black);
  border-bottom: 1px solid var(--lines);
}

.data-table tbody tr:last-child td { border-bottom: none; }

.action-btn {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 16px;
  color: var(--neutral-500);
  padding: 4px 8px;
  border-radius: 6px;
  transition: background 0.15s;
}

.action-btn:hover { background: var(--bg-color); }

/* ===========================
   IMMOBILE DETAIL
   =========================== */
.detail-page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  margin-bottom: 12px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  color: var(--primary-500);
  font-weight: 500;
}

.back-btn svg { width: 16px; height: 16px; }

.detail-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 16px;
}

.detail-left {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.detail-right {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.detail-title-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.detail-property-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
}

.detail-ref {
  font-size: 12px;
  color: var(--neutral-500);
  margin-top: 4px;
}

.detail-price-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.detail-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--black);
}

.icon-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
}

.icon-btn svg { width: 20px; height: 20px; }

.property-images {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 8px;
  height: 240px;
}

.property-main-img { border-radius: 8px; overflow: hidden; }
.property-thumbs { display: flex; flex-direction: column; gap: 8px; }

.img-placeholder-large {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #e8e8e8, #d0d0d0);
  border-radius: 8px;
}

.img-placeholder-thumb {
  flex: 1;
  background: linear-gradient(135deg, #e8e8e8, #d0d0d0);
  border-radius: 8px;
}

.property-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.property-stats {
  display: flex;
  gap: 12px;
}

.property-stat {
  flex: 1;
  background: var(--primary-300);
  border-radius: 12px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  text-align: center;
}

.stat-icon svg { width: 24px; height: 24px; }
.stat-label-sm { color: var(--primary-500); font-size: 12px; font-weight: 500; }
.stat-val-sm { color: var(--primary-700); font-size: 16px; font-weight: 700; }

.property-features-section { }

.section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 12px;
}

.features-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.feature-item {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  border: 1px solid var(--lines);
  border-radius: 8px;
}

.feature-label { font-size: 11px; color: var(--neutral-500); }
.feature-value { font-size: 13px; font-weight: 500; color: var(--black); }

.detail-info-card {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 16px;
}

.info-card-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 12px;
}

.info-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.info-full { grid-column: 1 / -1; }

.info-label { font-size: 11px; color: var(--neutral-400); }
.info-val { font-size: 13px; font-weight: 500; color: var(--black); }

.detail-tabs-section {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 0;
  overflow: hidden;
}

.detail-tabs {
  display: flex;
  border-bottom: 1px solid var(--lines);
  padding: 0 8px;
  overflow-x: auto;
}

.detail-tab {
  padding: 12px 10px;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 13px;
  color: var(--neutral-500);
  cursor: pointer;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: all 0.15s;
  margin-bottom: -1px;
}

.detail-tab:hover { color: var(--primary-500); }
.detail-tab.active {
  color: var(--primary-500);
  border-bottom-color: var(--primary-500);
  font-weight: 600;
}

.tab-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.tab-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--black);
  margin-bottom: 4px;
}

.subsection-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-500);
}

.checkboxes-row {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--black);
  cursor: pointer;
}

.checkbox-label input[type="checkbox"] {
  accent-color: var(--primary-500);
}

.vani-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.vani-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.vani-label { font-size: 11px; color: var(--neutral-500); }
.vani-input {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--lines);
  border-radius: 8px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.details-form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

/* Activity Tab */
.activity-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}

.search-input-wrap {
  flex: 1;
  position: relative;
  display: flex;
  align-items: center;
}

.search-small-btn {
  position: absolute;
  right: 4px;
  width: 28px;
  height: 28px;
  background: var(--primary-700);
  border: none;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.search-small-btn svg { width: 12px; height: 12px; }

.activity-group { margin-bottom: 16px; }

.activity-date {
  font-size: 12px;
  font-weight: 600;
  color: var(--black);
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid var(--lines);
}

.activity-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 8px 0;
}

.activity-avatar {
  width: 32px;
  height: 32px;
  background: var(--primary-700);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  flex-shrink: 0;
}

.activity-content { flex: 1; }
.activity-title { font-size: 13px; font-weight: 500; color: var(--black); }
.activity-person { font-size: 12px; color: var(--neutral-500); }
.activity-time { font-size: 11px; color: var(--neutral-400); margin-left: auto; }

/* Note Tab */
.note-toolbar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--lines);
  flex-wrap: wrap;
}

.note-select {
  padding: 4px 8px;
  border: 1px solid var(--lines);
  border-radius: 6px;
  font-family: inherit;
  font-size: 12px;
  outline: none;
}

.note-format-btns { display: flex; gap: 4px; }

.format-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--lines);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.note-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 40px;
  color: var(--neutral-400);
}

.note-empty-icon svg { width: 60px; height: 60px; }
.note-empty-text { font-size: 14px; }
.note-empty-link { color: var(--primary-500); font-size: 14px; }

.tab-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 40px;
  color: var(--neutral-500);
  font-size: 14px;
  text-align: center;
}

/* ===========================
   KANBAN BOARD
   =========================== */
.kanban-board {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.kanban-column {
  min-width: 240px;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
  flex-shrink: 0;
}

.kanban-col-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 16px;
  border-bottom: 1px solid var(--lines);
}

.kanban-col-title { font-size: 14px; font-weight: 600; color: var(--black); }
.kanban-col-count {
  width: 22px;
  height: 22px;
  background: var(--bg-color);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--neutral-500);
}

.kanban-cards {
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-height: 100px;
}

.kanban-card {
  background: var(--white);
  border: 1px solid var(--lines);
  border-radius: 8px;
  padding: 12px;
  cursor: pointer;
  transition: box-shadow 0.15s;
}

.kanban-card:hover { box-shadow: var(--shadow); }

.kc-title { font-size: 13px; font-weight: 600; color: var(--black); margin-bottom: 4px; }
.kc-price { font-size: 14px; font-weight: 700; color: var(--primary-700); margin-bottom: 8px; }

.kc-footer {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--neutral-500);
}

/* ===========================
   ANALYTICS
   =========================== */
.analytics-filters {
  display: flex;
  align-items: center;
  gap: 8px;
}

.analytics-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.analytics-kpi {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 20px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.kpi-label { font-size: 13px; color: var(--neutral-500); font-weight: 500; }
.kpi-value { font-size: 28px; font-weight: 700; color: var(--primary-700); }
.kpi-trend { font-size: 12px; }
.kpi-up { color: var(--green); }
.kpi-down { color: #EB5757; }

.analytics-chart-card {
  grid-column: span 2;
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.chart-title { font-size: 16px; font-weight: 600; color: var(--black); margin-bottom: 16px; }

.chart-placeholder {
  height: 200px;
  display: flex;
  align-items: flex-end;
  border-bottom: 2px solid var(--lines);
}

.chart-bar-group {
  display: flex;
  align-items: flex-end;
  gap: 12px;
  width: 100%;
  height: 100%;
  padding: 0 8px;
}

.chart-bar {
  flex: 1;
  background: linear-gradient(to top, var(--primary-700), var(--primary-500));
  border-radius: 6px 6px 0 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  padding-bottom: 4px;
  cursor: pointer;
  transition: opacity 0.15s;
}

.chart-bar:hover { opacity: 0.8; }
.chart-bar span { font-size: 10px; color: #fff; font-weight: 600; }

.stage-analytics { display: flex; flex-direction: column; gap: 12px; }

.stage-bar-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.stage-bar-label { font-size: 12px; color: var(--black); min-width: 160px; }
.stage-bar-track { flex: 1; height: 8px; background: var(--bg-color); border-radius: 4px; overflow: hidden; }
.stage-bar-fill { height: 100%; border-radius: 4px; }
.stage-bar-val { font-size: 12px; color: var(--black); font-weight: 600; min-width: 80px; text-align: right; }

/* ===========================
   CALENDAR
   =========================== */
.calendar-container {
  background: var(--white);
  border-radius: 12px;
  box-shadow: var(--shadow);
  padding: 20px;
}

.calendar-nav {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 20px;
}

.cal-nav-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--lines);
  border-radius: 8px;
  background: none;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s;
}

.cal-nav-btn:hover { background: var(--bg-color); }

.cal-month-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--black);
  flex: 1;
}

.cal-view-toggle { display: flex; gap: 4px; }

.cal-view-btn {
  padding: 6px 14px;
  border: 1px solid var(--lines);
  border-radius: 8px;
  background: none;
  font-family: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: all 0.15s;
}

.cal-view-btn.active {
  background: var(--primary-300);
  border-color: var(--primary-500);
  color: var(--primary-500);
}

.calendar-grid { border: 1px solid var(--lines); border-radius: 8px; overflow: hidden; }

.cal-header-row {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  background: var(--bg-color);
  border-bottom: 1px solid var(--lines);
}

.cal-day-name {
  padding: 10px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  color: var(--neutral-500);
}

.cal-body {}

.cal-week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  border-bottom: 1px solid var(--lines);
}

.cal-week:last-child { border-bottom: none; }

.cal-cell {
  padding: 8px;
  min-height: 80px;
  border-right: 1px solid var(--lines);
  font-size: 13px;
  font-weight: 500;
  vertical-align: top;
  cursor: pointer;
  transition: background 0.15s;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.cal-cell:last-child { border-right: none; }
.cal-cell:hover { background: var(--bg-color); }
.cal-cell.other-month { color: var(--neutral-300); }
.cal-cell.today {
  background: var(--primary-300);
  font-weight: 700;
  color: var(--primary-700);
}

.cal-event {
  font-size: 10px;
  padding: 2px 6px;
  border-radius: 4px;
  font-weight: 500;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ===========================
   MODALS
   =========================== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.4);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal {
  background: var(--white);
  border-radius: 16px;
  width: 800px;
  max-width: 95vw;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
}

.modal.modal-sm {
  width: 500px;
}

.modal-header {
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.modal-title {
  font-size: 16px;
  font-weight: 500;
}

.modal-close {
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
  display: flex;
  align-items: center;
  opacity: 0.7;
  transition: opacity 0.15s;
}

.modal-close:hover { opacity: 1; }
.modal-close svg { width: 11px; height: 11px; }

.modal-header-simple {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 20px;
  border-bottom: 1px solid var(--lines);
}

.modal-title-dark {
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
}

.modal-close-dark {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 18px;
  color: var(--neutral-500);
  line-height: 1;
  transition: color 0.15s;
}

.modal-close-dark:hover { color: var(--black); }

.modal-tabs {
  display: flex;
  gap: 4px;
  padding: 12px 16px;
  border-bottom: 1px solid var(--lines);
}

.modal-tab {
  padding: 6px 14px;
  border: none;
  background: none;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  color: var(--neutral-500);
  cursor: pointer;
  transition: all 0.15s;
}

.modal-tab.active {
  background: var(--primary-300);
  color: var(--primary-500);
}

.modal-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.sector-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.modal-footer {
  padding: 12px 20px;
  border-top: 1px solid var(--lines);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.quick-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.quick-action-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--lines);
  border-radius: 12px;
  background: none;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  color: var(--black);
  cursor: pointer;
  transition: all 0.15s;
  text-align: left;
}

.quick-action-btn:hover {
  background: var(--primary-300);
  border-color: var(--primary-500);
  color: var(--primary-700);
}

.quick-action-btn svg { width: 24px; height: 24px; flex-shrink: 0; }

/* ===========================
   FORM VALIDATION STATES
   =========================== */

/* Error state */
.input-error {
  border-color: #E53E3E !important;
  background: #FFF5F5 !important;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.1) !important;
}

/* Success state */
.input-success {
  border-color: #38A169 !important;
  background: #F0FFF4 !important;
  box-shadow: 0 0 0 3px rgba(56, 161, 105, 0.1) !important;
}

/* Error message text */
.field-error {
  display: block;
  color: #E53E3E;
  font-size: 11px;
  font-weight: 500;
  margin-top: 4px;
  padding-left: 4px;
  animation: fadeInError 0.2s ease;
}

@keyframes fadeInError {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Shake animation on error */
@keyframes inputShake {
  0%, 100% { transform: translateX(0); }
  20%       { transform: translateX(-6px); }
  40%       { transform: translateX(6px); }
  60%       { transform: translateX(-4px); }
  80%       { transform: translateX(4px); }
}

.input-shake {
  animation: inputShake 0.4s ease;
}

/* Login-specific error */
.login-input.input-error {
  border-color: #E53E3E !important;
  background: #FFF5F5 !important;
}

.login-input.input-success {
  border-color: #38A169 !important;
  background: #F0FFF4 !important;
}

/* Disabled login button */
.btn-login:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

/* ===========================
   SCROLLBAR STYLING
   =========================== */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--neutral-300); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--neutral-400); }

/* ===========================
   MOBILE TOP BAR
   =========================== */
.mobile-topbar {
  display: none;
}

.sidebar-overlay {
  display: none;
}

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

  .dashboard-grid {
    grid-template-columns: 1fr 1fr;
  }

  .task-view {
    grid-template-columns: 260px 1fr;
  }

  .task-sidebar-panel {
    display: none;
  }

  .detail-layout {
    grid-template-columns: 1fr;
  }

  .stage-bar-label {
    min-width: 120px;
  }
}

/* ===========================
   RESPONSIVE - MOBILE (≤768px)
   =========================== */
@media (max-width: 768px) {

  body {
    overflow: auto;
  }

  /* --- Mobile Top Bar --- */
  .mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: var(--white);
    padding: 0 16px;
    z-index: 500;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    border-bottom: 1px solid var(--lines);
  }

  .mobile-menu-btn,
  .mobile-add-btn {
    width: 40px;
    height: 40px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--primary-700);
    transition: background 0.15s;
  }

  .mobile-menu-btn:hover,
  .mobile-add-btn:hover {
    background: var(--bg-color);
  }

  .mobile-menu-btn svg,
  .mobile-add-btn svg {
    width: 22px;
    height: 22px;
  }

  .mobile-logo {
    width: 120px;
    height: 17px;
  }

  /* --- Sidebar Overlay --- */
  .sidebar-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 600;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }

  .app-shell.sidebar-open .sidebar-overlay {
    opacity: 1;
    pointer-events: all;
  }

  /* --- App Shell --- */
  .app-shell {
    display: block;
    padding: 0;
    padding-top: 56px; /* mobile topbar height */
    height: auto;
    min-height: 100vh;
  }

  /* --- Sidebar as Slide-out Drawer --- */
  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    width: 260px;
    z-index: 700;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    border-radius: 0;
    border-right: 1px solid var(--lines);
    box-shadow: 4px 0 20px rgba(0,0,0,0.12);
    overflow-y: auto;
  }

  .app-shell.sidebar-open .sidebar {
    transform: translateX(0);
  }

  /* --- Main Content --- */
  .main-content {
    padding: 12px;
    padding-bottom: 24px;
    min-height: calc(100vh - 56px);
  }

  /* --- Login --- */
  .login-card {
    width: calc(100vw - 32px);
    max-width: 454px;
    padding: 32px 16px;
  }

  .login-bg-circle {
    width: 600px;
    height: 600px;
    left: -100px;
    top: 50px;
  }

  /* --- Page Header --- */
  .page-header {
    flex-wrap: wrap;
    gap: 10px;
    padding: 12px;
  }

  .page-header > * {
    min-width: 0;
  }

  /* --- Dashboard --- */
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .dashboard-card--full {
    grid-column: 1;
  }

  /* --- Task View --- */
  .task-view {
    grid-template-columns: 1fr;
    height: auto;
    min-height: calc(100vh - 120px);
  }

  .task-list-panel {
    border-right: none;
    border-bottom: 1px solid var(--lines);
    max-height: 300px;
  }

  .task-sidebar-panel {
    display: flex;
    border-left: none;
    border-top: 1px solid var(--lines);
    max-height: 400px;
  }

  /* --- Listing Controls --- */
  .listing-controls {
    flex-wrap: wrap;
    gap: 8px;
  }

  .listing-search {
    max-width: 100%;
    flex: 1 1 100%;
    order: -1;
  }

  .listing-filters {
    flex-wrap: wrap;
    gap: 6px;
  }

  .view-toggle {
    margin-left: 0;
  }

  /* --- Tables --- */
  .immobili-table-wrap {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .data-table {
    min-width: 600px;
  }

  /* --- Kanban --- */
  .kanban-board {
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 12px;
    gap: 12px;
  }

  .kanban-column {
    min-width: 260px;
    flex-shrink: 0;
  }

  /* --- Immobile Detail --- */
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-page-header {
    flex-wrap: wrap;
    gap: 8px;
  }

  .property-images {
    height: 200px;
  }

  .features-grid {
    grid-template-columns: 1fr 1fr;
  }

  .property-stats {
    flex-wrap: wrap;
  }

  .property-actions {
    justify-content: flex-start;
  }

  /* --- Info Grid --- */
  .info-grid {
    grid-template-columns: 1fr;
  }

  .info-full { grid-column: 1; }

  /* --- Form Rows --- */
  .form-row-2,
  .form-row-3 {
    grid-template-columns: 1fr;
  }

  /* --- Task Fields --- */
  .task-fields-grid {
    grid-template-columns: 1fr;
  }

  /* --- Modals --- */
  .modal-overlay {
    align-items: flex-end;
  }

  .modal {
    width: 100%;
    max-width: 100%;
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
  }

  .modal.modal-sm {
    width: 100%;
  }

  .quick-actions {
    grid-template-columns: 1fr;
  }

  /* --- Analytics --- */
  .kpi-grid {
    grid-template-columns: 1fr 1fr;
  }

  .analytics-grid {
    grid-template-columns: 1fr;
  }

  .stage-bar-label {
    min-width: 90px;
    font-size: 11px;
  }

  /* --- Calendar --- */
  .calendar-nav {
    flex-wrap: wrap;
    gap: 8px;
  }

  .cal-view-toggle {
    flex-wrap: wrap;
  }

  .cal-day-name {
    font-size: 11px;
    padding: 6px 2px;
  }

  .cal-cell {
    min-height: 50px;
    padding: 4px;
    font-size: 11px;
  }

  .cal-event {
    display: none; /* hide event labels on tiny cells */
  }

  /* --- Filter Tabs --- */
  .filter-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .filter-tab {
    white-space: nowrap;
  }

  /* --- Detail Tabs --- */
  .detail-tabs {
    overflow-x: auto;
    flex-wrap: nowrap;
  }

  /* --- Stage bar --- */
  .stage-bar-item {
    flex-wrap: wrap;
    gap: 6px;
  }

  .stage-bar-val {
    min-width: auto;
    text-align: left;
  }

  /* --- Stat Grid (dashboard) --- */
  .stat-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* --- Sidebar close button --- */
  .sidebar-close-btn {
    display: flex;
  }
}
