/* Цветовая схема */
:root {
    --primary-color: #ec4899;
    --secondary-color: #f97316;
    --success-color: #10b981;
    --warning-color: #f59e0b;
    --error-color: #ef4444;
    --info-color: #3b82f6;
    --bg-color: #f8fafc;
    --card-bg: #ffffff;
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --border-color: #e2e8f0;
    
    /* Мягкие градиенты */
    --gradient-primary: linear-gradient(135deg, rgba(236, 72, 153, 0.1) 0%, rgba(249, 115, 22, 0.1) 100%);
    --gradient-secondary: linear-gradient(135deg, rgba(236, 72, 153, 0.05) 0%, rgba(249, 115, 22, 0.05) 100%);
    --gradient-card: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    --gradient-bg: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 50%, #e2e8f0 100%);
}

/* Базовые стили */
html {
    font-size: 13px;
    position: relative;
    min-height: 100%;
}

@media (min-width: 768px) {
  html {
        font-size: 14px;
    }
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Inter', 'Segoe UI', sans-serif;
    background: var(--gradient-bg);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Poppins', 'Inter', sans-serif;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.1rem; }
h5 { font-size: 1rem; }
h6 { font-size: 0.9rem; }

/* Убираем стрелки у полей ввода чисел (Возраст, Количество занятий, Цена за единицу и др.) */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button,
.form-control[type="number"]::-webkit-outer-spin-button,
.form-control[type="number"]::-webkit-inner-spin-button,
.no-spinner::-webkit-outer-spin-button,
.no-spinner::-webkit-inner-spin-button {
    -webkit-appearance: none !important;
    margin: 0;
    display: none;
}
input[type="number"],
.form-control[type="number"],
.no-spinner {
    -moz-appearance: textfield;
    appearance: textfield;
}
.no-spinner {
    -moz-appearance: textfield !important;
    appearance: textfield !important;
}

/* Layout */
.main-container {
    display: flex;
    min-height: 100vh;
}

/* Боковое меню */
.sidebar {
    width: 220px;
    background: linear-gradient(180deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    position: fixed;
    height: 100vh;
    overflow-y: auto;
    box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar.collapsed {
    transform: translateX(-100%);
}

.sidebar-header {
    padding: 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-header h3 {
    margin: 0;
    color: white;
    font-size: 1.25rem;
    font-weight: 700;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0.5rem 0;
}

.sidebar-menu li {
    margin: 0.15rem 0;
}

.sidebar-menu a {
    display: flex;
    align-items: center;
    padding: 0.625rem 1rem;
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.2s ease;
    border-left: 3px solid transparent;
    font-size: 0.9rem;
}

.sidebar-menu a:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-left-color: white;
    color: white;
}

.sidebar-menu a.active {
    background-color: rgba(255, 255, 255, 0.15);
    border-left-color: white;
    color: white;
    font-weight: 600;
}

.sidebar-menu a i {
    margin-right: 0.75rem;
    width: 20px;
    text-align: center;
}

/* Основной контент */
.main-content {
    flex: 1;
    margin-left: 220px;
    transition: margin-left 0.3s ease;
}

.main-content.expanded {
    margin-left: 0;
}

/* Верхняя панель */
.topbar {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    backdrop-filter: blur(10px);
    padding: 0.75rem 1.5rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(236, 72, 153, 0.1);
}

.topbar h2 {
    margin: 0;
    font-size: 1.25rem;
    color: var(--text-primary);
}

.topbar-actions {
    display: flex;
    gap: 1rem;
    align-items: center;
}

/* Контент */
.content-wrapper {
    padding: 1rem 1.5rem;
    background: transparent;
    min-height: calc(100vh - 200px);
}

/* Карточки */
.card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(236, 72, 153, 0.1);
    transition: all 0.3s ease;
    margin-bottom: 1rem;
    overflow: hidden;
}

.card:hover {
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.15), 0 4px 8px rgba(0, 0, 0, 0.1);
    transform: translateY(-3px);
    border-color: rgba(236, 72, 153, 0.2);
}

.card-header {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 8px 8px 0 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.card-header h3 {
    margin: 0;
    color: white;
    font-size: 1.1rem;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.card-body {
    padding: 1rem;
    background: rgba(255, 255, 255, 0.5);
}

/* Кнопки */
.btn {
    border-radius: 6px;
    padding: 0.375rem 0.875rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 0.875rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.3);
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:hover::before {
    width: 300px;
    height: 300px;
}

.btn-sm {
    padding: 0.25rem 0.625rem;
    font-size: 0.8rem;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    position: relative;
    z-index: 1;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #db2777 0%, #ea580c 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(236, 72, 153, 0.4), 0 2px 4px rgba(0, 0, 0, 0.2);
}

.btn-secondary {
    background: var(--secondary-color);
    color: white;
}

.btn-secondary:hover {
    background: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(249, 115, 22, 0.3);
}

.btn-success {
    background: var(--success-color);
    color: white;
}

.btn-success:hover {
    background: #059669;
}

.btn-danger {
    background: var(--error-color);
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-outline-primary {
    border: 2px solid var(--primary-color);
    color: var(--primary-color);
    background: transparent;
}

.btn-outline-primary:hover {
    background: var(--primary-color);
    color: white;
}

/* Формы */
.form-control {
    border-radius: 6px;
    border: 1px solid rgba(236, 72, 153, 0.2);
    padding: 0.5rem 0.75rem;
    transition: all 0.3s ease;
    font-size: 0.875rem;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(5px);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1), 0 2px 8px rgba(236, 72, 153, 0.15);
    outline: none;
    background: white;
}

.form-label {
    font-size: 0.875rem;
    margin-bottom: 0.375rem;
    font-weight: 500;
    color: var(--text-primary);
}

.form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
    outline: none;
}

.form-label {
    font-weight: 500;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.form-select {
    border-radius: 6px;
    border: 1px solid var(--border-color);
}

.form-select:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.1);
}

/* Одинаковая ширина и выравнивание по вертикали: цвет и HEX услуги */
.input-group-color {
    display: flex;
    align-items: stretch;
}
.input-group-color .service-color-input {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
    text-align: center;
    height: 2.5rem;
    box-sizing: border-box;
}
.input-group-color input[type="color"].service-color-input {
    padding: 0.25rem;
    cursor: pointer;
    border-right: 1px solid var(--border-color);
}
.input-group-color input[type="text"].service-color-input {
    flex: 1 1 0;
    min-width: 0;
    width: 0;
}

/* Таблицы */
.table {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    overflow: hidden;
    font-size: 0.875rem;
    border: 1px solid rgba(236, 72, 153, 0.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.table thead {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
}

.table thead th {
    border: none;
    padding: 0.625rem 0.75rem;
    font-weight: 600;
    font-size: 0.85rem;
}

.table tbody tr {
    transition: background-color 0.2s ease;
}

.table tbody tr:hover {
    background-color: rgba(236, 72, 153, 0.05);
}

.table tbody td {
    padding: 0.625rem 0.75rem;
    border-top: 1px solid var(--border-color);
}

/* Статистические карточки */
.stats-card {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border-left: 4px solid var(--primary-color);
    border: 1px solid rgba(236, 72, 153, 0.15);
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.stats-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 0;
}

.stats-card:hover::before {
    opacity: 1;
}

.stats-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(236, 72, 153, 0.2), 0 4px 8px rgba(0, 0, 0, 0.1);
    border-color: rgba(236, 72, 153, 0.3);
}

.stats-card > * {
    position: relative;
    z-index: 1;
}

.stats-card h3 {
    font-size: 1.5rem;
    margin: 0.25rem 0;
    color: var(--primary-color);
    font-weight: 700;
}

.stats-card p {
    color: var(--text-secondary);
    margin: 0;
    font-size: 0.8rem;
}

/* Алерты */
.alert {
    border-radius: 8px;
    padding: 0.75rem 1rem;
    border: none;
    font-size: 0.875rem;
    margin-bottom: 1rem;
    backdrop-filter: blur(10px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.alert-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
    border-left: 4px solid var(--success-color);
}

.alert-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
    border-left: 4px solid var(--error-color);
}

.alert-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
    border-left: 4px solid var(--warning-color);
}

.alert-info {
    background-color: rgba(59, 130, 246, 0.1);
    color: var(--info-color);
    border-left: 4px solid var(--info-color);
}

/* Badge */
.badge {
    padding: 0.25rem 0.5rem;
    border-radius: 3px;
    font-weight: 500;
    font-size: 0.7rem;
}

.badge-success {
    background-color: rgba(16, 185, 129, 0.1);
    color: var(--success-color);
}

.badge-warning {
    background-color: rgba(245, 158, 11, 0.1);
    color: var(--warning-color);
}

.badge-danger {
    background-color: rgba(239, 68, 68, 0.1);
    color: var(--error-color);
}

.badge-primary {
    background-color: rgba(236, 72, 153, 0.1);
    color: var(--primary-color);
}

/* Footer */
.footer {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(255, 255, 255, 0.98) 100%);
    backdrop-filter: blur(10px);
    border-top: 1px solid rgba(236, 72, 153, 0.1);
    padding: 1rem 1.5rem;
    margin-top: 1.5rem;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.8rem;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.05);
}

