:root {
  color-scheme: dark;
  --bg: #101820;
  --bg-elevated: #18232d;
  --sidebar: #0d141b;
  --topbar: #111a22;
  --card: #1e2a35;
  --card-2: #22303c;
  --surface-2: #263644;
  --hover: #2b3b49;
  --text: #eaf0f6;
  --text-muted: #8fa3b8;
  --text-meta: #6f8397;
  --accent: #29b6f6;
  --accent-2: #00aeef;
  --success: #64dd17;
  --success-lime: #aeea00;
  --warning: #ffb300;
  --danger: #ef5350;
  --border: rgba(234, 240, 246, 0.08);
  --border-strong: rgba(234, 240, 246, 0.16);
  --shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
  --radius: 8px;
  --sidebar-width: 264px;
  --topbar-height: 64px;
  font-family: Inter, Roboto, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
}

body {
  overflow-x: hidden;
}

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

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

button {
  border: 0;
}

a {
  color: inherit;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 440px;
  background:
    radial-gradient(circle at 18% 16%, rgba(41, 182, 246, 0.14), transparent 28%),
    linear-gradient(135deg, #101820 0%, #18232d 44%, #0d141b 100%);
}

.login-visual {
  padding: 56px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
}

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

.brand-icon {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  display: grid;
  place-items: center;
  background: #0d1c26;
  flex-shrink: 0;
}

.brand-icon img {
  display: block;
  filter: brightness(1.15);
}

.brand-copy strong {
  display: block;
  font-size: 16px;
  font-weight: 600;
}

.brand-copy span {
  color: var(--text-muted);
  font-size: 12px;
}

.login-intro {
  max-width: 720px;
}

.login-intro h2 {
  margin: 0 0 12px;
  font-size: 42px;
  line-height: 1.05;
  font-weight: 650;
}

.login-intro p {
  margin: 0;
  max-width: 560px;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.55;
}

.login-panel {
  min-height: 100vh;
  background: rgba(13, 20, 27, 0.94);
  border-left: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 40px;
}

.login-card {
  width: 100%;
}

.login-card h1 {
  margin: 0 0 8px;
  font-size: 30px;
  font-weight: 600;
}

.login-card p {
  margin: 0 0 28px;
  color: var(--text-muted);
}

.field {
  display: grid;
  gap: 8px;
  margin-bottom: 16px;
}

.field label {
  font-size: 13px;
  color: var(--text-muted);
}

.input,
.select,
.textarea {
  min-height: 44px;
  width: 100%;
  color: var(--text);
  background: #17212b;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px 12px;
  outline: none;
  transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.textarea {
  min-height: 92px;
  resize: vertical;
}

.input:focus,
.select:focus,
.textarea:focus {
  border-color: rgba(41, 182, 246, 0.8);
  box-shadow: 0 0 0 3px rgba(41, 182, 246, 0.12);
}

.btn {
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 16px;
  border-radius: var(--radius);
  cursor: pointer;
  color: var(--text);
  background: var(--surface-2);
  transition: transform 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.btn:hover {
  transform: translateY(-1px);
  background: var(--hover);
}

.btn:active {
  transform: translateY(0);
}

.btn-primary {
  color: #071016;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  font-weight: 700;
}

.btn-primary:hover {
  background: linear-gradient(135deg, #45c3fa, #1bbbf3);
  box-shadow: 0 12px 28px rgba(41, 182, 246, 0.24);
}

.btn-danger {
  color: #fff;
  background: rgba(239, 83, 80, 0.18);
  border: 1px solid rgba(239, 83, 80, 0.38);
}

.btn-ghost {
  background: transparent;
  border: 1px solid var(--border);
}

.btn-sm {
  min-height: 34px;
  padding: 0 12px;
  font-size: 12px;
}

.icon-btn {
  width: 44px;
  min-width: 44px;
  height: 44px;
  padding: 0;
  display: inline-grid;
  place-items: center;
  border-radius: var(--radius);
  background: var(--card);
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid var(--border);
}

.icon-btn:hover {
  color: var(--text);
  background: var(--hover);
}

.icon-btn-sm {
  width: 30px;
  min-width: 30px;
  height: 30px;
  border-radius: 8px;
  font-size: 12px;
}

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

.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  width: var(--sidebar-width);
  background: var(--sidebar);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 20;
}

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

.profile-card {
  margin-top: 18px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.avatar {
  width: 40px;
  height: 40px;
  min-width: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--accent), var(--success));
  color: #071016;
  font-weight: 800;
  overflow: hidden;
}

.avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.profile-card strong,
.user-title {
  display: block;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profile-card span,
.user-subtitle {
  display: block;
  font-size: 12px;
  color: var(--text-meta);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.nav {
  padding: 12px;
  display: grid;
  gap: 4px;
  overflow: auto;
}

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

.nav-item:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.nav-item.active {
  color: var(--text);
  background: rgba(41, 182, 246, 0.12);
}

.nav-item.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 9px;
  bottom: 9px;
  width: 3px;
  border-radius: 3px;
  background: var(--accent);
}

.nav-icon {
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--accent);
  border: 1px solid rgba(41, 182, 246, 0.28);
  border-radius: 6px;
}

.sidebar-footer {
  margin-top: auto;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.main {
  grid-column: 2;
  min-width: 0;
}

.topbar {
  height: var(--topbar-height);
  position: sticky;
  top: 0;
  z-index: 12;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 24px;
  background: rgba(17, 26, 34, 0.92);
  border-bottom: 1px solid var(--border);
  backdrop-filter: blur(16px);
}

.menu-toggle {
  display: none;
}

.page-title {
  min-width: 150px;
}

.page-title h1 {
  margin: 0;
  font-size: 19px;
  font-weight: 600;
}

.page-title span {
  display: block;
  margin-top: 2px;
  color: var(--text-meta);
  font-size: 12px;
}

.search {
  flex: 1;
  max-width: 520px;
  position: relative;
}

.search .search-clear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  cursor: pointer;
  color: var(--text-meta);
  font-size: 16px;
  padding: 4px;
  border-radius: 50%;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.search .search-clear:hover {
  background: var(--border);
  color: var(--text);
}

.search input {
  padding-left: 40px;
  padding-right: 36px;
}

.search::before {
  content: "/";
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-meta);
  font-weight: 700;
}

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

.workspace {
  padding: 24px;
}

.section {
  display: grid;
  gap: 18px;
}

.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.toolbar h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.toolbar p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
}

.filter-bar .select,
.filter-bar .input {
  width: auto;
  min-width: 180px;
}

.card {
  border-radius: var(--radius);
  background: var(--card);
  border: 1px solid var(--border);
  box-shadow: 0 8px 26px rgba(0, 0, 0, 0.12);
}

.card-header {
  min-height: 52px;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border-bottom: 1px solid var(--border);
}

.card-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
}

