:root {
  --bg: #f4f6f8;
  --surface: #ffffff;
  --surface-soft: #eef3f5;
  --text: #17202a;
  --muted: #657282;
  --border: #d9e0e7;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --blue: #2563eb;
  --amber: #b7791f;
  --red: #be123c;
  --green: #16803d;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.11);
  --radius: 8px;
  --sidebar: 248px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family:
    Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI",
    sans-serif;
  line-height: 1.45;
}

.is-hidden {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: var(--sidebar) minmax(0, 1fr);
}

.auth-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
  background:
    linear-gradient(rgba(244, 246, 248, 0.88), rgba(244, 246, 248, 0.88)),
    url("data:image/svg+xml,%3Csvg width='1200' height='800' viewBox='0 0 1200 800' xmlns='http://www.w3.org/2000/svg'%3E%3Crect width='1200' height='800' fill='%23e8eef2'/%3E%3Cpath d='M0 160h1200M0 320h1200M0 480h1200M0 640h1200M200 0v800M400 0v800M600 0v800M800 0v800M1000 0v800' stroke='%23c9d5de' stroke-width='2'/%3E%3C/svg%3E");
  background-size: cover;
}

.auth-panel {
  width: min(440px, 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.auth-brand {
  margin-bottom: 22px;
  color: var(--text);
}

.auth-brand .brand-mark {
  background: #1c2733;
  color: #eef6f6;
}

.auth-form {
  display: grid;
  gap: 14px;
}

.auth-form h1 {
  margin: 0;
  font-size: 24px;
  letter-spacing: 0;
}

.auth-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.auth-form input {
  min-height: 42px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 10px;
  color: var(--text);
}

.auth-form .check-row {
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
}

.auth-form .check-row input {
  width: 18px;
  height: 18px;
  min-height: 18px;
  margin: 0;
  accent-color: var(--teal);
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 22px 16px;
  background: #1c2733;
  color: #eef6f6;
}

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

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f7fbfb;
  color: #12343c;
  font-weight: 800;
  letter-spacing: 0;
}

.brand-logo {
  width: 72px;
  height: 44px;
  object-fit: contain;
  border-radius: 6px;
  background: white;
  flex: 0 0 auto;
}

.brand strong,
.brand span {
  display: block;
}

.brand span {
  color: #aebcca;
  font-size: 13px;
}

.nav-list {
  display: grid;
  gap: 6px;
}

.nav-item {
  width: 100%;
  min-height: 44px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 0;
  border-radius: var(--radius);
  padding: 10px 12px;
  background: transparent;
  color: #dce7ee;
  text-align: left;
}

.nav-item:hover,
.nav-item.active {
  background: #eef6f6;
  color: #12343c;
}

.icon {
  width: 18px;
  height: 18px;
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
}

.icon svg,
.icon-button svg {
  width: 100%;
  height: 100%;
  fill: currentColor;
}

.sidebar-summary {
  margin-top: auto;
  padding: 14px;
  border: 1px solid rgba(238, 246, 246, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.sidebar-module-button {
  width: 100%;
  min-height: 46px;
  display: flex;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(238, 246, 246, 0.15);
  border-radius: var(--radius);
  padding: 12px 14px;
  background: rgba(255, 255, 255, 0.06);
  color: #eef6f6;
  text-align: left;
}

.sidebar-module-button:hover,
.sidebar-module-button.active {
  border-color: rgba(238, 246, 246, 0.36);
  background: rgba(255, 255, 255, 0.12);
}

.sidebar-module-button strong {
  font-size: 14px;
}

.user-box {
  display: grid;
  gap: 8px;
  padding: 14px;
  border: 1px solid rgba(238, 246, 246, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.06);
}

.user-box span,
.user-box strong {
  display: block;
}

.user-box span {
  color: #aebcca;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.user-box .button {
  width: 100%;
}

.sidebar-summary span,
.sidebar-summary strong {
  display: block;
}

.sidebar-summary span {
  color: #aebcca;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.workspace {
  min-width: 0;
  padding: 24px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.topbar h1,
.panel h2,
.dialog-header h2,
.drawer-header h2 {
  margin: 0;
  letter-spacing: 0;
}

.topbar h1 {
  font-size: 28px;
  line-height: 1.15;
}

.panel h2,
.dialog-header h2,
.drawer-header h2 {
  font-size: 18px;
}

.eyebrow {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.topbar-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search {
  width: min(360px, 34vw);
  min-height: 42px;
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0 12px;
  background: var(--surface);
  color: var(--muted);
}

.search input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.button,
.icon-button {
  border: 1px solid transparent;
  border-radius: var(--radius);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 14px;
  color: var(--text);
  background: var(--surface);
}

.button.primary {
  background: var(--teal);
  color: white;
}

.button.primary:hover {
  background: var(--teal-dark);
}

.button.secondary {
  border-color: var(--border);
}

.button.ghost {
  border-color: transparent;
  color: var(--teal-dark);
  background: transparent;
}

.button.ghost:hover,
.button.secondary:hover {
  border-color: #b8c5cf;
  background: #f7fafb;
}

.button.danger {
  background: #b91c1c;
  color: white;
}

.button.danger:hover {
  background: #991b1b;
}

.button.compact {
  min-height: 32px;
  padding: 0 10px;
  font-size: 12px;
}

.icon-button {
  width: 38px;
  height: 38px;
  padding: 0;
  border-color: var(--border);
}

.view {
  display: none;
}

.view.active {
  display: block;
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.metric-card,
.panel,
.pipeline-column {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.metric-card {
  min-height: 112px;
  padding: 16px;
}

.metric-card span {
  color: var(--muted);
  font-size: 13px;
}

.metric-card strong {
  display: block;
  margin-top: 10px;
  font-size: 30px;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 10px;
  color: var(--muted);
}

.metric-card[data-tone="teal"] {
  border-top: 4px solid var(--teal);
}

.metric-card[data-tone="blue"] {
  border-top: 4px solid var(--blue);
}

.metric-card[data-tone="amber"] {
  border-top: 4px solid var(--amber);
}

.metric-card[data-tone="red"] {
  border-top: 4px solid var(--red);
}

.dashboard-grid,
.settings-grid,
.inbox-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.7fr) minmax(320px, 0.9fr);
  gap: 16px;
  margin-bottom: 16px;
}

.dashboard-grid.lower {
  grid-template-columns: minmax(0, 1.55fr) minmax(320px, 0.75fr);
}

.panel {
  min-width: 0;
  padding: 16px;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}

.stage-strip {
  display: grid;
  grid-template-columns: repeat(6, minmax(86px, 1fr));
  gap: 10px;
}

.stage-pill {
  min-height: 96px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: var(--surface-soft);
}

.stage-pill span {
  color: var(--muted);
  font-size: 12px;
}

.stage-pill strong {
  display: block;
  margin-top: 10px;
  font-size: 24px;
}

.stage-pill .bar {
  height: 6px;
  margin-top: 12px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
}

.stage-pill .bar i {
  display: block;
  height: 100%;
  width: var(--width);
  background: var(--tone);
}

.task-list,
.mail-preview,
.mail-list,
.rules-list,
.parsed-panel {
  display: grid;
  gap: 10px;
}

.task-item,
.mail-item,
.rule,
.rules-list > div,
.activity-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfcfd;
}

.task-item {
  display: grid;
  gap: 6px;
}

.task-item strong,
.mail-item strong,
.rules-list strong {
  display: block;
}

.task-item span,
.mail-item span,
.rules-list span,
.activity-item span {
  color: var(--muted);
  font-size: 13px;
}

.table-wrap {
  overflow: auto;
}

.table-wrap.full {
  max-height: calc(100vh - 210px);
}

.role-control {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.role-control select {
  min-height: 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 8px;
  background: white;
  color: var(--text);
}

.role-control span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

th,
td {
  border-bottom: 1px solid var(--border);
  padding: 12px 10px;
  text-align: left;
  vertical-align: middle;
}

th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  background: #fbfcfd;
}

tr.clickable {
  cursor: pointer;
}

tr.clickable:hover td {
  background: #f7fafb;
}

.lead-name {
  display: grid;
  gap: 2px;
}

.lead-name strong {
  font-weight: 750;
}

.lead-name span {
  color: var(--muted);
  font-size: 13px;
}

.status-badge,
.source-badge {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  border-radius: 999px;
  padding: 0 10px;
  font-size: 12px;
  font-weight: 700;
  color: var(--badge-color);
  background: var(--badge-bg);
}

.source-badge {
  color: #344054;
  background: #edf1f5;
}

.list-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 14px;
}

.segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.segmented button,
.list-toolbar select,
.settings-form input,
.settings-form select,
.lead-form input,
.lead-form select,
.lead-form textarea,
.drawer-body select,
.drawer-body textarea {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--text);
}

.segmented button {
  min-height: 38px;
  padding: 0 12px;
}

.segmented button.active {
  border-color: var(--teal);
  color: white;
  background: var(--teal);
}

.list-toolbar select {
  min-width: 180px;
  min-height: 38px;
  padding: 0 10px;
}

.pipeline-board {
  display: grid;
  grid-template-columns: repeat(6, minmax(220px, 1fr));
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 10px;
}

.pipeline-column {
  min-height: 520px;
  padding: 12px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition:
    background 140ms ease,
    border-color 140ms ease;
}

.pipeline-column header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.pipeline-column h2 {
  margin: 0;
  font-size: 15px;
}

.pipeline-cards {
  display: grid;
  gap: 10px;
  min-height: 440px;
  align-content: start;
}

.lead-card {
  border: 1px solid var(--border);
  border-left: 4px solid var(--tone);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfcfd;
  cursor: grab;
  user-select: none;
  transition:
    opacity 120ms ease,
    transform 120ms ease,
    box-shadow 120ms ease;
}

.pipeline-column.is-drag-over {
  border-color: var(--tone);
  background: color-mix(in srgb, var(--tone) 8%, white);
}

.lead-card:hover {
  box-shadow: 0 10px 24px rgba(16, 42, 67, 0.08);
}

.lead-card:active {
  cursor: grabbing;
}

.lead-card.is-dragging {
  opacity: 0.55;
  transform: scale(0.98);
}

.lead-card strong,
.lead-card span {
  display: block;
}

.lead-card span {
  color: var(--muted);
  font-size: 13px;
}

.lead-card footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-top: 10px;
  color: var(--muted);
  font-size: 12px;
}

.rental-entry-panel {
  display: grid;
  gap: 18px;
}

.rental-form {
  grid-template-columns: repeat(6, minmax(120px, 1fr)) auto auto;
  align-items: end;
}

.rental-form .button {
  min-width: 118px;
}

.table-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

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

.rental-year-panel {
  display: grid;
  gap: 14px;
}

.rental-status-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.rental-status-legend span::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 999px;
  display: inline-block;
  margin-right: 5px;
  vertical-align: -1px;
}

