/* Минималистичный CSS для SQNS Connector */
/* Без зависимости от Bootstrap */

/* Reset и базовые стили */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    color: #333;
    background-color: #fff;
    padding: 0;
    margin: 0;
}

/* Навигация */
nav {
    background-color: #2c3e50;
    color: #fff;
    padding: 1rem 0;
    border-bottom: 1px solid #34495e;
}

nav .container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

nav a {
    color: #fff;
    text-decoration: none;
    padding: 0.5rem 1rem;
    transition: background-color 0.2s;
}

nav a:hover {
    background-color: #34495e;
}

.nav-brand {
    font-size: 1.25rem;
    font-weight: 600;
}

.nav-links {
    display: flex;
    gap: 0.5rem;
}

/* Контейнер */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

/* Заголовки */
h1 {
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #2c3e50;
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 1rem;
    color: #2c3e50;
}

h3 {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 0.75rem;
    color: #34495e;
}

h4, h5, h6 {
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #34495e;
}

p {
    margin-bottom: 1rem;
}

.text-muted {
    color: #6c757d;
    font-size: 0.9rem;
}

/* Статистика (карточки и фильтры) */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

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

.stat-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 10px;
    padding: 1rem 1rem;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.stat-value {
    font-size: 1.6rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
    margin-bottom: 0.25rem;
}

.stat-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: #34495e;
    margin-bottom: 0.1rem;
}

.stat-description {
    font-size: 0.85rem;
    color: #6c757d;
}

.stats-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: 0.75rem;
}

.stats-period-hint {
    margin-bottom: 0.75rem;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
    padding: 0.25rem 0.5rem;
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 600;
    border: 1px solid transparent;
}

.badge-info {
    color: #0c5460;
    background-color: #d1ecf1;
    border-color: #bee5eb;
}

.badge-secondary {
    color: #383d41;
    background-color: #e2e3e5;
    border-color: #d6d8db;
}

.badge-success {
    color: #155724;
    background-color: #d4edda;
    border-color: #c3e6cb;
}

.badge-danger {
    color: #721c24;
    background-color: #f8d7da;
    border-color: #f5c6cb;
}

.badge-warning {
    color: #856404;
    background-color: #fff3cd;
    border-color: #ffeeba;
}

/* Кнопки */
button, .btn {
    display: inline-block;
    padding: 0.5rem 1rem;
    font-size: 1rem;
    font-weight: 500;
    text-align: center;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    cursor: pointer;
    transition: all 0.2s;
}

button:hover, .btn:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.btn-primary {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.btn-primary:hover {
    background-color: #0056b3;
    border-color: #0056b3;
}

.btn-outline-primary {
    background-color: transparent;
    color: #007bff;
    border-color: #007bff;
}

.btn-outline-primary:hover {
    background-color: #007bff;
    color: #fff;
}

.btn-outline-secondary {
    background-color: transparent;
    color: #6c757d;
    border-color: #6c757d;
}

.btn-outline-secondary:hover {
    background-color: #6c757d;
    color: #fff;
}

.btn-sm {
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
}

/* Группа кнопок (быстрые периоды и т.п.) */
.btn-group {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

/* Формы */
form {
    margin-bottom: 1.5rem;
}

.form-group {
    margin-bottom: 1rem;
}

label {
    display: block;
    margin-bottom: 0.25rem;
    font-weight: 500;
    color: #333;
}

input[type="text"],
input[type="date"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 0.5rem;
    font-size: 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
}

/* Фильтры */
.filters-section {
    background: #f8f9fa;
    border-color: #e9ecef;
    border-radius: 10px;
}

.filters-actions {
    gap: 0.5rem;
}

/* Чекбоксы-«пилюли» для статусов */
.checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 8px;
}

.checkbox-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.6rem;
    border: 1px solid #dee2e6;
    border-radius: 999px;
    background: #fff;
    cursor: pointer;
    user-select: none;
    font-size: 0.95rem;
}

.checkbox-pill input[type="checkbox"] {
    width: auto;
    margin: 0;
}

.checkbox-pill:hover {
    border-color: #adb5bd;
    background: #f8f9fa;
}

input:focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0, 123, 255, 0.25);
}