.card-header span {
  color: var(--text-meta);
  font-size: 12px;
}

.card-body {
  padding: 16px;
}

.hero-chart {
  min-height: 320px;
}

.chart-canvas {
  width: 100%;
  height: 260px;
  display: block;
}

.chart-canvas-compact {
  height: 230px;
}

.chart-stats {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.chart-stats div {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.chart-stats span,
.legend-row span,
.bar-meta {
  color: var(--text-meta);
  font-size: 11px;
}

.chart-stats strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
  font-size: 14px;
}

.chart-panel {
  display: grid;
  gap: 12px;
}

.chart-legend {
  display: grid;
  gap: 7px;
}

.legend-row {
  min-width: 0;
  display: grid;
  grid-template-columns: 10px minmax(0, 1fr) auto;
  gap: 8px;
  align-items: center;
  padding: 8px 9px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.02);
}

.legend-row i {
  width: 10px;
  height: 10px;
  border-radius: 999px;
}

.legend-row div {
  min-width: 0;
}

.legend-row strong,
.legend-row span {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.legend-row strong {
  color: var(--text);
  font-size: 12px;
}

.legend-row b {
  color: var(--text);
  font-size: 12px;
}

.grid {
  display: grid;
  gap: 16px;
}

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

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

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

.tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 14px;
}

.deal-tile-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}

.entity-tile {
  min-width: 0;
  min-height: 238px;
  padding: 14px;
  display: grid;
  align-content: start;
  gap: 12px;
  border: 1px solid var(--border);
  border-left: 3px solid var(--tile-color, var(--accent));
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--tile-color, var(--accent)) 13%, transparent), transparent 58%),
    linear-gradient(180deg, rgba(34, 48, 60, 0.96), rgba(26, 38, 48, 0.96));
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.14);
  cursor: pointer;
  transition: transform 0.16s ease, border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
}

.entity-tile:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--tile-color, var(--accent)) 42%, var(--border));
  box-shadow: 0 18px 34px rgba(0, 0, 0, 0.22);
}

.entity-tile-head {
  min-width: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.entity-avatar {
  width: 42px;
  height: 42px;
  min-width: 42px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #071016;
  background: linear-gradient(135deg, var(--tile-color, var(--accent)), color-mix(in srgb, var(--tile-color, var(--accent)) 70%, #ffffff));
  font-size: 13px;
  font-weight: 800;
  overflow: hidden;
}

.entity-tile-main {
  min-width: 0;
  display: grid;
  gap: 5px;
}

.entity-tile-main strong,
.entity-tile-main span,
.tile-info span,
.tile-metric span,
.tile-metric small {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.entity-tile-main strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.25;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.entity-tile-main span {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.tile-info {
  min-height: 56px;
  padding: 9px 10px;
  display: grid;
  gap: 5px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.12);
}

.tile-info span {
  color: var(--text-muted);
  font-size: 12px;
  white-space: nowrap;
}

.tile-metric {
  min-height: 52px;
  padding: 10px 11px;
  display: grid;
  gap: 4px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.13);
}

.tile-metric span {
  color: var(--text);
  font-size: 18px;
  font-weight: 750;
  white-space: nowrap;
}

.tile-metric small {
  color: var(--text-meta);
  font-size: 11px;
  white-space: nowrap;
}

.deal-tile.overdue {
  --tile-color: var(--danger);
}

.deal-tile.high {
  --tile-color: var(--warning);
}

.deal-tile.won {
  --tile-color: var(--success);
}

.product-tile {
  min-height: 310px;
}

.product-media {
  height: 138px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(255, 179, 0, 0.16), rgba(41, 182, 246, 0.05)),
    rgba(0, 0, 0, 0.13);
  overflow: hidden;
}

.product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-media span {
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #071016;
  background: var(--warning);
  font-weight: 850;
}

.tile-footer-card {
  margin-top: 14px;
}

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

.kpi-card {
  min-height: 138px;
  padding: 16px;
  display: grid;
  align-content: space-between;
  overflow: hidden;
}

.kpi-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.kpi-icon {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: var(--radius);
  color: #071016;
  background: var(--accent);
  font-weight: 800;
}

.kpi-value {
  font-size: 27px;
  line-height: 1;
  font-weight: 700;
  margin: 10px 0 4px;
}

.kpi-label {
  color: var(--text-muted);
  font-size: 13px;
}

.delta {
  font-size: 12px;
  font-weight: 600;
}

.delta.up {
  color: var(--success);
}

.delta.down {
  color: var(--danger);
}

.sparkline {
  height: 24px;
  width: 100%;
  opacity: 0.9;
}

.kanban-wrap {
  display: grid;
  gap: 16px;
}

.kanban-hero {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto auto;
  align-items: center;
  gap: 16px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.035), rgba(255, 255, 255, 0.012));
}

