* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --luna-bg: #E8E3F5; /* Светло-лавандовый фиолетовый */
    --luna-dark: #6B5B95; /* Темно-фиолетовый */
    --luna-text: #2C2340; /* Темный фиолетовый для текста */
    --luna-white: #FFFFFF; /* Белый */
    --luna-accent: #8B7AB8; /* Средний фиолетовый для акцентов */
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--luna-bg);
    color: var(--luna-text);
    padding: 0;
    min-height: 100vh;
    overflow-x: hidden;
}

/* Экраны */
.screen {
    display: none;
    padding: 16px;
    max-width: 600px;
    margin: 0 auto;
    min-height: 100vh;
    background: var(--luna-bg);
}

.screen.active {
    display: block;
}

/* Заголовок */
.header {
    margin-bottom: 24px;
    position: relative;
    text-align: center;
    padding-top: 8px;
}

.header h1 {
    font-size: 28px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--luna-text);
    letter-spacing: 0.5px;
    padding: 0 90px;
    line-height: 1.2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.header-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, var(--luna-dark) 0%, var(--luna-accent) 100%);
    border-radius: 12px;
    font-size: 20px;
    flex-shrink: 0;
    box-shadow: 0 2px 8px rgba(107, 91, 149, 0.25);
}

.subtitle {
    color: var(--luna-dark);
    font-size: 15px;
    text-align: center;
    opacity: 0.8;
    padding: 0 20px;
}

.btn-back {
    position: absolute;
    left: -8px;
    top: 50%;
    transform: translateY(-50%) translateY(4px);
    background: var(--luna-white);
    border: 1.5px solid rgba(107, 91, 149, 0.2);
    color: var(--luna-dark);
    font-size: 11px;
    cursor: pointer;
    padding: 5px 9px;
    border-radius: 8px;
    font-weight: 500;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    white-space: nowrap;
    box-shadow: 0 2px 4px rgba(107, 91, 149, 0.08);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 3px;
    min-height: 28px;
    backdrop-filter: blur(10px);
}

.btn-back:hover {
    background: linear-gradient(135deg, rgba(107, 91, 149, 0.08) 0%, rgba(107, 91, 149, 0.12) 100%);
    border-color: var(--luna-dark);
    box-shadow: 0 3px 8px rgba(107, 91, 149, 0.15);
    transform: translateY(-50%) translateY(4px) translateX(2px);
}

.btn-back:active {
    background: rgba(107, 91, 149, 0.1);
    transform: translateY(-50%) translateY(4px) scale(0.96);
    box-shadow: 0 1px 3px rgba(107, 91, 149, 0.12);
}

/* Контент */
.content {
    padding-bottom: 20px;
}

/* Главное меню */
.menu-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
    margin-top: 32px;
}

.menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 28px 20px;
    background: linear-gradient(135deg, var(--luna-white) 0%, rgba(255, 255, 255, 0.95) 100%);
    border: 2px solid var(--luna-dark);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-height: 130px;
    box-shadow: 0 4px 16px rgba(107, 91, 149, 0.12), 
                0 2px 4px rgba(107, 91, 149, 0.08);
    position: relative;
    overflow: hidden;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(107, 91, 149, 0.03) 0%, rgba(139, 122, 184, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.menu-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 91, 149, 0.18), 
                0 4px 8px rgba(107, 91, 149, 0.12);
    border-color: var(--luna-accent);
}

.menu-item:hover::before {
    opacity: 1;
}

.menu-item:hover .menu-icon {
    transform: scale(1.05);
}

.menu-item:hover .menu-text {
    color: var(--luna-dark);
    font-weight: 600;
}

.menu-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: #D32F2F;
    color: var(--luna-white);
    font-size: 12px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 12px;
    min-width: 22px;
    text-align: center;
    box-shadow: 0 2px 6px rgba(211, 47, 47, 0.4);
}

.menu-item:active {
    transform: translateY(0) scale(0.97);
    background: linear-gradient(135deg, var(--luna-dark) 0%, var(--luna-accent) 100%);
    border-color: var(--luna-dark);
    box-shadow: 0 2px 8px rgba(107, 91, 149, 0.25);
}