/* Таблицы */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 1rem;
    background-color: #fff;
}

thead {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
}

th {
    padding: 0.75rem;
    text-align: left;
    font-weight: 600;
    color: #2c3e50;
    border-bottom: 2px solid #dee2e6;
}

th a {
    color: inherit;
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

th a:hover {
    color: #007bff;
}

td {
    padding: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

tbody tr:hover {
    background-color: #f8f9fa;
}

tbody tr:last-child td {
    border-bottom: none;
}

/* Карточки / Секции */
.section {
    background-color: #fff;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.section-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #dee2e6;
}

.section-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

/* Бейджи */
.badge {
    display: inline-block;
    padding: 0.25rem 0.5rem;
    font-size: 0.875rem;
    font-weight: 500;
    border-radius: 4px;
    background-color: #6c757d;
    color: #fff;
}

.badge-success {
    background-color: #28a745;
}

.badge-danger {
    background-color: #dc3545;
}

.badge-warning {
    background-color: #ffc107;
    color: #333;
}

.badge-info {
    background-color: #17a2b8;
}

.badge-secondary {
    background-color: #6c757d;
}

/* Пагинация */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
    list-style: none;
    padding: 0;
}

.pagination li {
    list-style: none;
    margin: 0;
}

.pagination a,
.pagination span {
    display: inline-block;
    padding: 0.5rem 0.75rem;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    color: #007bff;
    text-decoration: none;
    transition: all 0.2s;
}

.pagination a:hover {
    background-color: #f8f9fa;
    border-color: #adb5bd;
}

.pagination li.active a {
    background-color: #007bff;
    color: #fff;
    border-color: #007bff;
}

.pagination li.disabled a,
.pagination li.disabled span {
    color: #6c757d;
    cursor: not-allowed;
    opacity: 0.6;
}

.pagination li.disabled a:hover {
    background-color: transparent;
    border-color: #dee2e6;
}

/* Алерты */
.alert {
    padding: 1rem;
    margin-bottom: 1rem;
    border: 1px solid transparent;
    border-radius: 4px;
}

.alert-info {
    background-color: #d1ecf1;
    border-color: #bee5eb;
    color: #0c5460;
}

.alert-success {
    background-color: #d4edda;
    border-color: #c3e6cb;
    color: #155724;
}

.alert-danger {
    background-color: #f8d7da;
    border-color: #f5c6cb;
    color: #721c24;
}

.alert-warning {
    background-color: #fff3cd;
    border-color: #ffeaa7;
    color: #856404;
}

/* Списки */
ul, ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
}

dl {
    margin-bottom: 1rem;
}

dt {
    font-weight: 600;
    color: #2c3e50;
    margin-top: 0.75rem;
}

dd {
    margin-left: 0;
    margin-bottom: 0.5rem;
    color: #333;
}

/* Сетка */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -0.5rem;
}

.col {
    flex: 1;
    padding: 0 0.5rem;
}

.col-md-6 {
    flex: 0 0 50%;
    max-width: 50%;
    padding: 0 0.5rem;
}

.col-md-4 {
    flex: 0 0 33.333333%;
    max-width: 33.333333%;
    padding: 0 0.5rem;
}

.col-md-3 {
    flex: 0 0 25%;
    max-width: 25%;
    padding: 0 0.5rem;
}

.col-12 {
    flex: 0 0 100%;
    max-width: 100%;
    padding: 0 0.5rem;
}

/* Утилиты */
.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.25rem; }
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 1rem; }
.mb-4 { margin-bottom: 1.5rem; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-top: 0.5rem; }
.mt-3 { margin-top: 1rem; }
.mt-4 { margin-top: 1.5rem; }

.text-center { text-align: center; }
.text-end { text-align: right; }
.text-start { text-align: left; }

.d-none { display: none !important; }

.d-flex { display: flex; }
.justify-content-between { justify-content: space-between; }
.align-items-center { align-items: center; }
.align-items-end { align-items: flex-end; }

/* Notion-style variables */
:root {
    --notion-text: #37352f;
    --notion-bg: #ffffff;
    --notion-gray-bg: #f7f7f5;
    --notion-border: #e9e9e7;
    --notion-shadow: 0 1px 2px rgba(15, 15, 15, 0.05);
}

