/* ══════════════════════════════════════════════════════════════
   Phoenix App Generator — Material Design 3 base (огненная палитра)
   Подключается ПЕРВЫМ. Затем app-modern.css добавляет premium-эффекты.
   ══════════════════════════════════════════════════════════════ */

/* ── Тёмная тема (по умолчанию) ── */
:root, [data-theme="dark"] {
    /* Тёплый угольный фон */
    --md-bg: #14100C;
    --md-surface: #1B1410;
    --md-surface-cl: #110D0A;
    --md-surface-c: #221913;
    --md-surface-ch: #2C2118;
    --md-surface-chh: #3A2A1F;

    /* Бренд: оранжевый → красный */
    --md-primary: #FF8A4C;
    --md-on-primary: #401400;
    --md-primary-c: #5C2200;
    --md-on-primary-c: #FFD9C2;

    --md-secondary: #FFB59A;
    --md-on-secondary: #4A1A00;
    --md-secondary-c: #6E2C0E;
    --md-on-secondary-c: #FFE0CF;

    --md-tertiary: #F26B5E;
    --md-tertiary-c: #5A1B14;

    --md-error: #FFB4AB;
    --md-on-error: #690005;
    --md-error-c: #93000A;

    --md-on-surface: #F4E9E0;
    --md-on-surface-v: #D4C5B7;
    --md-outline: #9A8979;
    --md-outline-v: #4D3F33;

    --md-inverse-surface: #F4E9E0;
    --md-inverse-on-surface: #2C2118;
    --md-scrim: rgba(0,0,0,0.65);

    /* Семантика статусов */
    --md-success: #8FD49E;
    --md-success-dim: rgba(143,212,158,0.12);
    --md-warning: #FFD08A;
    --md-warning-dim: rgba(255,208,138,0.12);
    --md-error-dim: rgba(255,180,171,0.14);
    --md-info: #9CCAFF;
    --md-info-dim: rgba(156,202,255,0.12);

    /* Радиусы и анимация */
    --md-r-s: 8px;
    --md-r-m: 12px;
    --md-r-l: 16px;
    --md-r-xl: 28px;
    --md-sidebar-w: 220px;
    --md-ease: cubic-bezier(0.2,0,0,1);
    color-scheme: dark;
}

/* ── Светлая тема ── */
[data-theme="light"] {
    --md-bg: #FFF8F4;
    --md-surface: #FFFDFB;
    --md-surface-cl: #FFF1E8;
    --md-surface-c: #FFEBDF;
    --md-surface-ch: #FFE0CF;
    --md-surface-chh: #FFD2BC;

    --md-primary: #D85213;
    --md-on-primary: #FFFFFF;
    --md-primary-c: #FFDBC9;
    --md-on-primary-c: #3A1100;

    --md-secondary: #C2410C;
    --md-on-secondary: #FFFFFF;
    --md-secondary-c: #FFD9C2;
    --md-on-secondary-c: #3A1300;

    --md-tertiary: #C0392B;
    --md-tertiary-c: #FFD9D4;

    --md-error: #B3261E;
    --md-on-error: #FFFFFF;
    --md-error-c: #F9DEDC;

    --md-on-surface: #271810;
    --md-on-surface-v: #5A4133;
    --md-outline: #8A6E5B;
    --md-outline-v: #E5CFBE;

    --md-inverse-surface: #271810;
    --md-inverse-on-surface: #FFF1E8;
    --md-scrim: rgba(60,20,5,0.45);

    --md-success: #166534;
    --md-success-dim: rgba(22,101,52,0.10);
    --md-warning: #92400E;
    --md-warning-dim: rgba(146,64,14,0.10);
    --md-error-dim: rgba(179,38,30,0.10);
    --md-info: #1D4ED8;
    --md-info-dim: rgba(29,78,216,0.10);
    color-scheme: light;
}