.menu-item:active::before {
    opacity: 0;
}

.menu-item:active .menu-icon,
.menu-item:active .menu-text {
    color: var(--luna-white);
    transform: scale(1);
}

.menu-icon {
    font-size: 42px;
    margin-bottom: 10px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    filter: drop-shadow(0 2px 4px rgba(107, 91, 149, 0.15));
    position: relative;
    z-index: 1;
}

.menu-text {
    font-size: 15px;
    font-weight: 500;
    color: var(--luna-text);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    z-index: 1;
    letter-spacing: 0.2px;
}

/* Кнопки */
.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--luna-dark) 0%, var(--luna-accent) 100%);
    color: var(--luna-white);
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-bottom: 12px;
    box-shadow: 0 4px 16px rgba(107, 91, 149, 0.25), 
                0 2px 4px rgba(107, 91, 149, 0.15);
    letter-spacing: 0.3px;
    position: relative;
    overflow: hidden;
}

.btn-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(107, 91, 149, 0.35), 
                0 4px 8px rgba(107, 91, 149, 0.2);
}

.btn-primary:hover::before {
    opacity: 1;
}

.btn-primary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(107, 91, 149, 0.3);
}

.btn-primary:active::before {
    opacity: 0;
}

.btn-secondary {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, var(--luna-white) 0%, rgba(255, 255, 255, 0.95) 100%);
    color: var(--luna-dark);
    border: 2px solid var(--luna-dark);
    border-radius: 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(107, 91, 149, 0.1);
}

.btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(107, 91, 149, 0.05) 0%, rgba(139, 122, 184, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-secondary:hover {
    transform: translateY(-2px);
    border-color: var(--luna-accent);
    box-shadow: 0 4px 12px rgba(107, 91, 149, 0.18);
}

.btn-secondary:hover::before {
    opacity: 1;
}

.btn-secondary:active {
    background: linear-gradient(135deg, var(--luna-dark) 0%, var(--luna-accent) 100%);
    color: var(--luna-white);
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(107, 91, 149, 0.25);
}

.btn-secondary:active::before {
    opacity: 0;
}

.btn-danger {
    width: 100%;
    padding: 14px;
    background: linear-gradient(135deg, #D32F2F 0%, #B71C1C 100%);
    color: var(--luna-white);
    border: none;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    margin-top: 12px;
    box-shadow: 0 4px 16px rgba(211, 47, 47, 0.3), 
                0 2px 4px rgba(211, 47, 47, 0.2);
    position: relative;
    overflow: hidden;
}

.btn-danger::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(211, 47, 47, 0.4), 
                0 4px 8px rgba(211, 47, 47, 0.25);
}

.btn-danger:hover::before {
    opacity: 1;
}

.btn-danger:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 8px rgba(211, 47, 47, 0.3);
}

.btn-danger:active::before {
    opacity: 0;
}

/* Загрузка и пустые состояния */
.loading {
    text-align: center;
    color: var(--luna-dark);
    padding: 48px 32px;
    font-size: 16px;
    opacity: 0.7;
}

.empty {
    text-align: center;
    color: var(--luna-dark);
    padding: 48px 32px;
    font-size: 16px;
    opacity: 0.7;
}

/* Ссылка */
.link-box {
    background: var(--luna-white);
    border: 2px solid var(--luna-dark);
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 16px;
    box-shadow: 0 4px 12px rgba(107, 91, 149, 0.1);
}

.link-text {
    word-break: break-all;
    font-size: 14px;
    margin-bottom: 16px;
    color: var(--luna-dark);
    font-weight: 500;
    line-height: 1.6;
}

/* Вкладки */
.tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 20px;
}

.tab-btn {
    flex: 1;
    padding: 14px;
    background: var(--luna-white);
    border: 2px solid var(--luna-dark);
    border-radius: 12px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    color: var(--luna-dark);
}

.tab-btn.active {
    background: var(--luna-dark);
    color: var(--luna-white);
    border-color: var(--luna-dark);
    box-shadow: 0 2px 8px rgba(107, 91, 149, 0.3);
}