/* Адаптивность */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.show {
        transform: translateX(0);
    }

    .main-content {
        margin-left: 0;
    }

    .content-wrapper {
        padding: 1rem;
    }

    .topbar {
        padding: 1rem;
    }
}

/* Утилиты */
.text-primary {
    color: var(--primary-color) !important;
}

.text-secondary {
    color: var(--text-secondary) !important;
}

.bg-primary {
    background-color: var(--primary-color) !important;
}

.bg-secondary {
    background-color: var(--secondary-color) !important;
}

/* Анимации */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.3s ease;
}

/* Календарь */
.calendar {
    background: var(--gradient-card);
    backdrop-filter: blur(10px);
    border-radius: 8px;
    padding: 1rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(236, 72, 153, 0.1);
}

.calendar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 0.5rem;
}

.calendar-day {
    padding: 0.5rem;
    text-align: center;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 0.85rem;
    min-height: 70px;
    border: 1px solid rgba(236, 72, 153, 0.1);
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(5px);
    position: relative;
}

.calendar-day:hover {
    background: var(--gradient-primary);
    border-color: var(--primary-color);
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(236, 72, 153, 0.2), 0 2px 4px rgba(0, 0, 0, 0.1);
}

.calendar-day.today {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    font-weight: 600;
    border-color: var(--primary-color);
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.3);
}

