:root {
  --bg: #0b0c10;
  --card: #111319;
  --muted: #9aa3b2;
  --brand: #7c5cff;
  --brand-2: #21d4fd;
  --ok: #22c55e;
  --warn: #ffb020;
  --danger: #ef4444;
  --radius: 14px;
}

html, body { height: 100%; }
body {
  background: radial-gradient(1200px 800px at 30% -10%, #1a1f2e 0%, #0b0c10 55%);
  color: #e8eef9;
  font-family: "Segoe UI", "Roboto", sans-serif;
}

/* --- NAVBAR / HERO --- */
.navbar {
  background: linear-gradient(90deg, rgba(33,212,253,.2), rgba(124,92,255,.25));
  backdrop-filter: saturate(150%) blur(8px);
}

.hero {
  background: linear-gradient(135deg, rgba(33,212,253,.18), rgba(124,92,255,.18));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  padding: 18px 20px;
  box-shadow: 0 6px 30px rgba(2,6,23,.35) inset, 0 8px 30px rgba(124,92,255,.08);
}

.badge-soft {
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.06);
}
.promo-line {
  font-size: clamp(18px, 2.4vw, 26px);
  font-weight: 700;
  letter-spacing: .2px;
}

/* --- CARDS --- */
.card-soft {
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
  border: 1px solid rgba(255,255,255,.08);
  border-radius: var(--radius);
  box-shadow: 0 8px 24px rgba(2,6,23,.35);
}
.card-soft .card-header {
  border-bottom: 1px solid rgba(255,255,255,.08);
  background: transparent;
  font-weight: 700;
}
.card-soft .card-footer {
  border-top: 1px solid rgba(255,255,255,.08);
  background: transparent;
}

/* --- FORMS / BUTTONS --- */
.form-select, .form-control {
  background: #0f1120;
  border: 1px solid rgba(255,255,255,.14);
  color: #e8eef9;
  border-radius: 10px;
}
.form-select:focus, .form-control:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 .2rem rgba(124,92,255,.25);
}

.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border: 0;
  font-weight: 700;
}
.btn-outline-primary {
  color: #c7d2fe;
  border-color: #7c5cff;
}
.btn-outline-primary:hover {
  background: rgba(124,92,255,.2);
}

/* --- TABLE / PRICE --- */
.table {
  color: #e9effb;
  --bs-table-bg: transparent;
  --bs-table-color: #e9effb;
  --bs-table-border-color: rgba(255,255,255,.12);
}
.table thead th {
  color: #f4f6ff;
  background: #0f1120;
  border-bottom: 1px solid rgba(255,255,255,.16);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.table tbody td,
.table tfoot th, .table tfoot td {
  color: #e9effb;
}
.table-striped > tbody > tr:nth-of-type(odd) > * {
  --bs-table-accent-bg: rgba(255,255,255,.05);
  color: #e9effb;
}
.table-hover > tbody > tr:hover > * {
  background: rgba(124,92,255,.09);
}
.price-num {
  color: #ffffff;
  font-weight: 700;
}

/* --- MODULES / PRICE ROW --- */
.price-pill {
  background: #0f1120;
  border: 1px solid rgba(255,255,255,.14);
  border-radius: 999px;
  padding: .35rem .75rem;
  font-weight: 700;
  white-space: nowrap;
}

#modules-container .input-group {
  flex-wrap: wrap;
  gap: .6rem;
  align-items: center;
  width: 100%;
}

#modules-container .input-group > .form-select {
  min-width: 0;
  flex: 1 1 320px;
  max-width: 100%;
}

#modules-container .price-pill {
  flex: 0 0 auto;
}

#add-module { margin-top: .25rem; }

/* --- COPY AREA / FOOTER --- */
.copy-area textarea {
  background: #0f1120;
  color: #e8eef9;
  border: 1px dashed rgba(255,255,255,.18);
}

.small-muted { color: var(--muted); font-size: .9rem; }
.hr-fade { border: 0; border-top: 1px solid rgba(255,255,255,.08); margin: 18px 0; }

/* --- STICKY FOOTER ACTIONS --- */
.sticky-actions {
  position: sticky;
  bottom: 0;
  z-index: 5;
  background: linear-gradient(180deg, rgba(11,12,16,0), rgba(11,12,16,.8) 30%, rgba(11,12,16,.9));
  padding-top: 8px;
}

/* --- MOBILE FIXES --- */
@media (max-width: 768px) {
  #modules-container .input-group > .form-select {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
  }
  #modules-container .form-select,
  #modules-container .form-select option {
    font-size: clamp(13px, 3.8vw, 16px);
  }
  #modules-container .price-pill {

