/*!*****************************************************************************************************************************************************************************************************************************************************************!*\
  !*** css ./node_modules/next/dist/build/webpack/loaders/css-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[2]!./node_modules/next/dist/build/webpack/loaders/postcss-loader/src/index.js??ruleSet[1].rules[14].oneOf[12].use[3]!./src/app/globals.css ***!
  \*****************************************************************************************************************************************************************************************************************************************************************/
:root {
  --bg: #f4f6f8;
  --ink: #182230;
  --muted: #667085;
  --line: #d7dde5;
  --panel: #ffffff;
  --panel-soft: #eef2f6;
  --blue: #2454a6;
  --blue-soft: #e8eef8;
  --green: #2f855a;
  --amber: #b7791f;
  --red: #c53030;
  --teal: #2c7a7b;
  --shadow: 0 10px 30px rgba(16, 24, 40, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

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

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

button,
input,
select,
textarea {
  max-width: 100%;
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 3px solid rgba(36, 84, 166, 0.18);
  outline-offset: 2px;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 28px;
  line-height: 1.18;
  letter-spacing: 0;
}

h2 {
  font-size: 18px;
  line-height: 1.25;
  letter-spacing: 0;
}

p,
strong,
span,
small,
td,
th,
dt,
dd,
button,
input,
select,
textarea {
  overflow-wrap: anywhere;
}

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

.sidebar {
  position: -webkit-sticky;
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  background: #ffffff;
  border-right: 1px solid var(--line);
  padding: 20px;
  overflow-y: auto;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  min-width: 0;
}

.brandMark {
  width: 38px;
  height: 38px;
  display: grid;
  flex: 0 0 38px;
  place-items: center;
  border-radius: 8px;
  background: var(--blue);
  color: white;
  font-weight: 800;
}

.brand strong {
  display: block;
  line-height: 1.2;
}

.brand span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-top: 2px;
}

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

nav button {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 10px;
  border-radius: 8px;
  color: var(--muted);
  text-align: left;
  transition: background 140ms ease, color 140ms ease;
}

nav button svg {
  flex: 0 0 auto;
}

nav button:hover {
  background: #f4f7fb;
  color: var(--ink);
}

nav button.active {
  color: var(--ink);
  background: var(--blue-soft);
}

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

.topbar {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}

.topbar > div {
  min-width: 0;
}

.topbar p {
  color: var(--muted);
  margin-top: 5px;
  max-width: 820px;
}

.topbarActions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 10px;
  flex: 0 0 auto;
}

.profileMenu {
  position: relative;
}

.profileButton {
  min-height: 42px;
  min-width: 220px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 10px;
  color: var(--ink);
  text-align: left;
}

.profileButton > span:not(.avatar) {
  display: grid;
  grid-gap: 1px;
  gap: 1px;
  min-width: 0;
  flex: 1 1;
}

.profileButton strong,
.profileButton small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.profileButton small {
  color: var(--muted);
  font-size: 12px;
}

.avatar {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  flex: 0 0 34px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
  overflow: hidden;
}

.avatar.small {
  width: 24px;
  height: 24px;
  flex-basis: 24px;
  border-radius: 7px;
  font-size: 12px;
}

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

.userInline {
  display: inline-flex;
  align-items: center;
  justify-content: inherit;
  gap: 7px;
  max-width: 100%;
  min-width: 0;
}

.userInline > span:last-child {
  min-width: 0;
  overflow-wrap: anywhere;
}

.avatarEditor {
  display: flex;
  align-items: center;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.avatarEditor .avatar {
  width: 54px;
  height: 54px;
  flex-basis: 54px;
}

.avatarEditor > div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.avatarEditor input {
  display: none;
}

.profileDropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 20;
  width: min(360px, calc(100vw - 32px));
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: var(--shadow);
}

.profileDropdown header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.profileDropdown header div {
  display: grid;
  grid-gap: 3px;
  gap: 3px;
  min-width: 0;
}

.profileDropdown header span,
.profileMeta span {
  color: var(--muted);
  font-size: 13px;
}