.calendar-day.today:hover {
    background: linear-gradient(135deg, #db2777 0%, #ea580c 100%);
}

.calendar-day.has-lesson {
    background: var(--gradient-secondary);
    border: 2px solid var(--primary-color);
    box-shadow: 0 2px 6px rgba(236, 72, 153, 0.15);
}

.calendar-day.has-lesson.today {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
}

.calendar-day.empty-day {
    background: transparent;
    border: none;
    cursor: default;
}

.calendar-day.empty-day:hover {
    background: transparent;
    transform: none;
    box-shadow: none;
}

.calendar-day.past-day {
    opacity: 0.6;
}

.calendar-day.past-day:hover {
    opacity: 0.8;
}

/* Модальные окна */
.modal-content {
    border-radius: 8px;
    border: none;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.modal-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    border-radius: 8px 8px 0 0;
    border: none;
    padding: 1.25rem 1.5rem;
}

.modal-header .btn-close {
    filter: brightness(0) invert(1);
}

.modal-body {
    padding: 1.5rem;
}

.modal-footer {
    border-top: 1px solid var(--border-color);
    padding: 1rem 1.5rem;
}

/* Фокус для доступности */
.btn:focus, .form-control:focus, .form-select:focus {
    box-shadow: 0 0 0 3px rgba(236, 72, 153, 0.2);
    outline: none;
}