margin-top: .25rem;
  }
  .table thead th {
    font-size: 13px;
  }
  .table td {
    font-size: 14px;
  }
}

/* --- EXTRA SMALL DEVICES --- */
@media (max-width: 420px) {
  #modules-container .input-group { gap: .5rem; }
  .price-pill { padding: .3rem .6rem; font-size: 14px; }
}

/* --- HIGH CONTRAST MODE --- */
@media (prefers-contrast: more) {
  .table thead th { background: #0b0c10; }
  .table-striped > tbody > tr:nth-of-type(odd) > * { --bs-table-accent-bg: rgba(255,255,255,.08); }
}

/* ===== CRM оболочка / секции ===== */

.crm-page {
    max-width: 1280px;
    margin: 0 auto;
}

/* Карточки CRM в стиле калькулятора */
.crm-card {
    background: rgba(15, 23, 42, 0.92);
    border-radius: 12px;
    box-shadow: 0 18px 50px rgba(15, 23, 42, 0.55);
    border: none; /* ← убрали */
    padding: 1.5rem 1.75rem;
    margin-bottom: 1.75rem;
}

/* Заголовки секций CRM */
.crm-section-title {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 0.75rem;
    background: linear-gradient(90deg,#e0f2fe,#f5d0fe);
    -webkit-background-clip: text;
    color: transparent;
}

/* Чуть более "калькуляторные" инпуты */

.crm-card .form-control,
.crm-card .form-select {
    background-color: #020617;
    border-radius: 10px;
    border: 1px solid rgba(148, 163, 184, 0.6);
    color: #e5e7eb;
    padding-inline: 1rem;
    padding-block: 0.55rem;
    font-size: 0.95rem;
}

    .crm-card .form-control::placeholder {
        color: rgba(148, 163, 184, 0.8);
    }

    .crm-card .form-control:focus,
    .crm-card .form-select:focus {
        box-shadow: 0 0 0 1px rgba(129, 140, 248, 0.9);
        border-color: rgba(129, 140, 248, 0.9);
    }

/* Чекбоксы и радиокнопки */
.crm-card .form-check-input {
    background-color: #020617;
    border-color: rgba(148, 163, 184, 0.7);
}

    .crm-card .form-check-input:checked {
        background-color: #4f46e5;
        border-color: #4f46e5;
    }

/* Таблица позиций в заказе */
.crm-table {
    border-radius: 12px;
    overflow: hidden;
    background: radial-gradient(circle at top left,#0f172a,#020617);
    color: #e5e7eb;
}

    .crm-table thead {
        background: linear-gradient(90deg,#4f46e5,#a855f7);
        text-transform: uppercase;
        font-size: 0.8rem;
        letter-spacing: 0.05em;
    }

    .crm-table th,
    .crm-table td {
        border-color: rgba(15, 23, 42, 0.9);
        padding-block: 0.6rem;
    }

/* Кнопка "Добавить позицию" / "Поиск" чуть мягче */

.btn-crm-soft {
    border-radius: 999px;
    border: 1px solid rgba(129, 140, 248, 0.7);
    background: linear-gradient(90deg,#4f46e5,#6366f1);
    color: #e5e7eb;
    font-weight: 500;
}

    .btn-crm-soft:hover {
        filter: brightness(1.1);
        color: #fff;
    }

.btn-welcome-secondary {
    border-radius: 999px;
    padding-block: 0.6rem;
    padding-inline: 1.6rem;
    backdrop-filter: blur(8px);
    background: rgba(255,255,255,0.75);
    border: 1px solid rgba(148,163,184,0.5);
    color: #0f172a !important;
    font-weight: 600;
    transition: .2s;
}

    .btn-welcome-secondary:hover {
        background: rgba(255,255,255,0.95);
    }
/* --- CRM: welcome в стиле brand_select --- */

.crm-hero-wrapper {
    max-width: 1100px;
    margin-left: auto;
    margin-right: auto;
}

.crm-hero {
    border-radius: 26px;
    padding: 32px 40px;
    background: radial-gradient(circle at 0 0, #e0f2fe 0, #eef2ff 40%, #f5f3ff 100%);
    box-shadow: 0 26px 80px rgba(15, 23, 42, 0.18);
    border: 1px solid rgba(148, 163, 184, 0.25);
}

@media (max-width: 767.98px) {
    .crm-hero {
        padding: 24px 18px;
        border-radius: 22px;
    }
}

.crm-hero-label {
    display: inline-flex;
    align-items: center;
    padding: 4px 12px;
    border-radius: 999px;
    font-size: 13px;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #0f172a;
    background: rgba(255, 255, 255, 0.8);
    border: 1px solid rgba(148, 163, 184, 0.45);
    backdrop-filter: blur(10px);
}

.crm-hero-title {
    font-size: 2.4rem;
    font-weight: 600;
    line-height: 1.1;
    color: #dfe6f0;
}

@media (max-width: 991.98px) {
    .crm-hero-title {
        font-size: 2rem;
    }
}

.crm-hero-title-accent {
    background: linear-gradient(120deg, #2563eb, #4f46e5, #7c3aed);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.crm-hero-subtitle {
    font-size: 0.98rem;
    color: #475569;
    max-width: 34rem;
}

.crm-hero-card {
    border-radius: 22px;
    padding: 22px 24px;
    background: rgba(255, 255, 255, 0.94);
    border: 1px solid rgba(148, 163, 184, 0.4);
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.16);
    backdrop-filter: blur(14px);
}

.crm-hero-card-title {
    font-weight: 700;
    font-size: 1.1rem;
    color: #0f172a;
}

.crm-hero-list {
    margin: 0;
    padding-left: 1.1rem;
    font-size: 0.95rem;
    color: #1e293b;
}

    .crm-hero-list li + li {
        margin-top: 0.35rem;
    }

    .crm-hero-list li::marker {
        color: #4f46e5;
    }

/* Обёртка, чтобы можно было при желании менять фон body только для welcome */
.crm-hero-active {
    background: transparent;
}

/* ============================================================================
   CRM NAVBAR — минимализм в стиле Notion / Linear / Apple
   ============================================================================ */

.crm-navbar {
    background: rgba(250, 250, 255, 0.92); /* почти белый, слегка прозрачный */
    backdrop-filter: blur(14px); /* мягкий blur */
    border-bottom: 1px solid rgba(148, 163, 184, 0.35);
    padding-block: 10px;
    font-size: 0.95rem;
}

    /* Бренд "CRM" */
    .crm-navbar .navbar-brand {
        font-weight: 700;
        font-size: 1.15rem;
        letter-spacing: 0.03em;
        color: #0f172a !important;
        margin-right: 2rem;
    }

    /* Список пунктов */
    .crm-navbar .navbar-nav {
        gap: 0.75rem;
    }

        /* Ссылки меню — базовое состояние */
        .crm-navbar .navbar-nav .nav-link {
            position: relative;
            padding: 4px 0;
            border-radius: 0;
            color: #4b5563 !important; /* серый, читаемый */
            font-weight: 500;
            transition: color .16s ease, opacity .16s ease;
            opacity: 0.9;
        }

            /* Подсветка при hover */
            .crm-navbar .navbar-nav .nav-link:hover {
                color: #111827 !important;
                opacity: 1;
            }

            /* Активный пункт — тонкая полоска снизу */
            .crm-navbar .navbar-nav .nav-link.active {
                color: #111827 !important;
                opacity: 1;
                font-weight: 600;
            }

                .crm-navbar .navbar-nav .nav-link.active::after {
                    content: "";
                    position: absolute;
                    left: 0;
                    right: 0;
                    bottom: -6px;
                    height: 2px;
                    border-radius: 999px;
                    background: linear-gradient(90deg, #3b82f6, #6366f1);
                }

    /* Правая часть "Привет, Имя · Выход" */
    .crm-navbar .navbar-text {
        color: #111827 !important;
        font-weight: 500;
    }

        .crm-navbar .navbar-text a {
            color: #4b5563 !important;
            text-decoration: none;
        }

            .crm-navbar .navbar-text a:hover {
                color: #111827 !important;
                text-decoration: underline;
            }

/* Чуть плотнее на маленьких экранах */
@media (max-width: 768px) {
    .crm-navbar {
        padding-block: 8px;
    }

        .crm-navbar .navbar-brand {
            margin-right: 1rem;
            font-size: 1.05rem;
        }
}


/* --- CRM: поиск покупателя --- */

.crm-search-form .form-label {
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(226, 232, 240, 0.9);
}

.crm-search-hint {
    color: rgba(203, 213, 225, 0.96); /* светло-серый, хорошо читается на тёмном */
    font-size: 0.8rem;
    line-height: 1.5;
}

/* на очень узких экранах не ломаем строку три раза подряд */
@media (max-width: 480px) {
    .crm-search-hint br {
        display: none;
    }
}

/* --- CRM Search: aligning the submit button with fields --- */

.crm-page--search .crm-search-form .search-actions {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

@media (min-width: 768px) {
    .crm-page--search .crm-search-form .search-actions {
        flex-direction: row;
        justify-content: flex-end;
        align-items: flex-start;
        margin-top: 30px !important; /* точно подгоняет кнопку к полям */
    }
}