:root {
    --bg-main: #090d16;
    --bg-card: rgba(17, 24, 39, 0.78);
    --bg-input: rgba(31, 41, 55, 0.65);
    --border-color: rgba(255, 255, 255, 0.08);
    --border-hover: rgba(99, 102, 241, 0.5);
    --accent: #6366f1;
    --accent-hover: #4f46e5;
    --accent-glow: rgba(99, 102, 241, 0.35);
    --success: #10b981;
    --warning: #f59e0b;
    --danger: #ef4444;
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --radius-lg: 20px;
    --radius-md: 12px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--bg-main);
    background-image: 
        radial-gradient(at 0% 0%, rgba(99, 102, 241, 0.16) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.12) 0px, transparent 50%);
    background-attachment: fixed;
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.app-wrapper {
    width: 100%;
    max-width: 540px;
    animation: fadeIn 0.4s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.glass-card {
    background: var(--bg-card);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    padding: 32px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.6);
}

/* Шапка */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--accent), #8b5cf6);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 18px;
    box-shadow: 0 8px 20px var(--accent-glow);
}

.brand-text h1 {
    font-size: 1.25rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.brand-text span {
    font-size: 0.8rem;
    color: var(--text-secondary);
}

.logout-btn {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-secondary);
    border: 1px solid var(--border-color);
    padding: 8px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    text-decoration: none;
    transition: all 0.2s;
}

.logout-btn:hover {
    color: var(--text-primary);
    border-color: var(--danger);
    background: rgba(239, 68, 68, 0.1);
}

/* Статус-бар */
.status-banner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    margin-bottom: 24px;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    font-weight: 500;
}

.dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 12px var(--success);
    transition: all 0.3s;
}

.dot.busy {
    background: var(--warning);
    box-shadow: 0 0 12px var(--warning);
    animation: pulse 1.2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.25); opacity: 0.6; }
}

/* Форма и инпуты */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
    margin-bottom: 18px;
}

.form-group {
    margin-bottom: 16px;
}

.form-grid .form-group {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 0.82rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

input[type="date"],
input[type="text"],
input[type="password"] {
    width: 100%;
    padding: 13px 15px;
    background: var(--bg-input);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    font-size: 0.95rem;
    font-family: inherit;
    outline: none;
    transition: all 0.2s;
    color-scheme: dark;
}

input:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

/* Быстрый выбор дат */
.quick-dates {
    display: flex;
    gap: 8px;
    margin-bottom: 22px;
}

.chip {
    flex: 1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 8px;
    border-radius: 9px;
    font-size: 0.8rem;
    cursor: pointer;
    text-align: center;
    transition: all 0.2s;
}

.chip:hover {
    background: rgba(99, 102, 241, 0.15);
    color: var(--text-primary);
    border-color: var(--border-hover);
}

/* Кнопки */
.btn-primary {
    width: 100%;
    padding: 15px 20px;
    background: linear-gradient(135deg, var(--accent), var(--accent-hover));
    color: white;
    border: none;
    border-radius: var(--radius-md);
    font-size: 0.98rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s;
    box-shadow: 0 8px 20px -4px var(--accent-glow);
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 12px 25px -4px var(--accent-glow);
}

.btn-primary:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

/* Секции информации */
.section-block {
    margin-top: 26px;
    padding-top: 22px;
    border-top: 1px solid var(--border-color);
}

.section-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    color: var(--text-secondary);
    margin-bottom: 12px;
    display: flex;
    justify-content: space-between;
}

.schedule-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
}

.time-pill {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border-color);
    padding: 8px;
    border-radius: 8px;
    text-align: center;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

/* Живой лог */
.log-box {
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    padding: 12px 14px;
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.78rem;
    color: #cbd5e1;
    max-height: 130px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.log-item {
    line-height: 1.4;
    border-bottom: 1px dashed rgba(255, 255, 255, 0.05);
    padding-bottom: 4px;
}

/* Уведомления (Тосты) */
.toast {
    position: fixed;
    bottom: 24px;
    right: 24px;
    left: 24px;
    max-width: 400px;
    margin: 0 auto;
    padding: 15px 20px;
    border-radius: var(--radius-md);
    background: #1e293b;
    border: 1px solid var(--border-color);
    color: white;
    font-size: 0.9rem;
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.5);
    transform: translateY(150%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 999;
}

.toast.show {
    transform: translateY(0);
}

.error-alert {
    background: rgba(239, 68, 68, 0.12);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
    padding: 12px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    margin-bottom: 18px;
    text-align: center;
}

/* Адаптив для телефонов */
@media (max-width: 480px) {
    body {
        padding: 12px;
    }
    .glass-card {
        padding: 22px 18px;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
}