:root {
    --bg: #0f172a;
    --bg-elevated: #111827;
    --accent: #3b82f6;
    --accent-soft: rgba(59, 130, 246, 0.1);
    --border: #1f2937;
    --text: #e5e7eb;
    --text-muted: #9ca3af;
    --error: #f97373;
    --success: #4ade80;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: radial-gradient(circle at top left, #1d283a 0, #020617 60%);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: stretch;
    justify-content: center;
}

.layout {
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1400px;
    padding: 24px 16px;
    gap: 16px;
}

@media (min-width: 1100px) {
    .layout {
        flex-direction: row;
    }
}

.panel {
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.9));
    border-radius: 18px;
    border: 1px solid rgba(148, 163, 184, 0.18);
    box-shadow:
        0 24px 40px rgba(15, 23, 42, 0.8),
        0 0 0 1px rgba(15, 23, 42, 0.8),
        0 0 40px rgba(59, 130, 246, 0.25);
    padding: 20px 20px 18px;
    backdrop-filter: blur(16px);
}

.panel--left {
    flex: 0 0 600px;
}

.panel--right {
    flex: 1 1 auto;
    min-height: 260px;
}

.title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 0.02em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 4px;
}

.balance-info {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.8);
    border: 1px solid rgba(59, 130, 246, 0.3);
    border-radius: 12px;
    padding: 10px 14px;
    margin-bottom: 16px;
}

.balance-label {
    font-size: 13px;
    color: var(--text-muted);
}

.balance-value {
    font-size: 16px;
    font-weight: 600;
    color: #4ade80;
}

.balance-value.warning {
    color: #f59e0b;
    animation: pulse 1.5s infinite;
}

.balance-value.critical {
    color: #ef4444;
    animation: shake 0.5s infinite;
}

.balance-warning {
    font-size: 12px;
    color: #f59e0b;
    margin-top: 4px;
    display: none;
}

.title-pill {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.14em;
    padding: 2px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(56, 189, 248, 0.25));
    border: 1px solid rgba(129, 140, 248, 0.4);
    color: #e5e7eb;
}

.subtitle {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.field-group {
    margin-bottom: 14px;
}

.label-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 4px;
}

label {
    font-size: 13px;
    font-weight: 500;
    color: #e5e7eb;
}

.hint {
    font-size: 11px;
    color: var(--text-muted);
}

input[type="text"],
input[type="number"] {
    width: 100%;
    padding: 9px 11px;
    border-radius: 10px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.96));
    color: var(--text);
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, transform 0.06s ease;
}

input[type="text"]::placeholder {
    color: rgba(148, 163, 184, 0.7);
}

input[type="text"]:focus,
input[type="number"]:focus {
    border-color: rgba(59, 130, 246, 0.9);
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.9),
        0 0 0 4px rgba(37, 99, 235, 0.26);
    background: radial-gradient(circle at top left, #020617, #020617);
    transform: translateY(-0.5px);
}

input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
}

.buttons {
    display: flex;
    gap: 8px;
    margin-top: 10px;
    flex-wrap: wrap;
}

button {
    border-radius: 999px;
    border: none;
    padding: 9px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: background 0.16s ease, box-shadow 0.16s ease, transform 0.06s ease, opacity 0.12s ease;
    white-space: nowrap;
}

.btn-primary {
    background: radial-gradient(circle at top left, #2563eb, #1d4ed8);
    color: white;
    box-shadow:
        0 12px 24px rgba(37, 99, 235, 0.55),
        0 0 0 1px rgba(37, 99, 235, 0.85);
}

.btn-primary:hover:not(:disabled) {
    background: radial-gradient(circle at top left, #1d4ed8, #1e40af);
    transform: translateY(-1px);
    box-shadow:
        0 16px 30px rgba(37, 99, 235, 0.6),
        0 0 0 1px rgba(59, 130, 246, 0.9);
}

.btn-secondary {
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.96));
    color: var(--text-muted);
    border: 1px solid rgba(55, 65, 81, 0.9);
}

.btn-secondary:hover {
    border-color: rgba(148, 163, 184, 0.9);
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 1), rgba(15, 23, 42, 1));
}

