@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

:root {
    /* Основная цветовая схема */
    --primary: #10b981; /* Изумрудный */
    --primary-dark: #059669;
    --primary-light: rgba(16, 185, 129, 0.2);
    
    /* Темная тема и эффекты стекла (Glassmorphism) */
    --bg-base: #0f172a; /* Глубокий темный фон */
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --glass-bg: rgba(30, 41, 59, 0.7);
    --glass-border: rgba(255, 255, 255, 0.08);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
}

* { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Inter', sans-serif; }

body {
    background-color: var(--bg-base);
    color: var(--text-main);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
    /* Легкий градиент на фоне */
    background-image:
        radial-gradient(at 0% 0%, rgba(16, 185, 129, 0.1) 0px, transparent 50%),
        radial-gradient(at 100% 100%, rgba(16, 185, 129, 0.05) 0px, transparent 50%);
    background-attachment: fixed;
}

input[type="month"]::-webkit-calendar-picker-indicator, input[type="datetime-local"]::-webkit-calendar-picker-indicator {
    filter: brightness(0) saturate(100%) invert(56%) sepia(77%) saturate(2309%) hue-rotate(121deg) brightness(94%) contrast(87%);
    cursor: pointer;
}

.login-body { display: flex; justify-content: center; align-items: center; padding: 20px; }
.dash-body { align-items: flex-start; padding: 20px; overflow-y: auto; }

/* --- АНИМИРОВАННЫЕ СФЕРЫ НА ФОНЕ --- */
.blob {
    position: absolute;
    filter: blur(90px);
    z-index: -1;
    opacity: 0.5;
    animation: float 12s infinite ease-in-out alternate;
}
.blob-1 { top: 5%; left: 15%; width: 350px; height: 350px; background: var(--primary); border-radius: 50%; }
.blob-2 { bottom: 5%; right: 15%; width: 450px; height: 450px; background: #0284c7; border-radius: 50%; animation-delay: -5s; }

@keyframes float {
    0% { transform: translateY(0) scale(1); }
    100% { transform: translateY(-40px) scale(1.1); }
}

/* --- ЗЕРКАЛЬНЫЕ ПАНЕЛИ (GLASSMORPHISM) --- */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    border-radius: 24px;
}

/* --- LOADER (Загрузчик страницы) --- */
.page-loader {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: var(--bg-base); z-index: 9999;
    display: flex; justify-content: center; align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}
.spinner {
    width: 24px; height: 24px;
    border: 3px solid rgba(255,255,255,0.1);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}
.page-loader .spinner { width: 50px; height: 50px; border-width: 5px; }

@keyframes spin { to { transform: rotate(360deg); } }

/* --- СТРАНИЦА АВТОРИЗАЦИИ (LOGIN) --- */
.login-card { width: 100%; max-width: 420px; padding: 45px 40px; animation: fadeUp 0.8s ease-out forwards; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(30px); } to { opacity: 1; transform: translateY(0); } }

.input-group { margin-bottom: 25px; position: relative; }
.input-group label { display: block; margin-bottom: 8px; color: var(--text-muted); font-size: 14px; font-weight: 500; }
.input-group input {
    width: 100%; padding: 16px 15px 16px 48px; background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border); border-radius: 14px; color: var(--text-main);
    font-size: 15px; transition: all 0.3s ease; outline: none;
}
.input-group input::placeholder { color: rgba(255,255,255,0.3); }
.input-group input:focus { border-color: var(--primary); background: rgba(0, 0, 0, 0.4); box-shadow: 0 0 0 4px var(--primary-light); }
.input-icon { position: absolute; left: 16px; top: 42px; color: var(--text-muted); width: 18px; height: 18px; transition: 0.3s; }
.input-group input:focus + .input-icon { color: var(--primary); }

.btn-submit {
    width: 100%; padding: 16px; background: var(--primary); color: #fff; border: none;
    border-radius: 14px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.3s ease;
    display: flex; justify-content: center; align-items: center; gap: 10px;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
}
.btn-submit:hover { background: var(--primary-dark); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(16, 185, 129, 0.6); }
.btn-submit:active { transform: translateY(0); }

/* --- ЛЕЙАУТ ДАШБОРДА (СЕТКА) --- */
.dashboard-layout {
    display: flex; gap: 20px; min-height: calc(100vh - 40px); z-index: 1; position: relative;
}

/* Сайдбар (Боковое меню) */
.sidebar {
    width: 280px; flex-shrink: 0; display: flex; flex-direction: column; padding: 30px 20px;
    position: sticky; top: 20px; height: calc(100vh - 40px);
}

/* Главный контент */
.main-content {
    flex-grow: 1; min-width: 0; display: flex; flex-direction: column;
}

/* Пункты меню */
.menu-item {
    display: flex; gap: 15px; align-items: center; padding: 15px 20px; text-decoration: none;
    color: var(--text-muted); font-weight: 600; border-radius: 16px; margin-bottom: 8px; transition: 0.3s;
}
.menu-item i { margin-right: 15px; color: inherit; transition: 0.3s; }
.menu-item:hover { background: rgba(255, 255, 255, 0.05); color: var(--text-main); }
.menu-item.active { background: var(--primary-light); color: var(--primary); }

/* Верхняя панель (Шапка) */
.top-bar {
    display: flex; justify-content: space-between; align-items: center; 
    padding: 20px 30px; border-radius: 24px; margin-bottom: 30px;
}

/* --- ТАБЛИЦЫ (Для cdr.php) --- */
table { width: 100%; border-collapse: collapse; text-align: left; }
th { padding: 15px; color: var(--text-muted); font-weight: 600; border-bottom: 2px solid var(--glass-border); }
td { padding: 15px; border-bottom: 1px solid var(--glass-border); color: var(--text-main); font-weight: 500; }
tr:hover td { background: rgba(255, 255, 255, 0.03); } /* Подсветка строки при наведении */

/* --- АДАПТИВНОСТЬ (МОБИЛЬНЫЕ УСТРОЙСТВА) --- */
@media (max-width: 992px) {
    .dashboard-layout { flex-direction: column; }
    .sidebar { width: 100%; height: auto; position: static; padding: 20px; margin-bottom: 20px; }
    .top-bar { flex-direction: column; gap: 15px; text-align: center; justify-content: center; }
    .top-bar > div { flex-wrap: wrap; justify-content: center; }
}

@media (max-width: 480px) {
    .login-card { padding: 35px 25px; }
    .stat-card { padding: 20px; }
    .stat-value { font-size: 24px; }
}