.rental-status-legend [data-status="billable"]::before {
  background: #f59e0b;
}

.rental-status-legend [data-status="invoiced"]::before {
  background: #2563eb;
}

.rental-status-legend [data-status="paid"]::before {
  background: #16a34a;
}

.rental-year-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
}

.rental-year-table {
  width: 100%;
  min-width: 1520px;
  border-collapse: collapse;
  font-size: 12px;
}

.rental-year-table th,
.rental-year-table td {
  border: 1px solid var(--border);
  padding: 6px;
  vertical-align: top;
}

.rental-year-table thead th,
.rental-year-table tfoot th,
.rental-year-table tfoot td {
  background: #d9f0d0;
  color: #0f2716;
  font-weight: 900;
}

.rental-year-table tbody th {
  min-width: 92px;
  background: #f7fafb;
  text-align: left;
}

.billing-cell {
  min-width: 100px;
  background: #fbfcfd;
}

.billing-cell[data-status="billable"] {
  background: #fff5d6;
}

.billing-cell[data-status="invoiced"] {
  background: #e8f0ff;
}

.billing-cell[data-status="paid"] {
  background: #dcf7d2;
}

.billing-cell input,
.billing-cell select {
  width: 100%;
  min-height: 30px;
  border: 1px solid transparent;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.72);
  padding: 4px 6px;
  font-size: 12px;
}