.kanban-hero h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 650;
}

.kanban-hero p {
  margin: 4px 0 0;
  color: var(--text-muted);
  font-size: 13px;
}

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

.kanban-summary div {
  min-height: 54px;
  padding: 9px 11px;
  display: grid;
  align-content: center;
  gap: 3px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.028);
}

.kanban-summary strong {
  font-size: 15px;
  font-weight: 700;
  white-space: nowrap;
}

.kanban-summary span {
  color: var(--text-meta);
  font-size: 11px;
}

.kanban-board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(304px, 340px);
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  min-height: calc(100vh - 228px);
  scrollbar-color: var(--surface-2) transparent;
}

.kanban-column {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(18, 27, 35, 0.76);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.12);
}

.kanban-column.drag-over {
  outline: 2px solid color-mix(in srgb, var(--stage-color, var(--accent)) 70%, transparent);
  background: rgba(41, 182, 246, 0.055);
}

.kanban-head {
  padding: 12px 12px 10px;
  display: grid;
  gap: 9px;
  border-bottom: 1px solid var(--border);
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--stage-color, var(--accent)) 14%, transparent), transparent 70%),
    rgba(255, 255, 255, 0.018);
}

.kanban-head-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.kanban-head-main strong {
  min-width: 0;
  font-size: 14px;
  font-weight: 650;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.kanban-head-main span {
  min-width: 28px;
  height: 24px;
  padding: 0 8px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 12px;
  font-weight: 700;
}

.kanban-head-amount {
  color: var(--text-muted);
  font-size: 12px;
}

.kanban-stage-meter {
  height: 3px;
  border-radius: 99px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}

.kanban-stage-meter i {
  display: block;
  width: var(--stage-progress);
  height: 100%;
  border-radius: inherit;
  background: var(--stage-color, var(--accent));
}

.kanban-list {
  display: grid;
  align-content: start;
  gap: 9px;
  padding: 10px;
  overflow-y: auto;
}

.deal-card {
  border-radius: var(--radius);
  padding: 11px;
  display: grid;
  gap: 10px;
  background: linear-gradient(180deg, rgba(38, 54, 68, 0.96), rgba(31, 44, 56, 0.96));
  border: 1px solid var(--border);
  cursor: grab;
  transition: transform 0.16s ease, box-shadow 0.16s ease, border-color 0.16s ease, background 0.16s ease;
}

.deal-card:hover {
  transform: translateY(-1px);
  border-color: rgba(41, 182, 246, 0.36);
  background: linear-gradient(180deg, rgba(43, 60, 75, 0.98), rgba(34, 48, 60, 0.98));
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.22);
}

.deal-card.overdue {
  border-left: 3px solid var(--danger);
}

.deal-card.high {
  border-left: 3px solid var(--warning);
}

.deal-card.won {
  border-left: 3px solid var(--success);
}

.deal-card-top {
  min-width: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  align-items: start;
  gap: 10px;
}

.deal-card-top div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.deal-card-top strong,
.deal-card-top span {
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-card-top strong {
  color: var(--text);
  font-size: 14px;
  line-height: 1.25;
  font-weight: 650;
  overflow-wrap: anywhere;
}

.deal-card-top span {
  color: var(--text-meta);
  font-size: 12px;
  white-space: nowrap;
}

.deal-card-value {
  min-height: 32px;
  padding: 8px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.12);
}

.deal-card-value span:last-child {
  color: var(--text-meta);
  font-size: 12px;
  white-space: nowrap;
}

.deal-card-tags {
  gap: 6px;
}

.kanban-list .empty-state {
  min-height: 132px;
  padding: 16px;
}

.client-card {
  border-radius: var(--radius);
  padding: 9px 11px;
  display: grid;
  gap: 3px;
  background: linear-gradient(180deg, rgba(30, 45, 35, 0.96), rgba(24, 38, 28, 0.96));
  border: 1px solid rgba(100, 221, 23, 0.2);
  border-left: 3px solid #64DD17;
  cursor: grab;
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.client-card:hover {
  transform: translateY(-1px);
  border-color: rgba(100, 221, 23, 0.45);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
}

.client-card-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-card-company {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.client-card-contact {
  font-size: 11px;
  color: #64DD17;
  opacity: 0.85;
}

.client-card-owner {
  font-size: 10px;
  color: var(--text-muted);
  opacity: 0.7;
  margin-top: 2px;
}

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

.deal-title-row strong {
  min-width: 0;
  font-size: 14px;
  line-height: 1.25;
  overflow-wrap: anywhere;
}

.amount {
  font-weight: 700;
  color: var(--text);
  white-space: nowrap;
}

.meta-line {
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  min-width: 0;
}

.meta-line span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  min-width: 0;
}

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

.dictionary-header {
  align-items: flex-start;
}

.dictionary-header h3 {
  margin-bottom: 4px;
}

.dictionary-list {
  display: grid;
  gap: 8px;
}

.dictionary-item {
  min-height: 54px;
  display: grid;
  grid-template-columns: 12px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
}

.dictionary-item:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.035);
}

.dictionary-color {
  width: 10px;
  height: 26px;
  border-radius: 99px;
  box-shadow: 0 0 18px rgba(41, 182, 246, 0.16);
}

.dictionary-main {
  min-width: 0;
  display: grid;
  gap: 3px;
}

.dictionary-main strong,
.dictionary-main span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.dictionary-main strong {
  font-size: 13px;
  font-weight: 600;
}

.dictionary-main span {
  color: var(--text-meta);
  font-size: 11px;
}

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

.color-palette {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.color-swatch {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  cursor: pointer;
}

.color-swatch:hover {
  transform: translateY(-1px);
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
}

.check-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
}

.check-grid label {
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text-muted);
  font-size: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.check-grid label:hover {
  border-color: var(--border-strong);
  background: rgba(255, 255, 255, 0.03);
  transform: translateY(-1px);
}