.tab-btn:active {
    transform: scale(0.98);
}

/* Списки */
.list-item {
    background: var(--luna-white);
    border: 2px solid var(--luna-dark);
    border-radius: 16px;
    padding: 18px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(107, 91, 149, 0.1);
}

.list-item:active {
    transform: scale(0.98);
    background: var(--luna-dark);
    border-color: var(--luna-dark);
}

.list-item:active .list-item-title,
.list-item:active .list-item-meta {
    color: var(--luna-white);
}

.list-item-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 8px;
}

.list-item-title {
    font-weight: 600;
    font-size: 17px;
    flex: 1;
    color: var(--luna-text);
}

.list-item-meta {
    font-size: 13px;
    color: var(--luna-dark);
    margin-top: 6px;
    opacity: 0.8;
}

/* Формы */
.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 10px;
    font-weight: 600;
    font-size: 15px;
    color: var(--luna-text);
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 14px;
    border: 2px solid var(--luna-dark);
    border-radius: 12px;
    font-size: 16px;
    font-family: inherit;
    background: var(--luna-white);
    color: var(--luna-text);
    transition: all 0.2s;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--luna-accent);
    box-shadow: 0 0 0 3px rgba(139, 122, 184, 0.1);
}

.form-group textarea {
    resize: vertical;
    min-height: 100px;
}

.hint {
    font-size: 13px;
    color: var(--luna-dark);
    margin-top: 6px;
    opacity: 0.7;
}

.duration-buttons {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    margin-bottom: 14px;
}

.duration-btn {
    padding: 14px;
    background: linear-gradient(135deg, var(--luna-white) 0%, rgba(255, 255, 255, 0.95) 100%);
    border: 2px solid var(--luna-dark);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    color: var(--luna-dark);
    position: relative;
    overflow: hidden;
    box-shadow: 0 2px 4px rgba(107, 91, 149, 0.08);
}

.duration-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(107, 91, 149, 0.05) 0%, rgba(139, 122, 184, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.duration-btn:hover {
    transform: translateY(-2px);
    border-color: var(--luna-accent);
    box-shadow: 0 4px 10px rgba(107, 91, 149, 0.15);
}

.duration-btn:hover::before {
    opacity: 1;
}

.duration-btn:active {
    background: linear-gradient(135deg, var(--luna-dark) 0%, var(--luna-accent) 100%);
    color: var(--luna-white);
    transform: translateY(0) scale(0.98);
    box-shadow: 0 2px 6px rgba(107, 91, 149, 0.25);
}

.duration-btn:active::before {
    opacity: 0;
}

/* График */
.quick-setup {
    margin-bottom: 16px;
}

.btn-quick {
    width: 100%;
    padding: 14px;
    background: var(--luna-dark);
    color: var(--luna-white);
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(107, 91, 149, 0.3);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
    position: relative;
    overflow: hidden;
}

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

.btn-quick:active::before {
    width: 300px;
    height: 300px;
}

.btn-quick:hover {
    background: var(--luna-accent);
    box-shadow: 0 6px 16px rgba(107, 91, 149, 0.4);
}

.btn-quick:active {
    opacity: 0.9;
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(107, 91, 149, 0.3);
}

.btn-quick:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.3), 0 4px 12px rgba(107, 91, 149, 0.3);
}

.week-schedule {
    margin-bottom: 20px;
}

.week-schedule h2 {
    font-size: 17px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--luna-text);
}

.weekdays {
    display: flex;
    flex-direction: column;
    background: rgba(255, 255, 255, 0.6);
    border: 2px solid var(--luna-dark);
    border-radius: 16px;
    padding: 6px;
    gap: 0;
}

.weekday-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: transparent;
    border: none;
    border-radius: 8px;
    box-shadow: none;
    min-height: auto;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    margin: 2px 0;
}

.weekday-item:hover {
    background: rgba(107, 91, 149, 0.05);
}

.weekday-item:not(:last-child) {
    border-bottom: 1px solid rgba(107, 91, 149, 0.2);
}