.billing-cell input {
  margin-bottom: 4px;
  text-align: right;
  font-weight: 800;
}

.billing-cell select {
  color: var(--muted);
}

.billing-cell input:focus,
.billing-cell select:focus {
  outline: 2px solid rgba(15, 118, 110, 0.2);
  border-color: var(--teal);
  background: white;
}

.billing-total {
  min-width: 104px;
  text-align: right;
  font-weight: 900;
  background: #f7fafb;
}

.rental-state {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  border-radius: 999px;
  padding: 3px 8px;
  background: #e8f6f2;
  color: var(--teal-dark);
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
}

.rental-state[data-state="returned"] {
  background: #eef3f5;
  color: var(--muted);
}

.rental-state[data-state="sold"] {
  background: #fff0e5;
  color: #9a3412;
}

.rental-calendar-grid {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: white;
}

.rental-calendar-table {
  width: 100%;
  min-width: 1320px;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 12px;
}

.rental-calendar-table th,
.rental-calendar-table td {
  border-right: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
}

.rental-calendar-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
}

.rental-calendar-car {
  position: sticky;
  left: 0;
  z-index: 3;
  width: 260px;
  min-width: 260px;
  max-width: 260px;
  padding: 9px 10px;
  background: #f7fafb;
  text-align: left;
  box-shadow: 1px 0 0 var(--border);
}

