/* ====== Базовые темы через CSS-переменные ====== */

:root {
    --transition-fast: 0.15s ease;
    --transition-medium: 0.25s ease;
    --shadow-soft: 0 12px 30px rgba(15, 23, 42, 0.12);
    --radius-lg: 18px;
    --radius-md: 12px;

    /* Светлая тема */
    --bg-body-light: #f3f4f6;
    --bg-gradient-light: radial-gradient(circle at top left, #e0f2fe 0, #f3f4f6 40%, #e5e7eb 100%);
    --bg-navbar-light: rgba(15, 23, 42, 0.92);
    --bg-column-light: rgba(255, 255, 255, 0.9);
    --bg-card-light: rgba(255, 255, 255, 0.98);
    --border-subtle-light: rgba(148, 163, 184, 0.4);
    --text-main-light: #111827;
    --text-muted-light: #6b7280;
}

body.theme-dark {
    --bg-body-dark: #020617;
    --bg-gradient-dark: radial-gradient(circle at top left, #0f172a 0, #020617 45%, #0b0b35 100%);
    --bg-navbar-dark: rgba(15, 23, 42, 0.98);
    --bg-column-dark: rgba(15, 23, 42, 0.92);
    --bg-card-dark: rgba(15, 23, 42, 0.98);
    --border-subtle-dark: rgba(30, 64, 175, 0.55);
    --text-main-dark: #e5e7eb;
    --text-muted-dark: #9ca3af;
}

/* ====== Body и фон ====== */

body.theme-light {
    background: var(--bg-gradient-light);
    color: var(--text-main-light);
}

body.theme-dark {
    background: var(--bg-gradient-dark);
    color: var(--text-main-dark);
}

/* Плавные переходы */
body,
.navbar,
.card,
.modal-content,
.kanban-column,
.form-control,
.form-select {
    transition: background-color var(--transition-medium),
                color var(--transition-medium),
                border-color var(--transition-medium),
                box-shadow var(--transition-medium),
                transform var(--transition-fast);
}

/* Кастомный скролл */
body {
    scrollbar-width: thin;
    scrollbar-color: #6b7280 transparent;
}

body::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}
body::-webkit-scrollbar-track {
    background: transparent;
}
body::-webkit-scrollbar-thumb {
    background: rgba(148, 163, 184, 0.9);
    border-radius: 999px;
}

/* ====== Navbar ====== */

.navbar {
    /* box-shadow: 0 10px 30px rgba(15, 23, 42, 0.35); */
    background: none !important;
}

body.theme-light .navbar {
    /* background-color: var(--bg-navbar-light) !important; */
}

body.theme-dark .navbar {
    /* background-color: var(--bg-navbar-dark) !important; */
}

.navbar .navbar-brand {
    font-weight: 700;
    letter-spacing: 0.03em;
}

body.theme-light .navbar .navbar-brand {
    color: #0058ff;
}

/* Кнопка темы */
#theme-toggle {
    border-radius: 999px;
    padding-inline: 0.9rem;
}

/* Search */
#search-input {
    min-width: 220px;
}

/* ====== Доска Kanban ====== */

.kanban-board {
    min-height: calc(100vh - 80px);
    padding: 1.25rem 0.75rem 2rem;
}

/* Колонка как "стекло" */
.kanban-column {
    width: 300px;
    max-width: 100%;
    /* border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.85);
    padding: 0.5rem 0.75rem;
    box-shadow: 0 18px 15px rgba(15, 23, 42, 0.06); */
    position: relative;
    overflow: visible;  /* вместо hidden */
}

body.theme-dark .kanban-column {
}

/* Акцентная "полоска" у колонки */
.kanban-column::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
}

/* Заголовок колонки */
.kanban-column-header {
    padding: 0.25rem 0.25rem 0.5rem;
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
}

.kanban-column-header h5 {
    font-size: 0.9rem;
    display: flex;
    gap: 0.4rem;
    font-weight: bold;
}

.kanban-column-header .lead-count {
    font-size: 0.7rem;
    background: #e4e4e4 !important;
    color: black;
}

body.theme-dark .kanban-column-header .lead-count {
    font-size: 0.7rem;
    background: #313131 !important;
    color: #aeaeae;
}

body.theme-dark .kanban-column-header h5 {
    color: #e5e5e5;
}

/* Область карточек */
.kanban-items {
    margin-top: 0.4rem;
    padding-top: 0.2rem;
    min-height: 110px;
}

/* Плейсхолдер для пустой колонки */
.kanban-empty {
    font-size: 0.85rem;
    border-radius: var(--radius-md);
    border: 1px dashed rgba(148, 163, 184, 0.7);
    background: rgba(148, 163, 184, 0.08);
}

/* ====== Карточки лидов ====== */