.weekday-name {
    font-weight: 600;
    flex: 0 0 115px;
    color: var(--luna-text);
    font-size: 14px;
    display: flex;
    align-items: center;
}

.weekday-toggle {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.toggle-switch {
    position: relative;
    width: 48px;
    height: 26px;
    background: linear-gradient(135deg, #ccc 0%, #b0b0b0 100%);
    border-radius: 13px;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.1);
}

.toggle-switch input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 100%;
    height: 100%;
    margin: 0;
    padding: 0;
    cursor: pointer;
    z-index: 2;
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider {
    background: var(--luna-dark);
}

.toggle-switch input[type="checkbox"]:checked + .toggle-slider::after {
    transform: translateX(22px);
}

.toggle-switch:active {
    transform: scale(0.95);
}

.toggle-switch.active {
    background: var(--luna-dark);
}

.toggle-slider {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ccc;
    border-radius: 13px;
    transition: background 0.3s;
    cursor: pointer;
}

.toggle-slider::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    background: white;
    border-radius: 50%;
    top: 3px;
    left: 3px;
    transition: transform 0.3s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.toggle-switch.active .toggle-slider {
    background: var(--luna-dark);
}

.toggle-switch.active .toggle-slider::after {
    transform: translateX(22px);
}

.time-input {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.time-input input {
    width: 70px;
    padding: 8px 10px;
    border: 2px solid var(--luna-dark);
    border-radius: 8px;
    font-size: 14px;
    background: var(--luna-white);
    color: var(--luna-text);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.time-input input:focus {
    outline: none;
    border-color: var(--luna-accent);
    box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.1);
}

.time-input input:active {
    transform: scale(0.98);
}

.time-input span {
    font-size: 14px;
    color: var(--luna-dark);
}

.calendar-section {
    margin-bottom: 16px;
    width: 100%;
    overflow: hidden;
}

.calendar-section h2 {
    font-size: 17px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--luna-text);
}

.calendar-nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.month-year {
    font-size: 18px;
    font-weight: 600;
    color: var(--luna-text);
}

.btn-nav {
    width: 44px;
    height: 44px;
    border: 2px solid var(--luna-dark);
    background: linear-gradient(135deg, var(--luna-white) 0%, rgba(255, 255, 255, 0.95) 100%);
    border-radius: 12px;
    font-size: 20px;
    cursor: pointer;
    color: var(--luna-dark);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
    box-shadow: 0 2px 4px rgba(107, 91, 149, 0.08);
    position: relative;
    overflow: hidden;
}

.btn-nav::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(107, 91, 149, 0.05) 0%, rgba(139, 122, 184, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.btn-nav:hover::before {
    opacity: 1;
}

.btn-nav:hover {
    background: var(--luna-dark);
    color: var(--luna-white);
}

.btn-nav:active {
    background: var(--luna-accent);
    color: var(--luna-white);
    transform: scale(0.95);
}

.btn-nav:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.2);
}

.calendar {
    display: flex;
    justify-content: center;
    width: 100%;
    max-width: 100%;
}

.calendar-grid {
    display: grid;
    grid-template-columns: repeat(7, 45px);
    grid-template-rows: auto repeat(6, 45px);
    gap: 5px;
    width: fit-content;
    max-width: calc(100% - 20px);
    justify-items: center;
    align-items: center;
    margin: 0 auto;
}

.calendar-grid > .calendar-weekday {
    padding: 8px 4px;
    min-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.calendar-grid > .calendar-day {
    min-height: 0;
}

.calendar-weekday {
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--luna-dark);
}

.calendar-header {
    text-align: center;
    padding: 8px 4px;
    font-size: 12px;
    font-weight: 600;
    color: var(--luna-dark);
}

.calendar-day {
    position: relative;
    width: 45px;
    height: 45px;
    box-sizing: border-box;
    overflow: visible;
    margin: 0 auto;
    cursor: pointer;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
}

.calendar-day:not(.empty) {
    cursor: pointer;
}

.calendar-day.empty {
    cursor: default;
    pointer-events: none;
}