thead .rental-calendar-car {
  background: #d9f0d0;
  color: #0f2716;
  font-weight: 900;
}

.rental-calendar-car strong,
.rental-calendar-car span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rental-calendar-car strong {
  font-size: 13px;
}

.rental-calendar-car span {
  color: var(--muted);
  font-size: 12px;
}

.rental-calendar-day-head {
  min-width: 34px;
  width: 34px;
  padding: 7px 4px;
  background: #fbfcfd;
  text-align: center;
  color: var(--text);
}

.rental-calendar-day-head strong,
.rental-calendar-day-head span {
  display: block;
}

.rental-calendar-day-head span {
  font-size: 11px;
  color: var(--muted);
}

.rental-calendar-day-head.is-weekend,
.rental-day-cell.is-weekend {
  background: #fff8ed;
}

.rental-calendar-day-head.is-today,
.rental-day-cell.is-today {
  box-shadow: inset 0 0 0 2px var(--teal);
}

.rental-day-cell {
  min-width: 34px;
  height: 38px;
  padding: 0;
  background: #fbfcfd;
}

.rental-day-cell.is-rented {
  background: var(--rental-bg, #e8f6f2);
  box-shadow: inset 0 0 0 1px var(--rental-color, var(--teal));
}

.rental-day-cell.is-rented.is-today {
  box-shadow:
    inset 0 0 0 2px var(--teal),
    inset 0 -4px 0 var(--rental-color, var(--teal));
}

.rental-day-fill {
  display: block;
  width: 100%;
  height: 100%;
}

.rental-calendar-empty {
  padding: 18px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfd;
}

.billing-reminder-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0;
  color: var(--text);
  box-shadow: var(--shadow);
}

.billing-reminder-dialog::backdrop {
  background: rgba(15, 23, 42, 0.38);
}

.billing-reminder-dialog .dialog-header {
  border-bottom: 1px solid var(--border);
  margin: 0;
  padding: 16px;
}

.billing-reminder-list {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.billing-reminder-item {
  display: grid;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  background: #fbfcfd;
}

.billing-reminder-item strong,
.billing-reminder-item span {
  display: block;
}

.billing-reminder-item span {
  color: var(--muted);
  font-size: 13px;
}

.inbox-list-panel {
  min-height: 560px;
}

.mail-item {
  text-align: left;
  border-color: var(--border);
  width: 100%;
}

button.mail-item {
  cursor: pointer;
}

.mail-item.active {
  border-color: var(--teal);
  box-shadow: inset 3px 0 0 var(--teal);
}

.mail-item.imported {
  opacity: 0.72;
}

.mail-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-top: 8px;
}

.parsed-panel dl,
.drawer-body dl {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 8px 12px;
  margin: 0;
}

.parsed-panel dt,
.drawer-body dt {
  color: var(--muted);
}

.parsed-panel dd,
.drawer-body dd {
  margin: 0;
}