.kanban-card {
    cursor: grab;
    border-radius: var(--radius-md);
    border: none;
    background: var(--bg-card-light);
    box-shadow: var(--shadow-soft);
    transform-origin: center;
}

body.theme-dark .kanban-card {
    background: #2d3a66 !important;
    color: #cee6ff !important;
}

body.theme-dark .kanban-empty{
    color: #ffffff !important;
}

body.theme-dark .edit-comment-btn{
    color:rgb(151, 151, 151);
}

body.theme-dark .preambula{
    color: #cee6ff !important;
}

body.theme-dark .status-options{
    color: #cee6ff !important;
}

body.theme-dark .form-control::placeholder {
  color: rgba(149, 149, 149, 0.75);
  opacity: 1;
}

body.theme-dark .comment{
    background: #151515;
}

body.theme-dark .comment-date{
    color: grey !important;
}

body.theme-dark #status-list .list-group-item{
    background: #2d3a66 !important;
    color: #fff !important;
}

.kanban-card .card-body {
    padding: 0.7rem 0.8rem 0.65rem;
}

/* Анимации при hover/drag */
.kanban-card:hover {
    transform: translateY(-2px) translateZ(0);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.32);
}

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

/* Заголовок карточки */
.kanban-card .card-title {
    font-size: 0.95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

/* Мелкий текст */
.kanban-card .card-text {
    font-size: 0.8rem;
    margin-bottom: 0.1rem;
}

.kanban-card .card-text i{
  font-size: 1rem;
  margin-right: 0.5rem;
}

.kanban-card .card-text.small.text-muted {
    opacity: 0.75;
}

/* Кнопка комментариев */
.open-comments-modal {
    border-radius: 999px;
    font-size: 0.76rem;
    padding-inline: 0.8rem;
}

/* Плейсхолдер jQuery UI при drag&drop */
.kanban-card-placeholder {
    border: 2px dashed rgba(59, 130, 246, 0.8);
    margin-bottom: 0.75rem;
    border-radius: var(--radius-md);
    background: rgba(59, 130, 246, 0.08);
    
}

/* ====== Формы и модальные окна ====== */

body.theme-dark .card,
body.theme-dark .modal-content {
    background-color: rgba(15, 23, 42, 0.98);
    color: var(--text-main-dark);
}

body.theme-dark .modal-header,
body.theme-dark .modal-footer {
    border-color: rgba(30, 64, 175, 0.6);
}

body.theme-dark .form-control,
body.theme-dark .form-select,
body.theme-dark .form-check-input {
    background-color: #020617;
    color: var(--text-main-dark);
    border-color: rgba(30, 64, 175, 0.7);
}

body.theme-dark .form-control:focus,
body.theme-dark .form-select:focus {
    background-color: #020617;
    border-color: #3b82f6;
    box-shadow: 0 0 0 1px rgba(59, 130, 246, 0.5);
}

/* Модалки немного скругляем */
.modal-content {
    border-radius: var(--radius-lg);
}

/* ====== Admin / statuses ====== */

.drag-handle {
    cursor: grab;
    user-select: none;
    font-size: 1.1rem;
    opacity: 0.6;
    transition: opacity var(--transition-fast);
}

.drag-handle:hover {
    opacity: 1;
}

#status-list .list-group-item {
    border-radius: var(--radius-md);
    margin-bottom: 0.4rem;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    border: none;
}

/* ====== Адаптив ====== */

@media (max-width: 991.98px) {
    #search-input {
        min-width: 160px;
    }
}

@media (max-width: 767.98px) {
    .kanban-board {
        flex-direction: column !important;
    }

    .kanban-column {
        width: 100%;
    }
}

/* Вспомогательный элемент jQuery UI при перетаскивании */
.ui-sortable-helper {
    z-index: 1200 !important; /* выше, чем большинство элементов на странице */
}

/* Дополнительный визуальный эффект при перетаскивании */
.kanban-card.ui-sortable-helper {
    box-shadow: 0 20px 50px rgba(15, 23, 42, 0.4);
}

/* Вспомогательная карточка при перетаскивании */
.ui-sortable-helper.kanban-drag-helper {
    z-index: 3000 !important;
    /* box-shadow: 0 24px 55px rgba(15, 23, 42, 0.55); */
    transform: rotate(1deg);
    pointer-events: none;
}

#new-lead-btn {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

@media (max-width: 575.98px) {
    #new-lead-btn {
        width: 100%;
        justify-content: center;
        display: inline-flex;
    }
}

.comment {
  margin-bottom: 0.5rem;
  border-radius: 0.5rem;
  padding: 0.25rem 0.75rem;
  background: #f2f2f2;
}

.comment-text {
  font-size: 14px;
}

.comment-date {
  font-size: 11px;
}