.calendar-day > span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    min-width: 0;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    border: 2px solid transparent;
    box-sizing: border-box;
    text-align: center;
    line-height: 1.2;
    white-space: nowrap;
    overflow: visible;
    text-overflow: ellipsis;
    pointer-events: none;
    user-select: none;
}

.calendar-day:active:not(.empty) > span {
    transform: scale(0.95);
    opacity: 0.8;
}

.calendar-day.empty > span {
    cursor: default;
    opacity: 0.3;
}

.calendar-day:not(.empty) > span {
    background: var(--luna-white);
    border: 2px solid var(--luna-dark);
    color: var(--luna-text);
}

.calendar-day.working > span {
    background: var(--luna-white);
    border-color: var(--luna-dark);
    color: var(--luna-text);
}

.calendar-day.off > span {
    background: rgba(107, 91, 149, 0.1);
    color: var(--luna-dark);
    opacity: 0.6;
}

.calendar-day.today > span {
    border-color: var(--luna-dark);
    background: var(--luna-dark);
    color: var(--luna-white);
    font-weight: 600;
}

.calendar-day.selected > span,
.calendar-day-selected > span {
    background: var(--luna-accent) !important;
    color: var(--luna-white) !important;
    border-color: var(--luna-dark) !important;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(107, 91, 149, 0.3);
}

.calendar-day:not(.empty):hover > span {
    box-shadow: 0 2px 8px rgba(107, 91, 149, 0.3);
    transform: scale(1.02);
}

.calendar-day:not(.empty):active > span {
    transform: scale(0.9);
    opacity: 0.8;
}

.calendar-day.past > span {
    background: rgba(107, 91, 149, 0.15) !important;
    border-color: rgba(107, 91, 149, 0.3) !important;
    color: rgba(44, 35, 64, 0.5) !important;
    opacity: 0.6;
}

.calendar-day.past.working > span {
    background: rgba(107, 91, 149, 0.15) !important;
    border-color: rgba(107, 91, 149, 0.3) !important;
    color: rgba(44, 35, 64, 0.5) !important;
}

.calendar-day.past.off > span {
    background: rgba(107, 91, 149, 0.08) !important;
    border-color: rgba(107, 91, 149, 0.2) !important;
    color: rgba(107, 91, 149, 0.4) !important;
}

/* Прошедшие дни в графике работы - не кликабельны */
.schedule-calendar .calendar-day.past {
    cursor: default !important;
    pointer-events: none;
}

.schedule-calendar .calendar-day.past:not(.empty):hover > span {
    transform: none;
    box-shadow: none;
}

/* Прошедшие дни в календаре записей клиента - не кликабельны */
.bookings-calendar .calendar-day.past.disabled {
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.bookings-calendar .calendar-day.past.disabled:not(.empty):hover > span {
    transform: none !important;
    box-shadow: none !important;
}

/* Выходные дни в календаре записей клиента - не кликабельны */
.bookings-calendar .calendar-day.off-day.disabled {
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.bookings-calendar .calendar-day.off-day.disabled:not(.empty):hover > span {
    transform: none !important;
    box-shadow: none !important;
}

.bookings-calendar .calendar-day.off-day > span {
    background: rgba(107, 91, 149, 0.08) !important;
    border-color: rgba(107, 91, 149, 0.2) !important;
    color: rgba(107, 91, 149, 0.5) !important;
    opacity: 0.7;
}

/* Дни без доступных слотов - закрашены и не кликабельны */
.bookings-calendar .calendar-day.no-slots.disabled {
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.bookings-calendar .calendar-day.no-slots > span {
    background: rgba(107, 91, 149, 0.12) !important;
    border-color: rgba(107, 91, 149, 0.25) !important;
    color: rgba(107, 91, 149, 0.5) !important;
    opacity: 0.6;
}

.bookings-calendar .calendar-day.no-slots.disabled:not(.empty):hover > span {
    transform: none !important;
    box-shadow: none !important;
}

/* Общие стили для недоступных дней */
.bookings-calendar .calendar-day.disabled {
    cursor: not-allowed !important;
    pointer-events: none !important;
}

.bookings-calendar .calendar-day.disabled:not(.empty):hover > span {
    transform: none !important;
    box-shadow: none !important;
}

.calendar-day:not(.empty) > span:active {
    transform: scale(0.9);
}

.actions {
    margin-top: 20px;
}

/* Настройки */
.settings-section {
    margin-bottom: 36px;
}

.settings-section h2 {
    font-size: 20px;
    margin-bottom: 12px;
    font-weight: 600;
    color: var(--luna-text);
}

/* Детали записи */
.booking-detail {
    background: var(--luna-white);
    border: 2px solid var(--luna-dark);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 12px rgba(107, 91, 149, 0.1);
}

.booking-detail-row {
    margin-bottom: 18px;
}

.booking-detail-row:last-child {
    margin-bottom: 0;
}

.booking-detail-label {
    font-size: 13px;
    color: var(--luna-dark);
    margin-bottom: 6px;
    opacity: 0.8;
    font-weight: 500;
}

.booking-detail-value {
    font-size: 17px;
    font-weight: 600;
    color: var(--luna-text);
}

.booking-actions {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-top: 24px;
}

.booking-actions button {
    padding: 14px;
    border: 2px solid var(--luna-dark);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--luna-white);
    color: var(--luna-dark);
}

.booking-actions button:active {
    background: var(--luna-dark);
    color: var(--luna-white);
    transform: scale(0.98);
}

.booking-actions button:last-child {
    grid-column: 1 / -1;
}

.booking-msg-section {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 2px solid rgba(107, 91, 149, 0.2);
}

.booking-msg-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--luna-text);
    margin-bottom: 12px;
}