/* Schedule header */
.schedule-section {
    background: var(--notion-bg);
    border: 1px solid var(--notion-border);
    border-radius: 12px;
    padding: 2rem;
    box-shadow: 0 4px 12px rgba(15, 15, 15, 0.04);
}

.schedule-header {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    align-items: flex-start;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.schedule-date-label {
    font-size: 1.4rem;
    font-weight: 600;
    color: var(--notion-text);
}

.schedule-date-actions .schedule-date-buttons {
    display: flex;
    gap: 0.35rem;
    flex-wrap: wrap;
    margin-top: 0.75rem;
}

.schedule-date-buttons button {
    min-width: 110px;
}

.schedule-controls {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.schedule-controls .form-group {
    flex: 1;
    min-width: 220px;
}

.schedule-status-filters {
    flex: 2;
    min-width: 400px;
}

.schedule-status-filters .checkbox-grid {
    padding: 0.35rem 0.5rem;
}

.schedule-status-filters .checkbox-pill {
    padding: 0.2rem 0.4rem;
    font-size: 0.8rem;
}

.schedule-status-filters .checkbox-pill .notion-badge {
    font-size: 0.65rem;
    padding: 0.15rem 0.4rem;
}

.notion-board {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 16px;
}

.notion-column {
    min-width: 200px;
    background: var(--notion-gray-bg);
    border-radius: 8px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.notion-column-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 0.5rem;
}

.notion-column-header h3 {
    font-size: 0.95rem;
    font-weight: 600;
    margin: 0;
    color: var(--notion-text);
}

.notion-column-count {
    font-size: 0.8rem;
    color: #6c757d;
}

.notion-column-body {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.notion-card {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
    padding: 6px 8px;
    background: var(--notion-bg);
    border-radius: 6px;
    border: 1px solid var(--notion-border);
    box-shadow: var(--notion-shadow);
    text-decoration: none;
    color: inherit;
    transition: background 0.1s ease, transform 0.15s ease;
}

.notion-card:hover {
    background: #fdfdfd;
    transform: translateY(-1px);
}

.notion-card-time {
    font-size: 0.6rem;
    color: #6c757d;
}

.notion-card-patient {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--notion-text);
    line-height: 1.2;
}

.notion-card-services {
    font-size: 0.55rem;
    color: #5f6368;
    line-height: 1.3;
}

.notion-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.35rem;
    margin-top: 2px;
}

.notion-card-price {
    font-size: 0.55rem;
    font-weight: 600;
    color: #37352f;
}

.notion-badge {
    padding: 0.12rem 0.4rem;
    border-radius: 999px;
    font-size: 0.5rem;
    font-weight: 600;
}

.notion-badge-confirmed {
    background: #e6f8ea;
    color: #2d7d46;
}

.notion-badge-cancelled {
    background: #fbeae9;
    color: #d44c47;
}

.notion-badge-new {
    background: #e9f3fb;
    color: #2e6e9e;
}

.notion-empty {
    padding: 0.5rem;
    border-radius: 6px;
    background: #fff;
    border: 1px dashed #dcdcdc;
    text-align: center;
}

@media (max-width: 768px) {
    .notion-board {
        flex-direction: column;
    }

    .schedule-header {
        flex-direction: column;
    }

    .schedule-controls {
        flex-direction: column;
    }
}

/* HTMX индикаторы */
.htmx-indicator {
    opacity: 0;
    transition: opacity 0.2s;
}

.htmx-request .htmx-indicator {
    opacity: 1;
}

/* Адаптивность */
@media (max-width: 768px) {
    .container {
        padding: 1rem 0.5rem;
    }

    h1 {
        font-size: 1.5rem;
    }

    nav .container {
        flex-direction: column;
        gap: 1rem;
    }

    .nav-links {
        flex-direction: column;
        width: 100%;
    }

    .col-md-6,
    .col-md-4,
    .col-md-3 {
        flex: 0 0 100%;
        max-width: 100%;
    }

    table {
        font-size: 0.875rem;
    }

    th, td {
        padding: 0.5rem;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    table {
        font-size: 0.75rem;
    }

    th, td {
        padding: 0.25rem;
    }
}
