/* Toast Notifications */
.toast-container {
    position: fixed;
    top: 100px; /* Чуть ниже шапки */
    left: 50%;
    transform: translateX(-50%);
    z-index: 80; /* Меньше чем у header (90), чтобы выплывать ИЗ-ПОД него */
    display: flex;
    flex-direction: column;
    gap: 10px;
    pointer-events: none;
}

.toast-message {
    background: rgba(14, 16, 24, 0.95);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 14px 24px;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    font-family: 'JetBrains Mono', monospace;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    animation: toastSlideDown 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
    pointer-events: auto;
    overflow: hidden;
}

.toast-message.toast-error {
    border-color: rgba(255, 91, 126, 0.5);
    color: #ff7f9c;
}

.toast-message.hiding {
    animation: toastSlideUp 0.4s cubic-bezier(0.6, -0.28, 0.735, 0.045) forwards;
}

@keyframes toastSlideDown {
    0% {
        opacity: 0;
        transform: translateY(-150%);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes toastSlideUp {
    0% {
        opacity: 1;
        transform: translateY(0);
        max-height: 200px;
        margin-top: 0;
        padding-top: 14px;
        padding-bottom: 14px;
        border-width: 1px;
    }
    100% {
        opacity: 0;
        transform: translateY(-50%);
        max-height: 0;
        margin-top: -10px;
        padding-top: 0;
        padding-bottom: 0;
        border-width: 0;
    }
}


.metric-value.is-empty {
    color: var(--text-secondary);
}

.glass-panel {
    position: relative;
    display: block;
    padding: 20px;
    border-radius: var(--radius-md);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(12, 14, 20, 0.96);
    border: 1px solid rgba(255, 255, 255, 0.10);
    backdrop-filter: blur(8px) saturate(112%);
    -webkit-backdrop-filter: blur(8px) saturate(112%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), var(--shadow-soft);
}

.glass-panel::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.018), transparent 28%, transparent 72%, rgba(115, 104, 255, 0.025));
    opacity: 0.5;
    pointer-events: none;
}

.glass-panel.no-hover:hover {
    transform: none;
}

a.glass-panel:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
    rgba(14, 16, 24, 0.98);
    border-color: rgba(255, 255, 255, 0.16);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05), 0 22px 50px rgba(0, 0, 0, 0.42);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
    padding: 11px 18px;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(12, 14, 20, 0.96);
    color: var(--text-main);
    cursor: pointer;
    font: inherit;
    font-size: 0.84rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    backdrop-filter: blur(8px) saturate(112%);
    -webkit-backdrop-filter: blur(8px) saturate(112%);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), var(--shadow-soft);
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-1px);
    border-color: rgba(255, 255, 255, 0.16);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
    rgba(14, 16, 24, 0.98);
    box-shadow: 0 0 15px rgba(255, 255, 255, 0.05), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-primary,
.btn-accent-cyan,
.btn-accent-red {
    color: #edf2fb;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), rgba(255, 255, 255, 0.01)),
    rgba(12, 14, 20, 0.96);
    border-color: rgba(255, 255, 255, 0.10);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.03), var(--shadow-soft);
}

.btn-primary:hover,
.btn-accent-cyan:hover,
.btn-accent-red:hover {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(255, 255, 255, 0.012)),
    rgba(14, 16, 24, 0.98);
}

.btn-primary:hover {
    box-shadow: 0 0 18px rgba(122, 226, 255, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-accent-cyan:hover {
    box-shadow: 0 0 18px rgba(122, 226, 255, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-accent-red:hover {
    box-shadow: 0 0 18px rgba(255, 91, 126, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.btn-block {
    width: 100%;
}

label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.06em;
}

.input-glass,
textarea,
select,
input[type="text"],
input[type="password"] {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.10);
    border-radius: 12px;
    background: rgba(2, 7, 13, 0.48);
    color: var(--text-main);
    padding: 14px 16px;
    font-family: inherit;
    font-size: 0.95rem;
    outline: none;
    transition: border-color 0.22s ease, background 0.22s ease, box-shadow 0.22s ease;
}

textarea {
    min-height: 130px;
    resize: vertical;
}

.input-glass:focus,
textarea:focus,
select:focus,
input[type="text"]:focus,
input[type="password"]:focus {
    border-color: rgba(122, 226, 255, 0.34);
    background: rgba(10, 16, 25, 0.78);
    box-shadow: 0 0 0 4px rgba(122, 226, 255, 0.08);
}

.input-glass::placeholder,
textarea::placeholder,
input::placeholder {
    color: rgba(151, 165, 189, 0.6);
}

select option {
    background: #0c1119;
    color: var(--text-main);
}

.alert {
    margin-bottom: 22px;
    padding: 14px 16px;
    border-radius: 14px;
    border: 1px solid rgba(255, 255, 255, 0.10);
    background: rgba(255, 255, 255, 0.04);
    color: #f6fbff;
}

.alert-error {
    background: rgba(255, 91, 126, 0.10);
    border-color: rgba(255, 91, 126, 0.28);
}

.file-upload-wrapper {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
}

.file-upload-wrapper input[type="file"] {
    display: none;
}

.file-name-display {
    color: var(--text-secondary);
    font-size: 0.84rem;
}

.image-preview-thumb {
    display: block;
    height: 64px;
    width: auto;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    object-fit: cover;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    animation: fadeInPreview 0.3s ease;
}

@keyframes fadeInPreview {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