/* ── Базовые сбросы ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
body {
    font-family: 'Google Sans', 'Roboto', system-ui, -apple-system, sans-serif;
    background: var(--md-bg);
    color: var(--md-on-surface);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    overflow-y: scroll;
    transition: background 0.3s var(--md-ease), color 0.3s var(--md-ease);
}

/* ── Сайдбар ── */
.sidebar {
    position: fixed; top: 0; left: 0;
    width: var(--md-sidebar-w); height: 100vh;
    background: var(--md-surface);
    border-right: 1px solid var(--md-outline-v);
    padding: 1.25rem 0;
    display: flex; flex-direction: column;
    z-index: 10;
    transition: background 0.3s var(--md-ease);
}
.sidebar-logo {
    padding: 0 1rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: inherit;
}
.sidebar-logo-icon {
    width: 28px; height: 28px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
    box-shadow: 0 0 0 1px rgba(255, 138, 76, 0.35);
}
.sidebar-logo-icon img {
    width: 116%;
    height: 116%;
    margin: -8%;
    object-fit: cover;
    display: block;
}
.sidebar-logo span {
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--md-on-surface);
    letter-spacing: -0.01em;
}
.nav-section {
    font-size: 0.65rem; font-weight: 600; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--md-outline);
    padding: 0.75rem 1rem 0.35rem;
}
.nav { list-style: none; flex: 1; overflow-y: auto; }
.nav li a {
    display: flex; align-items: center; gap: 0.6rem;
    padding: 0.55rem 1rem; margin: 1px 0.5rem 1px 0;
    color: var(--md-on-surface-v); text-decoration: none;
    font-size: 0.85rem; font-weight: 500;
    border-radius: 0 var(--md-r-xl) var(--md-r-xl) 0;
    transition: all 0.2s var(--md-ease);
}
.nav li a:hover { color: var(--md-on-surface); background: var(--md-surface-c); }
.nav li a.active { color: var(--md-on-primary-c); background: var(--md-primary-c); }
.nav li a svg { width: 16px; height: 16px; fill: currentColor; opacity: 0.85; flex-shrink: 0; }

.sidebar-footer {
    padding: 0.75rem 1rem; border-top: 1px solid var(--md-outline-v);
    display: flex; align-items: center; justify-content: space-between;
}
.sidebar-footer a { color: var(--md-outline); text-decoration: none; font-size: 0.78rem; transition: color 0.15s; }
.sidebar-footer a:hover { color: var(--md-error); }

