:root {
    --accent: #6b5b95;
    --accent-soft: #f4f1fa;
    --bg-page: #f5f7fa;
    --bg-card: #ffffff;
    --border: #dde3ed;
    --text-main: #222222;
    --text-muted: #6b7280;
    --radius: 12px;
    --radius-sm: 8px;
    --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
    --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.08);
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: var(--bg-page);
    color: var(--text-main);
    font-size: 14px;
}

/* Общие контейнеры */
.main-card,
.content-container {
    max-width: 1400px;
    margin: 0 auto;
    background: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    overflow: hidden;
}

/* Шапка списка клиентов */
.header-section {
    padding: 1.6rem 2rem;
    text-align: center;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border-bottom: 1px solid var(--border);
}

.header-section h1 {
    margin: 0 0 0.4rem 0;
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--accent);
}

.header-subtitle {
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

/* Панель под заголовком */
.panel-compact {
    padding: 0.9rem 1.6rem;
    border-bottom: 1px solid var(--border);
    background: #f9fafb;
}

/* Фильтры */
.filters-compact {
    padding: 0.9rem 1.6rem;
    background: #f9fafb;
    border-bottom: 1px solid var(--border);
}

.form-label-custom {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
    font-weight: 500;
}

.form-control-custom,
.form-select-custom {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    padding: 0.45rem 0.75rem;
    font-size: 0.9rem;
    background: #ffffff;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control-custom:focus,
.form-select-custom:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 2px rgba(107, 91, 149, 0.2);
    outline: none;
}

/* Кнопки */
.btn-primary-custom {
    background: var(--accent);
    border: 1px solid var(--accent);
    color: #ffffff;
    font-size: 0.85rem;
    border-radius: var(--radius-sm);
    padding: 0.45rem 1.2rem;
    font-weight: 500;
}

.btn-primary-custom:hover {
    background: #5a4a80;
    border-color: #5a4a80;
}

.btn-outline-secondary-custom {
    background: #ffffff;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 0.85rem;
    padding: 0.45rem 1.2rem;
    font-weight: 500;
}

.btn-outline-secondary-custom:hover {
    border-color: var(--accent);
    color: var(--accent);
}

/* Таблица клиентов */
.table-container-custom {
    padding: 0;
}

.table-custom {
    width: 100%;
    border-collapse: collapse;
    table-layout: fixed;
    font-size: 0.86rem;
}

.table-custom thead th {
    padding: 0.7rem 0.6rem;
    text-align: left;
    background: #f3f4f6;
    border-bottom: 1px solid var(--border);
    font-weight: 500;
    color: var(--text-muted);
}

.table-custom thead a {
    text-decoration: none;
    color: inherit;
}

.table-custom tbody td {
    padding: 0.7rem 0.6rem;
    border-bottom: 1px solid var(--border);
    vertical-align: middle;
}

.table-custom tbody tr:hover {
    background: #f9fafb;
}

.table-custom a {
    color: var(--accent);
    text-decoration: none;
}

.table-custom a:hover {
    text-decoration: underline;
}

/* Статусы */
.badge-status {
    display: inline-block;
    border-radius: 999px;
    padding: 0.15rem 0.6rem;
    font-size: 0.72rem;
    font-weight: 500;
}

.badge-permanent {
    background: #e0f2f1;
    color: #00695c;
}

.badge-potential {
    background: #fff3e0;
    color: #e65100;
}

.badge-no-work {
    background: #ffebee;
    color: #c62828;
}

/* Карточки на странице клиента */
.card-custom {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: #ffffff;
    box-shadow: var(--shadow-sm);
}

.card-header-custom {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border);
    background: #f9fafb;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--text-muted);
}

.card-header-accent {
    padding: 0.9rem 1.2rem;
    border-bottom: 1px solid var(--border);
    background: var(--accent-soft);
    color: var(--accent);
    font-size: 0.9rem;
    font-weight: 500;
}

/* Журнал заметок */
.note-item {
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: #f9fafb;
    padding: 0.7rem 0.8rem;
    margin-bottom: 0.6rem;
    font-size: 0.82rem;
}

.note-item:hover {
    background: #ffffff;
}

.note-header {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.note-text {
    font-size: 0.84rem;
    color: var(--text-main);
}

/* Навигация на странице клиента */
.client-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--border);
}

.client-nav-title {
    text-align: center;
    flex: 1;
}

.filters-compact .row {
    justify-content: space-between;
}

.client-nav-title h1 {
    font-size: 1.4rem;
    margin: 0 0 0.2rem 0;
    color: var(--accent);
    font-weight: 600;
    text-align: center;
}

.client-nav-title small {
    color: var(--text-muted);
}

/* Flash контейнер */
.flash-container {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 1055;
    max-width: 360px;
}

/* Адаптив */
@media (max-width: 768px) {
    .main-card,
    .content-container {
        border-radius: 0;
        box-shadow: none;
        border-left: none;
        border-right: none;
    }

    .filters-compact,
    .panel-compact,
    .header-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}