.scroll-checks {
  max-height: 180px;
  overflow: auto;
}

.checklist-section {
  margin-top: 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(13, 20, 27, 0.34);
}

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 10px;
  align-items: center;
  margin-bottom: 12px;
}

.section-head strong {
  font-size: 14px;
}

.section-head .muted {
  grid-column: 1 / -1;
  color: var(--text-meta);
  font-size: 12px;
}

.section-head .full {
  grid-column: 1 / -1;
}

.progress-pill {
  min-height: 26px;
  padding: 0 10px;
  border: 1px solid rgba(41, 182, 246, 0.26);
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #8ee4ff;
  background: rgba(41, 182, 246, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.checklist-progress,
.deal-card-progress {
  height: 4px;
  border-radius: 999px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.07);
}

.checklist-progress i,
.deal-card-progress i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--accent), var(--success));
  box-shadow: 0 0 14px rgba(41, 182, 246, 0.24);
}

.checklist-list {
  display: grid;
  gap: 10px;
}

.checklist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.checklist-row.done {
  opacity: 0.86;
  border-color: rgba(100, 221, 23, 0.3);
  background: rgba(100, 221, 23, 0.055);
}

.checklist-main {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  cursor: pointer;
}

.checklist-main input[type="checkbox"] {
  appearance: none;
  width: 18px;
  min-width: 18px;
  height: 18px;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: rgba(13, 20, 27, 0.88);
  display: grid;
  place-items: center;
  cursor: pointer;
}

.checklist-main input[type="checkbox"]::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #071016;
  border-bottom: 2px solid #071016;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.12s ease;
}

.checklist-main input[type="checkbox"]:checked {
  border-color: rgba(100, 221, 23, 0.82);
  background: var(--success);
}

.checklist-main input[type="checkbox"]:checked::after {
  transform: rotate(-45deg) scale(1);
}

.checklist-main span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.checklist-main .input {
  min-width: 0;
  flex: 1;
}

.checklist-side {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.checklist-date {
  width: 150px;
}

.checklist-builder-row {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
    rgba(13, 20, 27, 0.28);
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.checklist-builder-row:hover {
  border-color: rgba(41, 182, 246, 0.3);
  box-shadow: 0 10px 26px rgba(0, 0, 0, 0.12);
}

.checklist-builder-row.dragging {
  opacity: 0.58;
  border-color: rgba(100, 221, 23, 0.52);
}

.checklist-drag {
  width: 28px;
  height: 38px;
  border-radius: 7px;
  color: var(--text-meta);
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.025);
  cursor: grab;
}

.checklist-builder-main {
  display: grid;
  gap: 8px;
  min-width: 0;
}

.checklist-builder-top {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 170px 112px 34px 34px;
  gap: 8px;
  align-items: center;
}

.checklist-title-input,
.checklist-type-select {
  min-height: 38px;
}

.checklist-builder-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  color: var(--text-meta);
  font-size: 11px;
}

.checklist-builder-meta span {
  min-height: 20px;
  padding: 2px 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
}

.checklist-builder-meta .required-dot {
  color: #c2ff66;
  background: rgba(100, 221, 23, 0.08);
}

.checklist-builder-details {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.13);
}

.checklist-builder-details.collapsed {
  display: none;
}

.checklist-builder-details .field {
  margin-bottom: 0;
}

.checklist-options {
  display: grid;
  gap: 8px;
}

.checklist-option {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 30px;
  gap: 8px;
}

.hidden {
  display: none !important;
}

.switch-line {
  min-height: 38px;
  padding: 0 8px;
  display: flex;
  align-items: center;
  gap: 7px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
  cursor: pointer;
}

.switch-line input {
  display: none;
}

.switch-line span {
  width: 30px;
  height: 16px;
  border-radius: 999px;
  padding: 2px;
  background: rgba(255, 255, 255, 0.1);
  transition: background 0.16s ease;
}

.switch-line span::after {
  content: "";
  width: 12px;
  height: 12px;
  display: block;
  border-radius: 50%;
  background: var(--text-meta);
  transition: transform 0.16s ease, background 0.16s ease;
}

.switch-line input:checked + span {
  background: rgba(100, 221, 23, 0.28);
}

.switch-line input:checked + span::after {
  transform: translateX(14px);
  background: var(--success);
  box-shadow: 0 0 12px rgba(100, 221, 23, 0.35);
}

.switch-line b {
  color: var(--text-muted);
  font-size: 11px;
  font-weight: 600;
}

.deal-checklist-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(160px, 230px);
  gap: 10px;
  align-items: center;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.018);
}

.deal-checklist-row.done {
  border-color: rgba(100, 221, 23, 0.28);
  background: rgba(100, 221, 23, 0.045);
}

.deal-checklist-row.invalid {
  border-color: rgba(255, 82, 82, 0.6);
  background: rgba(255, 82, 82, 0.075);
  box-shadow: 0 0 0 1px rgba(255, 82, 82, 0.08), 0 0 24px rgba(255, 82, 82, 0.08);
}

.deal-checklist-label {
  min-width: 0;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr);
  gap: 9px;
  align-items: center;
}