/* ── Переключатель темы ── */
.theme-toggle {
    width: 36px; height: 36px; border-radius: 50%;
    border: 1px solid var(--md-outline-v); background: transparent;
    color: var(--md-on-surface-v); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: all 0.2s var(--md-ease); flex-shrink: 0;
}
.theme-toggle:hover { background: var(--md-surface-c); color: var(--md-on-surface); }
.theme-toggle svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; }
[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
[data-theme="light"] .theme-toggle .icon-sun { display: none; }
[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ── Основная область ── */
.main {
    margin-left: var(--md-sidebar-w); padding: 1.75rem 2.25rem; max-width: 1440px;
    transition: margin 0.3s var(--md-ease);
}
.page-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; flex-wrap: wrap; gap: 0.75rem; }
.page-title { font-size: 1.85rem; font-weight: 700; color: var(--md-on-surface); letter-spacing: -0.02em; }

/* ── Карточки ── */
.card {
    background: var(--md-surface-c);
    border-radius: var(--md-r-m);
    padding: 1.25rem; margin-bottom: 1rem;
    transition: background 0.2s var(--md-ease);
}
.card:hover { background: var(--md-surface-ch); }
.card-outlined {
    background: var(--md-surface);
    border: 1px solid var(--md-outline-v);
    border-radius: var(--md-r-m);
    padding: 1.25rem; margin-bottom: 1rem;
}
.card-title {
    font-size: 0.9rem; font-weight: 600; color: var(--md-on-surface);
    margin-bottom: 1rem; display: flex; align-items: center; gap: 0.5rem;
}
.section-title {
    font-size: 0.75rem; font-weight: 700; text-transform: uppercase;
    letter-spacing: 0.08em; color: var(--md-outline); margin-bottom: 0.75rem;
    display: flex; align-items: center; gap: 0.5rem;
}

/* ── Сетки ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 1rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(350px, 1fr)); gap: 0.75rem; }

/* ── Кнопки ── */
.btn-filled {
    padding: 0.65rem 1.35rem; border-radius: var(--md-r-xl); border: none;
    background: var(--md-primary); color: var(--md-on-primary);
    font-size: 0.85rem; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.2s var(--md-ease);
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-filled:hover { box-shadow: 0 1px 3px var(--md-scrim); filter: brightness(1.05); }
.btn-filled:active { transform: scale(0.97); }

.btn-tonal {
    padding: 0.55rem 1.1rem; border-radius: var(--md-r-xl); border: none;
    background: var(--md-secondary-c); color: var(--md-on-secondary-c);
    font-size: 0.85rem; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.2s var(--md-ease);
    display: inline-flex; align-items: center; gap: 0.4rem; white-space: nowrap;
}
.btn-tonal:hover { filter: brightness(1.08); }

.btn-outlined {
    padding: 0.55rem 1.1rem; border-radius: var(--md-r-xl);
    border: 1px solid var(--md-outline); background: transparent;
    color: var(--md-primary); font-size: 0.85rem; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.2s var(--md-ease);
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-outlined:hover { background: var(--md-surface-c); }

.btn-text {
    padding: 0.55rem 0.85rem; border-radius: var(--md-r-xl);
    border: none; background: transparent;
    color: var(--md-primary); font-size: 0.85rem; font-weight: 600; font-family: inherit;
    cursor: pointer; transition: all 0.2s var(--md-ease);
    display: inline-flex; align-items: center; gap: 0.4rem;
}
.btn-text:hover { background: var(--md-surface-c); }

.btn-icon {
    width: 40px; height: 40px; border-radius: 50%; border: none;
    background: transparent; color: var(--md-on-surface-v);
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    transition: all 0.2s var(--md-ease);
}
.btn-icon:hover { background: var(--md-surface-c); color: var(--md-on-surface); }

.loading { opacity: 0.5; pointer-events: none; }

/* ── Поля ввода ── */
.text-field {
    padding: 0.65rem 0.9rem; border-radius: var(--md-r-s);
    border: 1px solid var(--md-outline); background: transparent;
    color: var(--md-on-surface); font-size: 0.88rem; font-family: inherit;
    transition: border-color 0.2s, box-shadow 0.2s; width: 100%;
}
.text-field:focus { outline: none; border-color: var(--md-primary); border-width: 2px; padding: calc(0.65rem - 1px) calc(0.9rem - 1px); }
.text-field::placeholder { color: var(--md-outline); }

textarea.text-field {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.8rem; line-height: 1.5; resize: vertical; min-height: 120px;
}

.form-group { margin-bottom: 1rem; }
.form-group label { display: block; color: var(--md-on-surface-v); font-size: 0.8rem; font-weight: 600; margin-bottom: 0.4rem; }
.form-group .hint { color: var(--md-outline); font-size: 0.74rem; margin-top: 0.25rem; }

/* ── Чипы ── */
.chip {
    display: inline-flex; align-items: center;
    padding: 0.22rem 0.65rem; border-radius: var(--md-r-s);
    font-size: 0.72rem; font-weight: 600;
}
.chip-success { background: var(--md-success-dim); color: var(--md-success); }
.chip-info { background: var(--md-info-dim); color: var(--md-info); }
.chip-warning { background: var(--md-warning-dim); color: var(--md-warning); }
.chip-error { background: var(--md-error-dim); color: var(--md-error); }
.chip-neutral { background: var(--md-surface-chh); color: var(--md-on-surface-v); }

/* ── Таблицы ── */
.data-table { width: 100%; border-collapse: collapse; font-size: 0.85rem; }
.data-table th {
    text-align: left; padding: 0.75rem; font-size: 0.72rem; font-weight: 600;
    letter-spacing: 0.05em; color: var(--md-outline);
    border-bottom: 1px solid var(--md-outline-v); text-transform: uppercase;
}
.data-table td { padding: 0.75rem; border-bottom: 1px solid var(--md-surface-chh); color: var(--md-on-surface-v); }
.data-table tr:hover td { background: var(--md-surface-c); }

/* ── Модалки ── */
.modal-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    background: var(--md-scrim); z-index: 100;
    display: none; align-items: center; justify-content: center;
}
.modal-overlay.open { display: flex; }
.modal {
    background: var(--md-surface-ch); border-radius: var(--md-r-xl);
    width: 90%; max-width: 800px; max-height: 80vh;
    display: flex; flex-direction: column; box-shadow: 0 8px 32px var(--md-scrim);
}
.modal-header {
    padding: 1rem 1.25rem; border-bottom: 1px solid var(--md-outline-v);
    display: flex; justify-content: space-between; align-items: center;
}
.modal-title { font-size: 1.05rem; font-weight: 600; color: var(--md-on-surface); }
.modal-close {
    background: none; border: none; color: var(--md-on-surface-v);
    font-size: 1.25rem; cursor: pointer; padding: 0.25rem 0.5rem; border-radius: 50%;
}
.modal-close:hover { background: var(--md-surface-chh); color: var(--md-on-surface); }
.modal-body { padding: 1rem 1.25rem; overflow: auto; flex: 1; }
.modal-body pre {
    font-family: 'JetBrains Mono', 'Fira Code', monospace;
    font-size: 0.78rem; line-height: 1.5; color: var(--md-on-surface-v);
    white-space: pre-wrap; word-break: break-all;
}

/* ── Тосты ── */
.toast, .snackbar {
    position: fixed; bottom: 1.5rem; right: 1.5rem;
    padding: 0.85rem 1.25rem; border-radius: var(--md-r-s);
    font-size: 0.88rem; font-weight: 600; z-index: 200;
    transition: all 0.3s var(--md-ease); pointer-events: none;
    box-shadow: 0 3px 8px var(--md-scrim);
    transform: translateY(120%); opacity: 0;
}
.toast.show, .snackbar.show { transform: translateY(0); opacity: 1; }
.toast-success { background: var(--md-inverse-surface); color: var(--md-inverse-on-surface); }
.toast-error { background: #93000A; color: #FFDAD6; }

/* ── Статусные точки ── */
.status-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; display: inline-block; }
.status-dot.active { background: var(--md-success); box-shadow: 0 0 6px rgba(143,212,158,0.45); }
.status-dot.inactive { background: var(--md-error); box-shadow: 0 0 6px rgba(255,180,171,0.45); }
.status-dot.pending { background: var(--md-warning); }

/* ── URL preview ── */
.url-preview {
    background: var(--md-surface-c); border: 1px solid var(--md-outline-v);
    border-radius: var(--md-r-s); padding: 0.6rem 0.85rem;
    font-family: 'JetBrains Mono', monospace; font-size: 0.78rem;
    color: var(--md-primary); word-break: break-all; line-height: 1.5;
}

/* ── Spinner ── */
.spinner {
    display: inline-block; border: 3px solid var(--md-surface-chh);
    border-top-color: var(--md-primary); border-radius: 50%;
    animation: spin 0.9s linear infinite;
}
.spinner-sm { width: 16px; height: 16px; border-width: 2px; }
.spinner-md { width: 32px; height: 32px; }
.spinner-lg { width: 40px; height: 40px; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Адаптив ── */
@media (max-width: 768px) {
    .sidebar { display: none; }
    .main { margin-left: 0; padding: 1rem; }
    .grid-2, .grid-3 { grid-template-columns: 1fr; }
    .grid-auto { grid-template-columns: 1fr; }
    .page-title { font-size: 1.4rem; }
}
</content>
</invoke>