.booking-msg-section textarea {
    width: 100%;
    padding: 12px;
    border: 2px solid var(--luna-dark);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 12px;
    background: var(--luna-white);
    color: var(--luna-text);
}

.booking-msg-actions {
    display: flex;
    gap: 12px;
}

.booking-msg-actions button {
    flex: 1;
    padding: 12px;
    border: 2px solid var(--luna-dark);
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.booking-msg-actions .btn-primary {
    background: var(--luna-dark);
    color: var(--luna-white);
}

.booking-msg-actions .btn-secondary {
    background: var(--luna-white);
    color: var(--luna-dark);
}

.booking-msg-actions button:active {
    transform: scale(0.98);
    opacity: 0.9;
}

/* Быстрые шаблоны графика */
.quick-templates {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.quick-setup h3 {
    font-size: 16px;
    font-weight: 600;
    color: var(--luna-text);
    margin-bottom: 12px;
}

/* Бейдж записей в календаре */
.bookings-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background: #ff4444;
    color: white;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 5px;
    border-radius: 8px;
    min-width: 16px;
    text-align: center;
}

.calendar-day {
    position: relative;
}

/* Модальное окно редактора даты */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}

.modal-content {
    background: var(--luna-white);
    border: 2px solid var(--luna-dark);
    border-radius: 20px;
    padding: 28px;
    max-width: 420px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
    animation: modalFadeIn 0.25s ease-out;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.9);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.day-editor-header {
    text-align: center;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 2px solid rgba(107, 91, 149, 0.1);
}

.day-editor h3 {
    font-size: 22px;
    font-weight: 700;
    color: var(--luna-text);
    margin-bottom: 8px;
    letter-spacing: 0.3px;
}

.day-editor-date {
    font-size: 16px;
    color: var(--luna-dark);
    opacity: 0.9;
    font-weight: 500;
    text-transform: capitalize;
}

.day-editor-body {
    margin-bottom: 24px;
}

.day-editor-options {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 20px;
}

.day-editor-toggle-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px;
    background: rgba(107, 91, 149, 0.05);
    border: 2px solid rgba(107, 91, 149, 0.2);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.day-editor-toggle-label:hover {
    background: rgba(107, 91, 149, 0.1);
    border-color: var(--luna-dark);
}

.day-editor-toggle-text {
    font-size: 16px;
    font-weight: 600;
    color: var(--luna-text);
    flex: 1;
}

.day-editor-options .toggle-switch {
    margin: 0;
    flex-shrink: 0;
}