.check-icon {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: var(--item-color, #8ee4ff);
  border: 1px solid color-mix(in srgb, var(--item-color, var(--accent)) 40%, transparent);
  background: color-mix(in srgb, var(--item-color, var(--accent)) 10%, transparent);
  font-size: 13px;
  font-weight: 800;
}

.deal-checklist-label strong,
.deal-checklist-label small {
  display: block;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deal-checklist-label strong {
  font-size: 13px;
}

.deal-checklist-label small {
  margin-top: 3px;
  color: var(--text-meta);
  font-size: 11px;
}

.compact-input {
  min-height: 38px;
  margin: 0;
}

.checklist-file-control {
  min-width: 0;
}

.checklist-file-drop {
  min-height: 40px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 8px;
  align-items: center;
  border: 1px dashed rgba(41, 182, 246, 0.34);
  border-radius: 8px;
  color: var(--text-muted);
  background: rgba(41, 182, 246, 0.045);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.checklist-file-drop:hover,
.checklist-file-drop.drag-over {
  border-color: rgba(41, 182, 246, 0.74);
  background: rgba(41, 182, 246, 0.09);
  box-shadow: 0 0 18px rgba(41, 182, 246, 0.12);
}

.checklist-file-drop input {
  display: none;
}

.checklist-file-drop b {
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  color: #8ee4ff;
  background: rgba(41, 182, 246, 0.12);
}

.checklist-file-drop span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 12px;
}

textarea.compact-input {
  min-height: 58px;
}

.deal-check-toggle {
  justify-self: end;
  display: flex;
  align-items: center;
}

.deal-check-toggle span {
  width: 42px;
  height: 24px;
  padding: 3px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: rgba(13, 20, 27, 0.88);
  cursor: pointer;
}

.deal-check-toggle span::after {
  content: "";
  width: 16px;
  height: 16px;
  display: block;
  border-radius: 50%;
  background: var(--text-meta);
  transition: transform 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.deal-check-toggle input {
  display: none;
}

.deal-check-toggle input:checked + span::after {
  transform: translateX(18px);
  background: var(--success);
  box-shadow: 0 0 14px rgba(100, 221, 23, 0.36);
}

.deal-card-checklist {
  display: grid;
  gap: 7px;
  padding: 8px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(13, 20, 27, 0.22);
  transition: border-color 0.16s ease, background 0.16s ease;
}

.deal-card-checklist.saving {
  border-color: rgba(41, 182, 246, 0.42);
  background: rgba(41, 182, 246, 0.055);
}

.deal-card-checklist-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: var(--text-meta);
  font-size: 11px;
}

.deal-card-checklist-head strong {
  color: var(--text);
  font-size: 12px;
}

.deal-card-checklist-list {
  display: grid;
  gap: 5px;
  max-height: 190px;
  overflow-y: auto;
  padding-right: 2px;
}

.mini-check {
  min-width: 0;
  min-height: 30px;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) minmax(76px, 116px);
  align-items: center;
  gap: 7px;
  padding: 5px 6px;
  border-radius: 7px;
  color: var(--text-muted);
  font-size: 11px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid transparent;
  transition: border-color 0.16s ease, background 0.16s ease, color 0.16s ease;
}

.mini-check:hover {
  color: var(--text);
  border-color: rgba(255, 255, 255, 0.07);
  background: rgba(255, 255, 255, 0.04);
}

.mini-check.done:not(.data) > span {
  color: var(--text-meta);
  text-decoration: line-through;
}

.mini-check span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-check b {
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  color: #8ee4ff;
  background: rgba(41, 182, 246, 0.08);
  font-size: 12px;
  font-weight: 700;
}

.mini-check-toggle {
  width: 20px;
  height: 20px;
  padding: 0;
  border: 0;
  background: transparent;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.mini-check-toggle span {
  width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  border-radius: 5px;
  border: 1px solid var(--border-strong);
  background: rgba(13, 20, 27, 0.88);
  cursor: pointer;
  transition: border-color 0.16s ease, background 0.16s ease, box-shadow 0.16s ease;
}

.mini-check-toggle span::after {
  content: "";
  width: 9px;
  height: 5px;
  border-left: 2px solid #071016;
  border-bottom: 2px solid #071016;
  transform: rotate(-45deg) scale(0);
  transition: transform 0.12s ease;
}

.mini-check-toggle[data-checked="1"] span {
  border-color: rgba(100, 221, 23, 0.82);
  background: var(--success);
  box-shadow: 0 0 12px rgba(100, 221, 23, 0.22);
}

.mini-check-toggle[data-checked="1"] span::after {
  transform: rotate(-45deg) scale(1);
}

.mini-check-input {
  width: 100%;
  min-width: 72px;
  max-width: 112px;
  min-height: 24px;
  padding: 2px 6px;
  border: 1px solid rgba(143, 163, 184, 0.2);
  border-radius: 6px;
  color: var(--text);
  background: rgba(5, 10, 14, 0.36);
  font: inherit;
  font-size: 10px;
  outline: none;
}

.mini-check-input:focus {
  border-color: rgba(41, 182, 246, 0.72);
  box-shadow: 0 0 0 2px rgba(41, 182, 246, 0.1);
}

.mini-check-input[multiple] {
  min-height: 42px;
}

.mini-check-textarea {
  resize: vertical;
  min-height: 34px;
  max-height: 70px;
}

.mini-check-file {
  min-width: 0;
  max-width: 118px;
  min-height: 24px;
  display: flex;
  align-items: center;
  padding: 2px 7px;
  border: 1px dashed rgba(41, 182, 246, 0.3);
  border-radius: 6px;
  background: rgba(41, 182, 246, 0.055);
  cursor: pointer;
}

.mini-check-file:hover {
  border-color: rgba(41, 182, 246, 0.62);
}

.mini-check-file input {
  display: none;
}

.mini-check-file small {
  color: #8ee4ff;
  font-size: 10px;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mini-check-more {
  color: var(--text-meta);
  font-size: 11px;
  padding-left: 25px;
}

.dropzone {
  min-height: 116px;
  display: grid;
  align-content: center;
  gap: 8px;
  padding: 18px;
  border: 1px dashed rgba(41, 182, 246, 0.5);
  border-radius: 14px;
  background:
    linear-gradient(180deg, rgba(41, 182, 246, 0.08), rgba(255, 255, 255, 0.02)),
    rgba(255, 255, 255, 0.02);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.16s ease, background 0.16s ease, transform 0.16s ease;
}

.dropzone strong {
  font-size: 15px;
}

.dropzone span {
  color: var(--text-meta);
  font-size: 12px;
}

.dropzone:hover,
.dropzone.drag-over {
  transform: translateY(-1px);
  border-color: rgba(41, 182, 246, 0.8);
  background:
    linear-gradient(180deg, rgba(41, 182, 246, 0.12), rgba(255, 255, 255, 0.04)),
    rgba(255, 255, 255, 0.03);
}

.file-summary {
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.018);
  font-size: 12px;
  word-break: break-word;
}

.notice.warning {
  margin-top: 10px;
  padding: 12px 14px;
  border: 1px solid rgba(255, 179, 0, 0.3);
  border-radius: 12px;
  color: #ffd36c;
  background: rgba(255, 179, 0, 0.08);
}

.table-footer {
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  border-top: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.015);
}

.page-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--text-muted);
  font-size: 12px;
}