.btn-download {
    background: radial-gradient(circle at top left, #059669, #047857);
    color: white;
    box-shadow:
        0 12px 24px rgba(5, 150, 105, 0.55),
        0 0 0 1px rgba(5, 150, 105, 0.85);
}

.btn-download:hover:not(:disabled) {
    background: radial-gradient(circle at top left, #047857, #065f46);
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.7;
    cursor: default;
    box-shadow: none;
}

.status-bar {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-muted);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
}

.status-pill {
    padding: 3px 9px;
    border-radius: 999px;
    font-size: 11px;
    border: 1px solid rgba(75, 85, 99, 0.9);
    background: rgba(15, 23, 42, 0.9);
}

.status-pill--loading {
    border-color: rgba(59, 130, 246, 0.9);
    color: #bfdbfe;
}

.status-pill--error {
    border-color: rgba(248, 113, 113, 0.95);
    color: #fecaca;
}

.status-pill--success {
    border-color: rgba(52, 211, 153, 0.9);
    color: #bbf7d0;
}

.result-header {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    margin-bottom: 10px;
}

.result-title {
    font-size: 14px;
    font-weight: 500;
}

.result-meta {
    font-size: 11px;
    color: var(--text-muted);
    text-align: right;
}

.result-box {
    position: relative;
    border-radius: 14px;
    background: radial-gradient(circle at top left, rgba(15, 23, 42, 1), rgba(15, 23, 42, 0.96));
    border: 1px solid rgba(31, 41, 55, 1);
    padding: 10px 12px 12px;
    height: 100%;
    min-height: 220px;
    display: flex;
    flex-direction: column;
}

.result-scroll {
    flex: 1 1 auto;
    overflow: auto;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    font-size: 12px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-break: break-word;
    color: rgba(229, 231, 235, 0.96);
}

.placeholder {
    color: rgba(148, 163, 184, 0.8);
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 999px;
    background: rgba(15, 23, 42, 0.9);
    border: 1px solid rgba(55, 65, 81, 0.9);
    font-size: 10px;
    color: var(--text-muted);
}

.badge-accent {
    background: rgba(56, 189, 248, 0.12);
    border-color: rgba(56, 189, 248, 0.75);
    color: #e0f2fe;
}

.small-separator {
    border: none;
    border-top: 1px solid rgba(31, 41, 55, 0.9);
    margin: 10px 0 8px;
}

.profile-btn {
    position: fixed;
    bottom: 20px;
    left: 20px;
    background-color: #3b82f6;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}
.profile-btn:hover {
    background-color: #2563eb;
}

.admin-btn {
    position: fixed;
    bottom: 60px;
    left: 20px;
    background-color: #e74c3c;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    display: none;
    z-index: 1000;
}
.admin-btn:hover {
    background-color: #c0392b;
}

.logout-btn {
    position: fixed;
    top: 20px;
    right: 20px;
    background-color: #ef4444;
    color: white;
    padding: 10px 20px;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    z-index: 1000;
}
.logout-btn:hover {
    background-color: #dc2626;
}

.files-section {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid rgba(31, 41, 55, 0.9);
}

.files-title {
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 8px;
    color: #e5e7eb;
}

.files-list {
    max-height: 200px;
    overflow-y: auto;
    border-radius: 10px;
    background: rgba(15, 23, 42, 0.5);
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-bottom: 1px solid rgba(31, 41, 55, 0.9);
    font-size: 12px;
}

.file-item:last-child {
    border-bottom: none;
}

.file-name {
    color: #e5e7eb;
    word-break: break-all;
    margin-right: 10px;
}

.file-meta {
    color: var(--text-muted);
    font-size: 11px;
    white-space: nowrap;
}

.file-actions {
    display: flex;
    gap: 6px;
}

.file-btn {
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 8px;
}

.hidden {
    display: none;
}

.download-buttons {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(31, 41, 55, 0.9);
    display: none;
}

.download-buttons.visible {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* Виджет обратной связи */
.feedback-widget {
    position: fixed;
    bottom: 20px;
    right: 80px;
    z-index: 1000;
}

.feedback-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    border: none;
    cursor: pointer;
    font-size: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 15px rgba(139, 92, 246, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.feedback-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(139, 92, 246, 0.6);
}

.feedback-popup {
    position: absolute;
    bottom: 60px;
    right: 0;
    width: 350px;
    background: linear-gradient(145deg, rgba(15, 23, 42, 0.98), rgba(15, 23, 42, 0.95));
    border: 1px solid rgba(139, 92, 246, 0.3);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.5);
    display: none;
}

.feedback-popup.show {
    display: block;
    animation: fadeInUp 0.3s ease;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.feedback-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.feedback-close {
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 20px;
    padding: 0;
    width: auto;
    height: auto;
}

.feedback-close:hover {
    color: #e5e7eb;
}

.feedback-field {
    margin-bottom: 12px;
}

.feedback-label {
    font-size: 12px;
    color: #9ca3af;
    margin-bottom: 4px;
    display: block;
}

.feedback-textarea {
    width: 100%;
    height: 60px;
    padding: 8px 10px;
    border-radius: 8px;
    border: 1px solid rgba(55, 65, 81, 0.9);
    background: rgba(15, 23, 42, 0.8);
    color: var(--text);
    font-size: 12px;
    font-family: inherit;
    resize: vertical;
    outline: none;
    transition: border-color 0.15s;
}

.feedback-textarea:focus {
    border-color: rgba(139, 92, 246, 0.9);
}

.feedback-textarea::placeholder {
    color: rgba(148, 163, 184, 0.5);
}

.feedback-counter {
    text-align: right;
    font-size: 11px;
    color: #6b7280;
    margin-top: 4px;
}

.feedback-counter.warning {
    color: #f59e0b;
}

.feedback-counter.error {
    color: #ef4444;
}

.feedback-info {
    font-size: 11px;
    color: #6b7280;
    margin-bottom: 12px;
    padding: 8px;
    background: rgba(139, 92, 246, 0.1);
    border-radius: 8px;
}

.feedback-submit {
    width: 100%;
    padding: 10px;
    border-radius: 10px;
    border: none;
    background: linear-gradient(135deg, #8b5cf6, #6366f1);
    color: white;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s;
}

.feedback-submit:hover:not(:disabled) {
    opacity: 0.9;
}

.feedback-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.feedback-success {
    text-align: center;
    padding: 20px;
    display: none;
}

.feedback-success.show {
    display: block;
}

.feedback-success-icon {
    font-size: 48px;
    margin-bottom: 10px;
}

.feedback-success-text {
    color: #4ade80;
    font-size: 14px;
}

.feedback-reward {
    color: #f59e0b;
    font-size: 12px;
    margin-top: 8px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes shake {
    0% { transform: translateX(0); }
    25% { transform: translateX(-2px); }
    50% { transform: translateX(2px); }
    75% { transform: translateX(-2px); }
    100% { transform: translateX(0); }
}