.parsed-panel pre {
  white-space: pre-wrap;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfcfd;
  color: #344054;
  max-height: 230px;
  overflow: auto;
}

.settings-form,
.rental-form,
.user-create-form,
.form-grid {
  display: grid;
  gap: 14px;
}

.user-create-form {
  grid-template-columns: repeat(4, minmax(140px, 1fr)) auto;
  align-items: end;
  margin-bottom: 18px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #fbfcfd;
}

.settings-subpanel,
.outlook-connect,
.outlook-device {
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  background: #fbfcfd;
}

.outlook-connect {
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.outlook-connect strong,
.outlook-connect span,
.outlook-device strong,
.outlook-device span {
  display: block;
}

.outlook-connect span,
.outlook-device span {
  color: var(--muted);
  font-size: 13px;
}

.outlook-device strong {
  font-size: 28px;
  letter-spacing: 0.08em;
}

.settings-form label,
.rental-form label,
.user-create-form label,
.lead-form label {
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.settings-form input,
.settings-form select,
.rental-form input,
.user-create-form input,
.user-create-form select,
.lead-form input,
.lead-form select,
.lead-form textarea,
.drawer-body select,
.drawer-body textarea {
  width: 100%;
  min-height: 42px;
  padding: 9px 10px;
  font-weight: 500;
}

.lead-form textarea,
.drawer-body textarea {
  resize: vertical;
}

.toggle-row {
  display: flex !important;
  grid-template-columns: auto 1fr;
  align-items: center;
  gap: 10px;
}

.toggle-row input {
  width: 18px;
  min-height: 18px;
}

.lead-dialog {
  width: min(720px, calc(100vw - 28px));
  border: 0;
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow);
}

.lead-dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
}

.lead-form {
  padding: 18px;
}

.dialog-header,
.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.form-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.span-2 {
  grid-column: span 2;
}

.dialog-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 18px;
}

.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(460px, 100vw);
  height: 100vh;
  padding: 18px;
  border-left: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  transform: translateX(105%);
  transition: transform 180ms ease;
  z-index: 5;
  overflow: auto;
}

.detail-drawer.open {
  transform: translateX(0);
}

.drawer-body {
  display: grid;
  gap: 16px;
}

.drawer-section {
  display: grid;
  gap: 10px;
}

.drawer-section h3 {
  margin: 0;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.danger-section {
  border-top: 1px solid var(--border);
  padding-top: 14px;
}

.contact-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 20px;
  transform: translate(-50%, 18px);
  min-width: min(360px, calc(100vw - 32px));
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #17202a;
  color: white;
  opacity: 0;
  pointer-events: none;
  transition:
    opacity 160ms ease,
    transform 160ms ease;
  z-index: 10;
}

.toast.show {
  opacity: 1;
  transform: translate(-50%, 0);
}

.empty-state {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 20px;
  color: var(--muted);
  text-align: center;
  background: #fbfcfd;
}

@media (max-width: 1180px) {
  .app-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: static;
    height: auto;
    flex-direction: row;
    align-items: center;
    overflow-x: auto;
  }

  .nav-list {
    display: flex;
    min-width: max-content;
  }

  .sidebar-summary {
    display: none;
  }

  .sidebar-module-button {
    width: auto;
    min-width: 140px;
  }

  .user-box {
    min-width: 210px;
  }

  .dashboard-grid,
  .dashboard-grid.lower,
  .settings-grid,
  .inbox-layout {
    grid-template-columns: 1fr;
  }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(160px, 1fr));
  }

  .stage-strip {
    grid-template-columns: repeat(3, minmax(120px, 1fr));
  }

  .rental-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .user-create-form {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .workspace {
    padding: 16px;
  }

  .topbar,
  .topbar-actions,
  .list-toolbar {
    align-items: stretch;
    flex-direction: column;
  }

  .search {
    width: 100%;
  }

  .metric-grid,
  .stage-strip,
  .form-grid,
  .rental-form,
  .user-create-form,
  .contact-actions {
    grid-template-columns: 1fr;
  }

  .span-2 {
    grid-column: auto;
  }

  .sidebar {
    padding: 14px;
  }

  .brand {
    min-width: 190px;
  }
}