.pager {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.pager .field {
  margin-bottom: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}

.pager .field span {
  white-space: nowrap;
}

.chip {
  max-width: 100%;
  min-width: 0;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.chip.cyan {
  color: #8ee4ff;
  border-color: rgba(41, 182, 246, 0.36);
  background: rgba(41, 182, 246, 0.1);
}

.chip.green {
  color: #c2ff66;
  border-color: rgba(100, 221, 23, 0.32);
  background: rgba(100, 221, 23, 0.1);
}

.chip.amber {
  color: #ffd36c;
  border-color: rgba(255, 179, 0, 0.32);
  background: rgba(255, 179, 0, 0.1);
}

.chip.red {
  color: #ffaaa8;
  border-color: rgba(239, 83, 80, 0.32);
  background: rgba(239, 83, 80, 0.1);
}

.chip-button {
  cursor: pointer;
}

.chip-button:hover {
  border-color: rgba(41, 182, 246, 0.68);
  background: rgba(41, 182, 246, 0.18);
}

.quick-actions {
  margin-top: 10px;
  display: flex;
  gap: 6px;
  opacity: 0.72;
}

.deal-card:hover .quick-actions {
  opacity: 1;
}

.quick-actions button {
  width: 32px;
  height: 32px;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--text-muted);
  cursor: pointer;
  border: 1px solid var(--border);
}

.quick-actions button:hover {
  color: var(--text);
  background: var(--hover);
}

.row-actions {
  display: inline-flex;
  gap: 6px;
}

.table-card {
  overflow: hidden;
}

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

.data-table th,
.data-table td {
  padding: 13px 14px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 13px;
  vertical-align: middle;
}

.data-table th {
  position: sticky;
  top: 0;
  z-index: 2;
  color: var(--text-meta);
  background: var(--card);
  font-weight: 600;
}

.data-table tr:hover td {
  background: rgba(255, 255, 255, 0.025);
}

.mobile-list {
  display: none;
}

.list-stack {
  display: grid;
  gap: 10px;
}

.list-item {
  padding: 12px;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--card);
}

.readonly-line {
  min-height: 44px;
  display: flex;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-muted);
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.mail-shell {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 16px;
}

.mail-sidebar {
  display: grid;
  align-content: start;
  gap: 8px;
}

.mail-sidebar button {
  min-height: 46px;
  padding: 0 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: var(--text-muted);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}

.mail-sidebar button.active {
  color: var(--text);
  border-color: rgba(41, 182, 246, 0.36);
  background: rgba(41, 182, 246, 0.1);
}

.mail-list {
  display: grid;
  gap: 10px;
}

.mail-item {
  padding: 14px;
  display: grid;
  gap: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--card);
  cursor: pointer;
}

.mail-item.unread {
  border-left: 3px solid var(--accent);
  background: linear-gradient(90deg, rgba(41, 182, 246, 0.08), var(--card) 46%);
}

.mail-item-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
}

.mail-item-head div {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.mail-item-head strong,
.mail-item-head span,
.mail-item p {
  overflow: hidden;
  text-overflow: ellipsis;
}

.mail-item-head strong {
  font-size: 14px;
}

.mail-item-head span,
.mail-item-head time,
.mail-item p {
  color: var(--text-muted);
  font-size: 12px;
}

.mail-item-head span,
.mail-item p {
  white-space: nowrap;
}

.mail-item p {
  margin: 0;
}

.mail-reader {
  display: grid;
  gap: 14px;
}

.mail-reader-meta {
  display: grid;
  gap: 6px;
  color: var(--text-muted);
  font-size: 12px;
}

.mail-quote {
  padding: 10px 12px;
  text-align: left;
  color: #8ee4ff;
  border: 1px solid rgba(41, 182, 246, 0.32);
  border-radius: var(--radius);
  background: rgba(41, 182, 246, 0.08);
  cursor: pointer;
}

.mail-quote:hover {
  border-color: rgba(41, 182, 246, 0.68);
}

.mail-body-text {
  white-space: pre-wrap;
  line-height: 1.55;
}

.mail-compose-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 16px;
}

.mail-compose-main,
.mail-compose-side {
  min-width: 0;
  display: grid;
  align-content: start;
  gap: 12px;
}

.mail-search-results {
  max-height: 300px;
  overflow: auto;
  display: grid;
  align-content: start;
  gap: 6px;
  padding: 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.018);
}

.quote-results {
  max-height: 430px;
}

.mail-result {
  min-width: 0;
  display: grid;
  gap: 3px;
  padding: 10px;
  text-align: left;
  color: var(--text);
  background: transparent;
  border: 1px solid transparent;
  border-radius: 7px;
  cursor: pointer;
}

.mail-result:hover {
  background: rgba(255, 255, 255, 0.04);
  border-color: var(--border);
}

