:root {
  --sidebar-bg: #2f2455;
  --sidebar-active: #7154d7;
  --surface: #f5f6f8;
  --card: #ffffff;
  --line: #dfe3ea;
  --text: #1d2433;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Arial, sans-serif;
  background: var(--surface);
  color: var(--text);
}

.crm-shell {
  display: grid;
  grid-template-columns: 56px 1fr;
  min-height: 100vh;
}

.crm-sidebar {
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 10px;
}

.crm-logo {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--sidebar-bg);
  font-weight: 700;
  margin-bottom: 14px;
}

.crm-side-item {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: #d6d7f5;
  display: grid;
  place-items: center;
  text-decoration: none;
  margin-bottom: 8px;
}

.crm-side-item:hover,
.crm-side-item.active {
  background: var(--sidebar-active);
  color: #fff;
}

.crm-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.crm-topbar {
  height: 56px;
  display: grid;
  grid-template-columns: 220px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 0 14px;
  border-bottom: 1px solid var(--line);
  background: #fff;
}

.crm-breadcrumb {
  font-size: 14px;
  font-weight: 600;
}

.crm-search-wrap {
  max-width: 420px;
}

.crm-search {
  height: 34px;
  border-radius: 999px;
  font-size: 13px;
}

.crm-user {
  text-align: right;
  font-size: 12px;
}

.crm-content {
  padding: 14px;
}

.crm-table-wrap {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: auto;
}

.crm-table-wrap table {
  min-width: 1060px;
}

.crm-table-wrap thead th {
  position: sticky;
  top: 0;
  background: #f7f8fa;
  z-index: 1;
  font-size: 12px;
  font-weight: 600;
  border-bottom: 1px solid var(--line);
}

.crm-table-wrap tbody td {
  font-size: 12px;
  border-top: 1px solid #eef0f4;
}

.board-scroll {
  overflow-x: auto;
  padding-bottom: 6px;
}

.board-grid {
  min-width: 1020px;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 10px;
}

.board-column {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f1f2f5;
  min-height: 260px;
  display: flex;
  flex-direction: column;
}

.board-column-header {
  padding: 10px;
  border-bottom: 1px solid var(--line);
}

.board-column-header h3 {
  margin: 0;
  font-size: 15px;
  font-weight: 700;
}

.board-column-header span {
  font-size: 12px;
  color: #5d6473;
}

.deal-dropzone {
  padding: 8px;
  display: grid;
  gap: 8px;
  min-height: 180px;
}

.deal-card {
  border: 1px solid #ccd3df;
  background: var(--card);
  border-radius: 8px;
  padding: 8px;
  cursor: grab;
}

.deal-card.sortable-ghost {
  opacity: 0.4;
}

.deal-title {
  display: block;
  color: #1a2230;
  text-decoration: none;
  font-size: 13px;
  font-weight: 700;
  line-height: 1.3;
}

.deal-title:hover {
  text-decoration: underline;
}

.deal-meta {
  font-size: 11px;
  color: #5f6674;
  line-height: 1.3;
}

.deal-value {
  margin-top: 4px;
  font-size: 12px;
  font-weight: 700;
}

.deal-empty {
  border: 1px dashed #c2c9d8;
  border-radius: 8px;
  padding: 8px;
  font-size: 12px;
  color: #758097;
  text-align: center;
}

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

.timeline-item {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 8px;
}

.login-page {
  min-height: 100vh;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at top right, #ebf3ff, #f4f6fa 45%);
}

.login-card {
  width: min(420px, calc(100vw - 24px));
}

@media (max-width: 860px) {
  .crm-topbar {
    grid-template-columns: 1fr;
    height: auto;
    padding: 10px;
  }

  .crm-search-wrap {
    max-width: 100%;
  }

  .crm-user {
    text-align: left;
  }
}