.day-editor-option {
    padding: 12px;
    border: 2px solid var(--luna-dark);
    border-radius: 12px;
    background: var(--luna-white);
    color: var(--luna-dark);
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.day-editor-option.active {
    background: var(--luna-dark);
    color: var(--luna-white);
}

.day-editor-option:active {
    transform: scale(0.98);
}

.day-editor-custom {
    display: flex;
    gap: 12px;
    padding: 12px;
    border: 2px solid var(--luna-dark);
    border-radius: 12px;
}

.day-editor-custom label {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 13px;
    color: var(--luna-text);
}

.day-editor-custom input {
    padding: 8px;
    border: 2px solid var(--luna-dark);
    border-radius: 8px;
    font-size: 14px;
}

.day-editor-time-inputs {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    margin-top: 20px;
    padding: 20px;
    background: rgba(107, 91, 149, 0.05);
    border: 2px solid rgba(107, 91, 149, 0.2);
    border-radius: 12px;
}

.day-editor-time-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1;
}

.day-editor-time-label {
    font-size: 14px;
    color: var(--luna-dark);
    font-weight: 600;
    margin-bottom: 4px;
}

.day-editor-time-input {
    padding: 12px 14px;
    border: 2px solid var(--luna-dark);
    border-radius: 10px;
    font-size: 16px;
    font-weight: 600;
    background: var(--luna-white);
    color: var(--luna-text);
    cursor: pointer;
    transition: all 0.2s;
    width: 100%;
    box-sizing: border-box;
}

.day-editor-time-input:focus {
    outline: none;
    border-color: var(--luna-accent);
    box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.15);
    transform: scale(1.02);
}

.day-editor-time-input:active {
    transform: scale(0.98);
}

.day-editor-time-separator {
    font-size: 24px;
    font-weight: 700;
    color: var(--luna-dark);
    margin-bottom: 8px;
    line-height: 1;
}

.day-editor-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 2px solid rgba(107, 91, 149, 0.1);
}

.day-editor-actions button {
    width: 100%;
    padding: 14px 20px;
    border: 2px solid var(--luna-dark);
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(107, 91, 149, 0.15);
}

.day-editor-actions .btn-primary {
    background: var(--luna-dark);
    color: var(--luna-white);
    order: 1;
}

.day-editor-actions .btn-primary:hover {
    background: var(--luna-accent);
    box-shadow: 0 4px 12px rgba(107, 91, 149, 0.3);
}

.day-editor-actions .btn-primary:active {
    transform: scale(0.98);
    box-shadow: 0 2px 6px rgba(107, 91, 149, 0.2);
}

.day-editor-actions .btn-secondary {
    background: var(--luna-white);
    color: var(--luna-dark);
    order: 2;
}

.day-editor-actions .btn-secondary:hover {
    background: rgba(107, 91, 149, 0.05);
    border-color: var(--luna-accent);
}

.day-editor-actions .btn-secondary:active {
    transform: scale(0.98);
}

.day-editor-actions button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(107, 91, 149, 0.2);
}

/* ============================================ */
/* КЛИЕНТСКИЕ СТИЛИ */
/* ============================================ */

/* Улучшенные стили для клиентских кнопок услуг */
.btn-primary:hover span[style*="font-size: 28px"],
.btn-primary:hover span[style*="font-size: 24px"] {
    transform: translateX(6px);
}

.btn-primary:hover div[style*="position: absolute"][style*="opacity: 0"] {
    opacity: 1 !important;
}

/* Улучшенные стили для слотов времени */
#clientTimeSlots .btn-secondary {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

#clientTimeSlots .btn-secondary::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(107, 91, 149, 0.05) 0%, rgba(139, 122, 184, 0.08) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

#clientTimeSlots .btn-secondary:hover::before {
    opacity: 1;
}

/* Информационный блок выбранной даты */
#clientSelectedDateInfo {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#clientSelectedDateInfo:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 91, 149, 0.18) !important;
}

/* Блок информации о записи */
#clientBookingForm > div:first-child {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

#clientBookingForm > div:first-child:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(107, 91, 149, 0.18) !important;
}