.mail-result strong,
.mail-result span {
  min-width: 0;
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mail-result span {
  color: var(--text-meta);
  font-size: 11px;
}

.mail-selected,
.mail-selected-quote {
  min-height: 38px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mail-token {
  max-width: 100%;
  min-height: 32px;
  padding: 5px 9px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
  background: rgba(41, 182, 246, 0.1);
  border: 1px solid rgba(41, 182, 246, 0.32);
  border-radius: 999px;
  cursor: pointer;
}

.mail-token span {
  color: var(--text-meta);
  font-size: 11px;
}

.mail-empty-inline {
  min-height: 32px;
  display: inline-flex;
  align-items: center;
  color: var(--text-meta);
  font-size: 12px;
}

.mail-compose-body {
  min-height: 280px;
}

.mail-compose-footer {
  margin-top: 14px;
  display: flex;
  justify-content: flex-end;
}

.employee-card .card-body {
  display: grid;
  gap: 10px;
}

.employee-head {
  min-width: 0;
  min-height: 66px;
  padding: 12px;
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}

.employee-main {
  min-width: 0;
}

.employee-main strong,
.employee-main span,
.employee-role {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.employee-main strong {
  font-size: 14px;
  font-weight: 600;
}

.employee-main span,
.employee-role {
  color: var(--text-meta);
  font-size: 12px;
}

.employee-chips,
.employee-actions {
  align-items: center;
}

.automation-rule {
  display: grid;
  gap: 10px;
}

.automation-title-row {
  align-items: flex-start;
}

.automation-title-row .chip {
  flex: 0 0 auto;
}

.automation-meta {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  margin-top: 0;
}

.automation-meta span:last-child {
  flex: 0 0 auto;
  color: var(--text-meta);
}

.automation-chips .chip {
  max-width: min(100%, 280px);
}

.automation-actions {
  margin-top: 0;
}

.split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 16px;
}

.stat-bars {
  display: grid;
  gap: 12px;
}

.bar-row {
  display: grid;
  gap: 6px;
}

.bar-label {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--text-muted);
  font-size: 13px;
}

.bar-label span,
.bar-label strong {
  min-width: 0;
}

.bar-label span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar-track {
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), var(--success));
}

.bar-meta {
  display: flex;
  justify-content: space-between;
  gap: 8px;
}

.drawer-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  background: rgba(0, 0, 0, 0.5);
}

.drawer-backdrop.open {
  display: block;
}

.drawer {
  position: fixed;
  z-index: 50;
  top: 0;
  right: 0;
  width: min(520px, 100vw);
  height: 100vh;
  background: var(--topbar);
  border-left: 1px solid var(--border);
  box-shadow: var(--shadow);
  transform: translateX(102%);
  transition: transform 0.22s ease;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
}

.drawer-wide {
  width: min(980px, 100vw);
}

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

.drawer-head {
  min-height: 64px;
  padding: 0 18px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
}

.drawer-head h3 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
}

.drawer-body {
  padding: 18px;
  overflow: auto;
}

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

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

.graph-layout {
  min-height: calc(100vh - 112px);
  display: grid;
  grid-template-columns: minmax(0, 1fr) 280px;
  gap: 16px;
}

.graph-workspace {
  min-width: 0;
  display: grid;
  grid-template-rows: auto minmax(520px, 1fr);
  gap: 12px;
}

.graph-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.client-graph-canvas {
  position: relative;
  min-height: 520px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background:
    linear-gradient(rgba(234, 240, 246, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(234, 240, 246, 0.035) 1px, transparent 1px),
    #17212b;
  background-size: 28px 28px;
}

.graph-edges {
  position: absolute;
  inset: 0;
  width: 1200px;
  height: 760px;
  pointer-events: none;
  overflow: visible;
}

.graph-edges path {
  fill: none;
  stroke: rgba(41, 182, 246, 0.72);
  stroke-width: 2.5;
}

.graph-node {
  position: absolute;
  width: 220px;
  min-height: 84px;
  padding: 10px 12px;
  display: grid;
  gap: 5px;
  text-align: left;
  color: var(--text);
  background: var(--card-2);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.22);
  cursor: grab;
  user-select: none;
}

.graph-node:active {
  cursor: grabbing;
}

.graph-node.selected {
  outline: 2px solid rgba(41, 182, 246, 0.72);
}

.graph-node.connect-from {
  outline: 2px solid rgba(100, 221, 23, 0.78);
}

.graph-node.date {
  border-left: 4px solid var(--accent);
}

.graph-node.text {
  border-left: 4px solid var(--warning);
}

.graph-node.action {
  border-left: 4px solid var(--success);
}

.graph-node span {
  color: var(--text-meta);
  font-size: 11px;
  text-transform: uppercase;
}

.graph-node strong,
.graph-node small {
  overflow: hidden;
  text-overflow: ellipsis;
}

.graph-node strong {
  font-size: 14px;
}

.graph-node small {
  display: -webkit-box;
  color: var(--text-muted);
  font-size: 12px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.graph-inspector {
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.025);
}

.toast-root {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  gap: 10px;
}

.toast {
  min-width: 260px;
  max-width: 360px;
  border-radius: var(--radius);
  padding: 12px 14px;
  background: #17212b;
  color: var(--text);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow);
}

.toast.error {
  border-color: rgba(239, 83, 80, 0.45);
}

.toast.success {
  border-color: rgba(100, 221, 23, 0.45);
}