.profileDropdown label,
.userCreatePanel label {
  display: grid;
  grid-gap: 6px;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
}

.profileDropdown input,
.userCreatePanel input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 10px 11px;
  color: var(--ink);
}

.passwordField {
  position: relative;
  display: block;
}

.passwordField input {
  padding-right: 44px;
}

.passwordField button {
  position: absolute;
  top: 50%;
  right: 7px;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
}

.passwordField button:hover {
  background: var(--panel-soft);
  color: var(--ink);
}

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

.profileMeta span {
  min-height: 28px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 8px;
  background: var(--panel-soft);
}

.profileActions {
  display: flex;
  gap: 8px;
}

.iconButton,
.primaryButton,
.secondaryButton {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  min-height: 38px;
  padding: 0 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  line-height: 1.2;
  transition: border-color 140ms ease, background 140ms ease, box-shadow 140ms ease;
}

.iconButton {
  width: 38px;
  flex: 0 0 38px;
  padding: 0;
}

.iconButton svg,
.primaryButton svg,
.secondaryButton svg {
  flex: 0 0 auto;
}

.primaryButton {
  background: var(--blue);
  color: white;
  border-color: var(--blue);
}

.primaryButton:hover:not(:disabled) {
  background: #1d478d;
}

.secondaryButton:hover,
.iconButton:hover:not(:disabled) {
  border-color: #b8c2d0;
  background: #f8fafc;
}

.iconButton.active {
  border-color: rgba(29, 78, 216, 0.35);
  background: var(--blue-soft);
  color: var(--blue);
}

.loginPanel,
.taskPanel,
.quickTaskForm,
.employeesPanel,
.calendarToolbar,
.calendarBoard,
.calendarAgenda,
.dayPanel,
.eventForm,
.taskFormModal,
.taskModal {
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.loginPanel {
  display: grid;
  grid-gap: 14px;
  gap: 14px;
  max-width: 460px;
}

label {
  display: grid;
  grid-gap: 6px;
  gap: 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.25;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 10px;
  color: var(--ink);
  background: white;
  min-width: 0;
}

input,
select {
  height: 38px;
}

textarea {
  min-height: 86px;
  padding-top: 9px;
  resize: vertical;
}

.error {
  background: #fff5f5;
  color: var(--red);
  border: 1px solid #f6caca;
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 16px;
}

.metrics,
.leadMetrics,
.taskMetrics {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  grid-gap: 12px;
  gap: 12px;
  margin-bottom: 16px;
}

.taskMetrics {
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}

.metrics div,
.leadMetrics div,
.taskMetrics div,
.taskMetrics button {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
  text-align: left;
  box-shadow: 0 6px 18px rgba(16, 24, 40, 0.04);
}

.taskMetrics button {
  color: var(--ink);
}

.taskMetrics button.selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue), 0 6px 18px rgba(16, 24, 40, 0.04);
}

.taskMetrics .danger strong,
.rowOverdue td,
.taskMiniCard.overdue span {
  color: var(--red);
}

.metrics span,
.leadMetrics span,
.taskMetrics span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.metrics strong,
.leadMetrics strong,
.taskMetrics strong {
  display: block;
  font-size: 26px;
  line-height: 1.1;
  margin-top: 6px;
}

.leadsPage {
  min-width: 0;
}

.leadsList {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
}

.leadCard,
.emptyState {
  min-width: 0;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 16px;
  box-shadow: var(--shadow);
}

.leadCard {
  display: grid;
  grid-gap: 14px;
  gap: 14px;
}

