:root {
    /* Цветовая палитра и переменные */
    --bg: #020617; /* Фон */
    --bg-elevated: #020617; /* Фон для приподнятых элементов */
    --bg-elevated-soft: #020617;
    --border: #111827; /* Граница */
    --accent: #3b82f6; /* Акцентный цвет (синий) */
    --accent-soft: rgba(59,130,246,.14); /* Мягкий акцентный цвет */
    --text: #e5e7eb; /* Основной текст (светло-серый) */
    --text-muted: #9ca3af; /* Приглушенный текст (серый) */
    --radius: 12px; /* Радиус скругления */
    --shadow-soft: 0 18px 45px rgba(0,0,0,.6); /* Мягкая тень */
}

/* Общий сброс стилей */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* Стиль тела страницы */
body {
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 32px 16px;
    /* Градиентный фон с фиксацией */
    background:
        radial-gradient(circle at top, #1f2937 0, #020617 50%) fixed,
        #020617;
    color: var(--text);
    /* Системный шрифт */
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Оболочка всего приложения (Shell) */
.shell {
    width: 100%;
    max-width: 1080px;
    border-radius: 20px;
    border: 1px solid #020617;
    background: radial-gradient(circle at top left, #020617, #020617);
    box-shadow: var(--shadow-soft);
    padding: 18px 22px 20px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

/* --- HEADER --- */

.app-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #020617, #020617);
    padding: 10px 18px;
    gap: 14px;
}

.app-header-left,
.app-header-center,
.app-header-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* Логотип: светящаяся точка */
.logo-dot {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: radial-gradient(circle at 30% 20%, #facc15, #f97316); /* Желто-оранжевый градиент */
    box-shadow: 0 0 18px rgba(249,115,22,.7);
}

/* Логотип: текст */
.logo-text {
    font-weight: 600;
    letter-spacing: .06em;
    font-size: 0.95rem;
    text-transform: uppercase;
}

/* Навигационные ссылки в центре заголовка */
.app-header-center a {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-decoration: none;
    padding: 4px 10px;
    border-radius: 999px;
    transition: .15s ease;
    white-space: nowrap;
}

.app-header-center a:hover {
    background: var(--accent-soft);
    color: var(--text);
}

/* Основная кнопка в заголовке */
.btn-header {
    border-radius: 999px;
    padding: 6px 16px;
    border: 1px solid var(--accent);
    /* Синий градиент */
    background: radial-gradient(circle at top, #1d4ed8, #1e40af);
    color: white;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 10px 25px rgba(37,99,235,.45);
    transition: transform .1s ease, box-shadow .1s ease, background .15s ease;
    text-decoration: none;
}

.btn-header:hover {
    transform: translateY(-1px);
    box-shadow: 0 14px 30px rgba(37,99,235,.55);
    background: radial-gradient(circle at top, #2563eb, #1d4ed8);
}

/* Кнопка "Выход" (Logout) */
.btn-header-logout {
    border-color: #f97373;
    /* Красный градиент */
    background: radial-gradient(circle at top, #b91c1c, #7f1d1d);
    box-shadow: 0 10px 25px rgba(239,68,68,.45);
}

.btn-header-logout:hover {
    background: radial-gradient(circle at top, #ef4444, #b91c1c);
    box-shadow: 0 14px 30px rgba(239,68,68,.6);
}

/* --- MAIN LAYOUT (Основной макет) --- */

/* Контейнер для двух колонок (Основной контент и Боковая панель) */
.app-main-wrapper {
    display: grid;
    /* Основной контент (1fr) и Боковая панель (240px) */
    grid-template-columns: minmax(0, 1fr) 240px;
    gap: 22px;
}

/* Основной контент (левая колонка) */
.app-main {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: radial-gradient(circle at top left, rgba(15,23,42,.75), #020617);
    padding: 16px 16px 18px;
}

.app-main-header {
    margin-bottom: 12px;
}

.app-main-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 4px;
}

.app-main-subtitle {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.app-main-inner {
    margin-top: 10px;
}

/* Блок содержания страниц (Сетка для карточек) */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

/* Карточка приложения/элемента */
.app-card {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(145deg, #020617, #020617);
    padding: 14px 13px;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease, border-color .12s ease, background .12s ease;
}

.app-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 18px 35px rgba(0,0,0,.7);
    border-color: var(--accent);
    /* Эффект свечения акцентным цветом при наведении */
    background: radial-gradient(circle at top left, rgba(59,130,246,.2), #020617);
}

.app-card-title {
    font-size: 0.95rem;
    font-weight: 500;
    margin-bottom: 4px;
}

.app-card-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* Блок новостей (также в основном контенте или боковой панели) */
.news-block {
    margin-top: 0px;
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(160deg, #020617, #020617 35%, #020617 100%);
    padding: 14px 14px 16px;
}

.news-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 8px;
    gap: 8px;
}

.news-title {
    font-size: 0.95rem;
    font-weight: 600;
}

/* Тег новости */
.news-tag {
    font-size: .75rem;
    padding: 2px 9px;
    border-radius: 999px;
    border: 1px solid #1f2937;
    color: var(--text-muted);
    white-space: nowrap;
}

.news-items {
    display: flex;
    flex-direction: column;
    gap: 7px;
    margin-top: 4px;
}

/* Отдельный элемент новости */
.news-item {
    font-size: .84rem;
    color: var(--text-muted);
    position: relative;
    padding-left: 13px;
}

/* Маркер (точка) перед новостью */
.news-item::before {
    content: '';
    position: absolute;
    left: 3px;
    top: 0.55em;
    width: 4px;
    height: 4px;
    border-radius: 999px;
    background: var(--accent);
}

.news-date {
    font-size: .72rem;
    color: #6b7280;
    margin-left: 4px;
}

/* Ссылки в элементах новости */
.news-item a {
    color: inherit;
    text-decoration: none;
    font-weight: 500;
    transition: color .15s ease, text-shadow .15s ease;
}

.news-item a:visited {
    color: inherit;
}

.news-item a:hover {
    color: var(--accent);
    /* Эффект свечения текста при наведении */
    text-shadow: 0 0 10px rgba(59,130,246,.5);
}

/* --- SIDE NOTES (Боковая колонка/справа) --- */

.app-notes {
    font-size: 0.84rem;
    color: var(--text-muted);
    padding-top: 0px;
    line-height: 1.5;
}

.app-notes p + p { margin-top: 10px; }

/* --- FOOTER --- */

.app-footer {
    border-radius: var(--radius);
    border: 1px solid var(--border);
    background: linear-gradient(135deg, #020617, #020617);
    padding: 8px 14px;
    font-size: 0.78rem;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    gap: 10px;
}

.app-footer a {
    color: var(--text-muted);
    text-decoration: none;
}

.app-footer a:hover {
    text-decoration: underline;
    color: var(--text);
}