.skeleton {
  min-height: 120px;
  border-radius: var(--radius);
  background: linear-gradient(90deg, #1e2a35, #263644, #1e2a35);
  background-size: 240% 100%;
  animation: shimmer 1.2s linear infinite;
}

@keyframes shimmer {
  to {
    background-position: -240% 0;
  }
}

.empty-state {
  min-height: 220px;
  display: grid;
  place-items: center;
  text-align: center;
  color: var(--text-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.02);
}

.bottom-nav {
  display: none;
}

.stage-tabs {
  display: none;
}

@media (max-width: 1199px) {
  :root {
    --sidebar-width: 76px;
  }

  .sidebar {
    width: var(--sidebar-width);
  }

  .sidebar .brand-copy,
  .profile-card div,
  .nav-item span:not(.nav-icon),
  .sidebar-footer {
    display: none;
  }

  .profile-card {
    justify-content: center;
    padding: 8px;
  }

  .nav-item {
    justify-content: center;
    padding: 0;
  }

  .nav-item.active::before {
    top: 8px;
    bottom: 8px;
  }

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

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

@media (max-width: 767px) {
  :root {
    --sidebar-width: 0px;
    --topbar-height: 58px;
  }

  .login-shell {
    grid-template-columns: 1fr;
  }

  .login-visual {
    min-height: 36vh;
    padding: 28px 18px;
  }

  .login-intro h2 {
    font-size: 28px;
  }

  .login-panel {
    min-height: 64vh;
    padding: 24px 18px calc(24px + env(safe-area-inset-bottom));
    border-left: 0;
  }

  .app-shell {
    display: block;
    padding-bottom: calc(68px + env(safe-area-inset-bottom));
  }

  .sidebar {
    width: min(86vw, 320px);
    transform: translateX(-102%);
    transition: transform 0.22s ease;
  }

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

  .sidebar .brand-copy,
  .profile-card div,
  .nav-item span:not(.nav-icon),
  .sidebar-footer {
    display: block;
  }

  .nav-item {
    justify-content: flex-start;
    padding: 0 12px;
  }

  .main {
    grid-column: auto;
  }

  .topbar {
    padding: 0 12px;
    gap: 8px;
  }

  .menu-toggle {
    display: inline-grid;
  }

  .page-title {
    min-width: 0;
    flex: 1;
  }

  .page-title h1 {
    font-size: 16px;
  }

  .page-title span,
  .search,
  .topbar-actions .desktop-only {
    display: none;
  }

  .workspace {
    padding: 12px;
  }

  .toolbar {
    align-items: flex-start;
    flex-direction: column;
  }

  .toolbar .btn {
    width: 100%;
  }

  .kanban-hero {
    grid-template-columns: 1fr;
    align-items: stretch;
  }

  .kanban-summary {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .kanban-summary strong {
    font-size: 13px;
  }

  .grid,
  .grid-2,
  .grid-3,
  .grid-4,
  .kpi-grid,
  .mail-shell,
  .split {
    grid-template-columns: 1fr;
  }

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

  .chart-canvas {
    height: 210px;
  }

  .chart-stats {
    grid-template-columns: 1fr;
  }

  .stage-tabs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 6px;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: rgba(13, 20, 27, 0.36);
  }

  .stage-tab {
    min-height: 40px;
    padding: 0 14px;
    border-radius: 7px;
    border: 1px solid var(--border);
    color: var(--text-muted);
    background: rgba(255, 255, 255, 0.025);
    white-space: nowrap;
    cursor: pointer;
  }

  .stage-tab.active {
    color: #071016;
    border-color: transparent;
    background: linear-gradient(135deg, var(--accent), var(--success));
    font-weight: 700;
  }

  .kanban-board {
    display: block;
    overflow: visible;
    min-height: 0;
  }

  .kanban-column {
    display: none;
    margin-bottom: 12px;
  }

  .kanban-column.active-mobile {
    display: flex;
  }

  .data-table {
    display: none;
  }

  .mobile-list {
    display: grid;
    gap: 10px;
  }

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

  .checklist-builder-top,
  .deal-checklist-row {
    grid-template-columns: 1fr;
  }

  .checklist-builder-top .icon-btn,
  .deal-check-toggle {
    justify-self: start;
  }

  .checklist-builder-details {
    grid-template-columns: 1fr;
  }

  .graph-layout {
    min-height: 0;
    grid-template-columns: 1fr;
  }

  .graph-workspace {
    grid-template-rows: auto minmax(420px, 1fr);
  }

  .client-graph-canvas {
    min-height: 420px;
  }

  .drawer {
    top: auto;
    right: 0;
    bottom: 0;
    width: 100vw;
    height: min(88vh, 720px);
    border-left: 0;
    border-top: 1px solid var(--border);
    border-radius: 8px 8px 0 0;
    transform: translateY(102%);
  }

  .drawer.open {
    transform: translateY(0);
  }

  .bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 30;
    height: calc(64px + env(safe-area-inset-bottom));
    padding: 6px 8px env(safe-area-inset-bottom);
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 4px;
    background: rgba(13, 20, 27, 0.94);
    border-top: 1px solid var(--border);
    backdrop-filter: blur(16px);
  }

  .bottom-nav button {
    min-height: 52px;
    display: grid;
    place-items: center;
    gap: 2px;
    color: var(--text-muted);
    background: transparent;
    border-radius: var(--radius);
    font-size: 11px;
  }

  .bottom-nav button.active {
    color: var(--accent);
    background: rgba(41, 182, 246, 0.1);
  }

  .toast-root {
    left: 12px;
    right: 12px;
    bottom: calc(78px + env(safe-area-inset-bottom));
  }

  .toast {
    min-width: 0;
    max-width: none;
  }
}

/* ── Mobile wall ─────────────────────────────────────────────────────────── */
#mobile-wall {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  padding: 32px 24px;
}

.mobile-wall-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  max-width: 320px;
  text-align: center;
}

.mobile-wall-logo {
  width: 72px;
  height: 72px;
  border-radius: 16px;
  background: #0d1c26;
  display: grid;
  place-items: center;
  margin-bottom: 4px;
}

.mobile-wall-brand {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

.mobile-wall-icon {
  font-size: 40px;
  line-height: 1;
  margin: 4px 0;
}

.mobile-wall-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--text);
  margin: 0;
}

.mobile-wall-text {
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-muted);
  margin: 0;
}