.leadCardTop,
.leadFooter {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.leadCardTop > div {
  display: grid;
  grid-gap: 3px;
  gap: 3px;
  min-width: 0;
}

.leadCardTop span,
.leadFooter span {
  color: var(--muted);
  font-size: 13px;
}

.leadCardTop strong {
  font-size: 18px;
  line-height: 1.2;
}

.leadCardTop em {
  flex: 0 0 auto;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 5px 10px;
  font-size: 12px;
  font-style: normal;
  font-weight: 800;
}

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

.leadDetails span {
  min-height: 38px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 8px 10px;
  color: var(--muted);
  font-size: 13px;
}

.emptyState {
  min-height: 220px;
  display: grid;
  place-items: center;
  align-content: center;
  grid-gap: 8px;
  gap: 8px;
  color: var(--muted);
  text-align: center;
}

.emptyState strong {
  color: var(--ink);
}

.emptyState span {
  max-width: 420px;
  line-height: 1.45;
}

.toolbar,
.taskToolbar {
  display: flex;
  align-items: stretch;
  gap: 10px;
  margin-bottom: 16px;
}

.toolbar {
  flex-wrap: wrap;
}

.taskToolbar {
  align-items: end;
  flex-wrap: wrap;
}

.search {
  height: 38px;
  min-width: min(420px, 100%);
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0 10px;
  min-width: 0;
}

.toolbar .search {
  flex: 1 1 360px;
}

.search.wide {
  flex: 1 1 360px;
}

.search svg {
  flex: 0 0 auto;
  color: var(--muted);
}

.search input {
  border: 0;
  padding: 0;
  height: 34px;
  outline: 0;
  flex: 1 1;
}

.compactField {
  width: 170px;
  flex: 0 0 170px;
}

.customSelectField {
  position: relative;
  min-width: 0;
}

.customSelect {
  position: relative;
}

.customSelectButton {
  width: 100%;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  padding: 0 10px;
  color: var(--ink);
  text-align: left;
}

.customSelectButton span {
  min-width: 0;
}

.customSelectButton svg {
  flex: 0 0 auto;
  color: var(--muted);
  transition: transform 140ms ease;
}

.customSelect.open .customSelectButton {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(36, 84, 166, 0.12);
}

.customSelect.open .customSelectButton svg {
  transform: rotate(180deg);
}

.customSelectMenu {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 240px;
  overflow: auto;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  box-shadow: 0 18px 40px rgba(16, 24, 40, 0.14);
}

.customSelectMenu button {
  width: 100%;
  min-height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  border: 0;
  border-radius: 7px;
  background: transparent;
  padding: 7px 8px;
  color: var(--ink);
  text-align: left;
}

.customSelectMenu button:hover,
.customSelectMenu button.selected {
  background: var(--blue-soft);
}

.customSelectMenu button svg {
  flex: 0 0 auto;
  color: var(--blue);
}

.board {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(260px, 320px);
  grid-gap: 12px;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 12px;
  overscroll-behavior-x: contain;
}

.stageManager {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 14px;
  box-shadow: var(--shadow);
}

.stageManagerHeader {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  grid-gap: 14px;
  gap: 14px;
}

.stageManagerHeader h2 {
  margin: 0 0 4px;
  font-size: 18px;
}

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

.stageCreateForm {
  display: grid;
  grid-template-columns: minmax(180px, 260px) 88px auto;
  align-items: end;
  grid-gap: 8px;
  gap: 8px;
}

.stageList {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.stageItem {
  display: grid;
  grid-template-columns: 104px minmax(180px, 1fr) 116px repeat(3, auto) 34px;
  align-items: center;
  grid-gap: 8px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 8px;
}

.stageOrder {
  display: grid;
  grid-template-columns: 28px 1fr 28px;
  align-items: center;
  grid-gap: 4px;
  gap: 4px;
}

.stageOrder strong {
  text-align: center;
}

.stageOrder button,
.dangerIconButton {
  display: grid;
  place-items: center;
  min-height: 30px;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: white;
  color: var(--ink);
}

.stageOrder button:disabled {
  color: var(--muted);
  opacity: 0.45;
}

.stageItem label {
  color: var(--muted);
  font-size: 12px;
}

.stageFlag {
  display: inline-flex !important;
  grid-template-columns: none;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  color: var(--ink) !important;
}

.stageFlag input {
  width: auto;
}

.dangerIconButton {
  color: var(--red);
}

.column,
.statusColumn {
  min-width: 0;
  background: var(--panel-soft);
  border: 1px solid var(--line);
  border-radius: 8px;
  min-height: 340px;
  padding: 10px;
}

.columnHeader,
.dealTop,
.statusHeader {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-width: 0;
}

.columnHeader,
.statusHeader {
  margin-bottom: 10px;
}

.columnHeader strong,
.statusHeader strong,
.dealTop strong {
  min-width: 0;
}

.columnHeader span,
.statusHeader span {
  flex: 0 0 auto;
  background: white;
  border-radius: 999px;
  padding: 2px 8px;
  color: var(--muted);
  font-size: 12px;
}

.dealCard {
  width: 100%;
  display: block;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 12px;
  margin-bottom: 10px;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
}

.dealCard:hover {
  border-color: rgba(29, 78, 216, 0.35);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
}

.dealCard p {
  color: var(--muted);
  margin: 8px 0;
}

.dealCard small {
  display: block;
  color: var(--teal);
  line-height: 1.35;
}

.taskPanel {
  margin-top: 10px;
}

.taskList {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  margin-top: 12px;
}

.taskRow {
  width: 100%;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  grid-gap: 12px;
  gap: 12px;
  border: 0;
  border-left: 4px solid var(--blue);
  background: #fbfcfd;
  border-radius: 8px;
  padding: 10px;
  color: var(--ink);
  text-align: left;
}

.taskRow:hover {
  background: #f4f7fb;
}

.taskRow span,
.taskRow time {
  color: var(--muted);
  font-size: 13px;
}

.taskRow time {
  white-space: nowrap;
}

.tasksPage {
  min-width: 0;
}

.taskLayout {
  display: grid;
  grid-template-columns: 1fr;
  align-items: start;
}

.taskMain {
  min-width: 0;
}

.statusBoard {
  display: grid;
  grid-template-columns: repeat(4, minmax(260px, 1fr));
  grid-gap: 12px;
  gap: 12px;
  margin-bottom: 16px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.taskAddButton {
  align-self: end;
}

.taskMiniCard {
  width: 100%;
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  background: white;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  padding: 10px;
  text-align: left;
  margin-bottom: 8px;
  color: var(--ink);
}

.taskMiniCard strong {
  line-height: 1.25;
}

.taskMiniCard span,
.taskMiniCard small {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  color: var(--muted);
  line-height: 1.3;
}

.taskMiniCard svg {
  flex: 0 0 auto;
}

.taskTableWrap {
  display: none;
}

.taskTable {
  width: 100%;
  border-collapse: collapse;
  min-width: 860px;
}

.taskTable th,
.taskTable td {
  padding: 11px 12px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}

.taskTable th {
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.taskTable tr:last-child td {
  border-bottom: 0;
}

.taskTable td span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  margin-top: 4px;
}

.linkButton {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--blue);
  font-weight: 700;
  text-align: left;
}

.rowActions,
.detailActions {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rowActions button,
.detailActions button {
  border: 1px solid var(--line);
  background: white;
  border-radius: 8px;
  min-height: 30px;
  padding: 0 9px;
  color: var(--ink);
  line-height: 1.2;
}

.rowActions button:hover,
.detailActions button:hover {
  background: #f8fafc;
}

.clickableRow {
  cursor: pointer;
}

.clickableRow:hover {
  background: #f8fafc;
}

.dealNumberEditor {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: end;
  grid-gap: 8px;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px;
}

.dealNumberEditor button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: white;
  color: var(--ink);
}

.detailActions .dangerAction {
  border-color: rgba(197, 48, 48, 0.28);
  color: var(--red);
}

.detailActions .dangerAction:hover {
  background: #fff5f5;
}

.taskSide {
  display: grid;
  grid-gap: 0;
  gap: 0;
  position: -webkit-sticky;
  position: sticky;
  top: 16px;
  min-width: 0;
  overflow: visible;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.taskSide::before {
  content: "Планирование";
  display: block;
  padding: 14px 16px 0;
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.quickTaskForm {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  padding: 16px;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.quickTaskForm h2,
.employeesPanel h2,
.calendarAgenda h2,
.eventForm h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.quickTaskForm h2 {
  padding: 10px;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
}

.employeesPanel h2 {
  justify-content: space-between;
  color: var(--ink);
}

.quickTaskForm h2 svg,
.employeesPanel h2 svg,
.calendarAgenda h2 svg,
.eventForm h2 svg {
  flex: 0 0 auto;
}

.employeesPanel {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  padding: 16px;
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
  background: #fbfcfd;
}

.employeeList {
  display: grid;
  grid-gap: 6px;
  gap: 6px;
}

.employeeCard {
  display: grid;
  grid-template-columns: 38px minmax(0, 1fr) auto;
  align-items: center;
  grid-gap: 10px;
  gap: 10px;
  padding: 8px;
  border: 0;
  border-radius: 8px;
  background: white;
}

.employeeAvatar {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: var(--blue-soft);
  color: var(--blue);
  font-weight: 800;
}

.employeeCard strong,
.employeeCard span,
.employeeCard small {
  display: block;
  line-height: 1.25;
}

.employeeCard span,
.employeeCard small {
  color: var(--muted);
  font-size: 12px;
}

.employeeStats {
  display: grid;
  justify-items: end;
  grid-gap: 3px;
  gap: 3px;
  font-size: 12px;
  color: var(--muted);
}

.employeeStats strong {
  color: var(--red);
}

.calendarPage {
  min-width: 0;
}

.calendarToolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.calendarToolbar h2 {
  text-transform: capitalize;
}

.calendarToolbar span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
}

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

.calendarLayout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 340px);
  grid-gap: 16px;
  gap: 16px;
  align-items: start;
}

.calendarBoard {
  display: grid;
  grid-template-columns: repeat(7, minmax(118px, 1fr));
  grid-gap: 1px;
  gap: 1px;
  padding: 0;
  overflow: auto;
  background: var(--line);
}

.weekday {
  min-height: 42px;
  display: grid;
  place-items: center;
  background: #f8fafc;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.calendarCell {
  min-height: 132px;
  min-width: 118px;
  display: grid;
  align-content: start;
  grid-gap: 8px;
  gap: 8px;
  padding: 10px;
  background: white;
  cursor: pointer;
}

.calendarCell.muted {
  background: #f8fafc;
  color: #98a2b3;
}

.calendarCell.today {
  box-shadow: inset 0 0 0 2px rgba(36, 84, 166, 0.4);
}

.calendarCell.selected {
  box-shadow: inset 0 0 0 2px var(--blue);
}

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

.calendarDate strong {
  line-height: 1;
}

.calendarDate span {
  min-width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue-soft);
  color: var(--blue);
  font-size: 12px;
  font-weight: 700;
}

.calendarTasks {
  display: grid;
  grid-gap: 6px;
  gap: 6px;
}

.calendarTasks small {
  color: var(--muted);
  font-size: 12px;
}

.calendarTask,
.calendarEvent,
.agendaItem {
  width: 100%;
  display: grid;
  grid-gap: 3px;
  gap: 3px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  background: #fbfcfd;
  color: var(--ink);
  text-align: left;
}

.calendarTask {
  padding: 7px 8px;
}

.calendarEvent {
  border-left-color: var(--teal);
  background: #f7fbfb;
  padding: 7px 8px;
}

.calendarTask:hover,
.calendarEvent:hover,
.agendaItem:hover {
  background: #f4f7fb;
}

.calendarTask time,
.calendarTask span,
.calendarEvent time,
.calendarEvent span,
.agendaItem span,
.agendaItem small {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.25;
}

.calendarTask span,
.calendarEvent span {
  color: var(--ink);
}

.calendarTask.overdue time,
.agendaItem.overdue span {
  color: var(--red);
}

.calendarAgenda {
  position: -webkit-sticky;
  position: sticky;
  top: 16px;
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  padding: 0;
  border: 0;
  background: transparent;
  box-shadow: none;
}

.agendaList {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.agendaItem {
  padding: 10px;
}

.agendaItem strong,
.agendaItem span,
.agendaItem small {
  display: block;
}

.agendaList p {
  color: var(--muted);
  line-height: 1.45;
}

.dayPanel,
.eventForm {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
}

.dayPanel > h2 {
  text-transform: capitalize;
}

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

.agendaEvent {
  display: grid;
  grid-gap: 4px;
  gap: 4px;
  padding: 10px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 8px;
  background: #f7fbfb;
}

.agendaEvent strong,
.agendaEvent span,
.agendaEvent small {
  display: block;
}

.agendaEvent span,
.agendaEvent small {
  color: var(--muted);
  font-size: 12px;
}

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

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

.dealMetrics div {
  min-height: 88px;
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

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

.dealMetrics strong {
  font-size: 24px;
  line-height: 1;
}

.dealsTableWrap {
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}

.dealsTable {
  width: 100%;
  min-width: 920px;
  border-collapse: collapse;
}

.dealsTable th,
.dealsTable td {
  border-bottom: 1px solid var(--line);
  padding: 12px;
  text-align: left;
  vertical-align: top;
}

.dealsTable th {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
}

.dealsTable tr:last-child td {
  border-bottom: 0;
}

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

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

.userMetrics div {
  min-height: 88px;
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  align-content: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

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

.userMetrics strong {
  font-size: 24px;
  line-height: 1;
}

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

.usersList,
.userCreatePanel {
  display: grid;
  grid-gap: 14px;
  gap: 14px;
}

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

.sectionHeader span {
  display: block;
  color: var(--muted);
  margin-top: 4px;
}

.usersGrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  grid-gap: 12px;
  gap: 12px;
}

.userCard {
  display: grid;
  grid-gap: 14px;
  gap: 14px;
  align-content: start;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 14px;
}

.userCard.inactive {
  background: #f8fafc;
  opacity: 0.72;
}

.userCardTop {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.userCardTop div {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  min-width: 0;
}

.userCardTop strong,
.userCardTop small {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.userCardTop small {
  color: var(--muted);
}

.userCard dl {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  margin: 0;
}

.userCard dl div {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  grid-gap: 12px;
  gap: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 7px;
  align-items: start;
}

.userCard dl div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.userCard dt {
  color: var(--muted);
  white-space: nowrap;
}

.userCard dd {
  min-width: 0;
  margin: 0;
  text-align: right;
  overflow-wrap: anywhere;
  line-height: 1.3;
}

.inlineSecret {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  max-width: 100%;
}

.inlineSecret code {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

.inlineSecret button {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 0;
  border-radius: 8px;
  background: var(--panel-soft);
  color: var(--muted);
}

.inlineSecret button:hover {
  color: var(--ink);
}

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

.userActions > button {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  min-height: 34px;
  padding: 0 10px;
  color: var(--ink);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.userActions .customSelectField {
  grid-column: 1 / -1;
}

.userActions .dangerButton {
  border-color: rgba(197, 48, 48, 0.28);
  color: var(--red);
}

.userActions .dangerButton:hover {
  background: #fff5f5;
}

.userCreatePanel {
  position: -webkit-sticky;
  position: sticky;
  top: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  padding: 16px;
}

.userCreatePanel h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.userCreatePanel form {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
}

.roleManager {
  display: grid;
  grid-gap: 12px;
  gap: 12px;
  border-top: 1px solid var(--line);
  padding-top: 14px;
}

.roleManager h2 {
  display: flex;
  align-items: center;
  gap: 8px;
}

.roleList {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
}

.roleList article {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fbfcfd;
  padding: 10px;
}

.roleList article div {
  display: grid;
  grid-gap: 2px;
  gap: 2px;
  min-width: 0;
}

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

.roleList button {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border: 1px solid rgba(197, 48, 48, 0.28);
  border-radius: 8px;
  background: #fff;
  color: var(--red);
}

.roleList button:hover {
  background: #fff5f5;
}

.formHint {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel-soft);
  padding: 10px 11px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.35;
}

.formHint.danger {
  border-color: rgba(197, 48, 48, 0.28);
  background: #fff5f5;
  color: var(--red);
}

.checkField {
  display: flex !important;
  align-items: center;
  grid-template-columns: none;
  color: var(--ink) !important;
}

.checkField input {
  width: auto;
}

.emptyState.compact {
  min-height: 160px;
}

.modalLayer {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  padding: 20px;
}

.modalBackdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(15, 23, 42, 0.48);
  cursor: default;
}

.taskFormModal,
.taskModal {
  position: relative;
  width: min(620px, 100%);
  max-height: min(760px, calc(100vh - 40px));
  display: grid;
  grid-gap: 16px;
  gap: 16px;
  overflow: auto;
}

.taskFormModal header,
.taskModal header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.taskFormModal header > div,
.taskModal header > div {
  min-width: 0;
}

.taskFormModal header span,
.taskModal header span {
  display: block;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 4px;
}

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

.modalActions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  padding-top: 4px;
}

.taskModal p {
  color: var(--muted);
  line-height: 1.5;
}

.taskModal dl {
  display: grid;
  grid-gap: 8px;
  gap: 8px;
  margin: 0;
}

.taskModal dl div {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  grid-gap: 12px;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}

.taskModal dl div:last-child {
  border-bottom: 0;
}

.taskModal dt {
  color: var(--muted);
}

.taskModal dd {
  margin: 0;
}

.priority-high,
.priority-urgent {
  border-left-color: var(--red);
}

.priority-medium {
  border-left-color: var(--amber);
}

.priority-low {
  border-left-color: var(--green);
}

@media (max-width: 1200px) {
  .taskLayout {
    grid-template-columns: 1fr;
  }

  .taskSide,
  .calendarAgenda,
  .userCreatePanel {
    position: static;
  }

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

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

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

  .stageManagerHeader,
  .stageCreateForm,
  .stageItem {
    grid-template-columns: 1fr;
  }

  .stageOrder {
    width: 104px;
  }
}

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

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .workspace {
    padding: 18px;
  }

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

  .topbarActions {
    width: 100%;
    justify-content: space-between;
  }

  .profileMenu,
  .profileButton {
    min-width: 0;
    width: 100%;
  }

  .profileDropdown {
    left: 0;
    right: auto;
  }

  .compactField {
    width: 100%;
    flex: 1 1 100%;
  }

  .search,
  .search.wide {
    flex-basis: 100%;
  }

  .statusBoard {
    grid-template-columns: repeat(4, minmax(220px, 260px));
  }

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

  .calendarBoard {
    grid-template-columns: repeat(7, minmax(132px, 1fr));
  }
}

@media (max-width: 620px) {
  .workspace {
    padding: 14px;
  }

  .topbar {
    gap: 12px;
  }

  h1 {
    font-size: 24px;
  }

  .metrics,
  .leadMetrics,
  .taskMetrics,
  .dealMetrics,
  .userMetrics {
    grid-template-columns: 1fr;
  }

  .topbarActions,
  .profileActions {
    display: grid;
  }

  .profileButton {
    min-width: 0;
  }

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

  .userCard dl div {
    grid-template-columns: 1fr;
    gap: 3px;
  }

  .userCard dd {
    text-align: left;
  }

  .toolbar .secondaryButton {
    flex: 1 1 150px;
  }

  .taskRow {
    grid-template-columns: 1fr;
    gap: 4px;
  }

  .taskRow time {
    white-space: normal;
  }

  .employeeCard {
    grid-template-columns: 38px minmax(0, 1fr);
  }

  .employeeStats {
    grid-column: 1 / -1;
    justify-items: start;
    grid-template-columns: repeat(2, auto);
  }

  .calendarControls {
    width: 100%;
  }

  .calendarControls .secondaryButton {
    flex: 1 1;
  }

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

  .leadCardTop,
  .leadFooter {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

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

  .modalActions {
    display: grid;
  }

  .taskModal dl div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

