/* ============ RESET ============ */
* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
    --bg: #efede8;
    --bg-soft: #f5f3ee;
    --card: #fbfaf7;
    --card-dark: #171717;
    --text: #171717;
    --text-dim: #6b6b6b;
    --text-light: #9a9a9a;
    --border: rgba(23, 23, 23, 0.1);
    --border-strong: rgba(23, 23, 23, 0.15);
    --accent: #c9ff4a;
    --accent-dark: #687044;
    --violet: #7c5cff;
    --green: #4ade80;
}

html { scroll-behavior: smooth; }

body {
    font-family: "Avenir Next", "Inter", -apple-system, system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
button { font-family: inherit; }
img { max-width: 100%; display: block; }

::selection {
    background: rgba(201, 255, 74, 0.55);
}

/* ============ APP LAYOUT (с сайдбаром) ============ */
.app-layout {
    display: flex;
    min-height: 100vh;
    max-width: 1600px;
    margin: 0 auto;
}

/* ============ SIDEBAR ============ */
.sidebar {
    width: 260px;
    flex-shrink: 0;
    background: var(--card-dark);
    color: #fff;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 24px;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-bottom: 16px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.sidebar-logo-mark {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    background: var(--accent);
    color: var(--card-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 20px;
}

.sidebar-logo-text {
    font-size: 18px;
    font-weight: 800;
}

.sidebar-logo-sub {
    font-size: 11px;
    color: rgba(255,255,255,0.5);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    color: rgba(255,255,255,0.65);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    border: none;
    background: transparent;
    text-align: left;
    width: 100%;
    font-family: inherit;
}

.sidebar-nav-item:hover {
    background: rgba(255,255,255,0.06);
    color: #fff;
}

.sidebar-nav-item.active {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

.sidebar-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
}

.sidebar-balance {
    margin-top: auto;
    padding: 20px;
    border-radius: 20px;
    background: rgba(255,255,255,0.05);
    border: 1px solid rgba(255,255,255,0.1);
}

.sidebar-balance-label {
    display: flex;
    justify-content: space-between;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 12px;
}

.sidebar-balance-value {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--accent);
}

.sidebar-balance-hint {
    font-size: 13px;
    color: rgba(255,255,255,0.55);
    margin-top: 6px;
}

/* ============ MAIN CONTENT ============ */
.main-content {
    flex: 1;
    padding: 24px;
    min-width: 0;
}

.content-shell {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 32px;
    box-shadow: 0 20px 50px rgba(23, 23, 23, 0.08);
}

/* ============ HEADER ============ */
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 20px;
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.page-header-label {
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-dark);
    margin-bottom: 8px;
}

.page-title {
    font-size: 36px;
    font-weight: 900;
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.page-header-actions {
    display: flex;
    gap: 10px;
    align-items: center;
    flex-wrap: wrap;
}

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border-radius: 10px;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all .2s;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1;
}

.btn-dark {
    background: var(--card-dark);
    color: #fff;
}
.btn-dark:hover { background: #000; }

.btn-accent {
    background: var(--accent);
    color: var(--card-dark);
}
.btn-accent:hover {
    background: #d6ff66;
    box-shadow: 0 0 30px rgba(201, 255, 74, 0.4);
}

.btn-outline {
    background: transparent;
    color: var(--text);
    border: 1px solid var(--border-strong);
}
.btn-outline:hover { background: rgba(23, 23, 23, 0.04); }

.btn-soft {
    background: #e7edcf;
    color: var(--accent-dark);
    border: 1px solid rgba(104, 112, 68, 0.2);
}
.btn-soft:hover { background: #dde6bb; }

.btn-sm { padding: 8px 14px; font-size: 13px; border-radius: 8px; }
.btn-lg { padding: 16px 28px; font-size: 15px; border-radius: 12px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: 0.5; cursor: wait; }

/* ============ GRID (две колонки) ============ */
.two-col {
    display: grid;
    grid-template-columns: 1.05fr 0.95fr;
    gap: 24px;
    align-items: start;
}

@media (max-width: 1100px) {
    .two-col { grid-template-columns: 1fr; }
}

/* ============ PANEL (блок) ============ */
.panel {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    margin-bottom: 20px;
}

.panel-header {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border);
}

.panel-num {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--card-dark);
    color: #fff;
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.panel-title {
    font-size: 16px;
    font-weight: 700;
}

.panel-desc {
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 2px;
}

.panel-badge {
    margin-left: auto;
    padding: 5px 12px;
    border-radius: 100px;
    background: #e7edcf;
    color: var(--accent-dark);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.03em;
}

.panel-body {
    padding: 24px;
    background: var(--card);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* ============ FORM FIELDS ============ */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-field-label {
    font-size: 13px;
    font-weight: 700;
    color: var(--text);
    display: flex;
    align-items: center;
    gap: 8px;
}

.form-field-hint {
    font-size: 11px;
    color: var(--text-light);
    font-weight: 400;
}

.required { color: #e04b4b; }

.form-input,
.form-textarea {
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: #fff;
    color: var(--text);
    font-size: 14px;
    font-family: inherit;
    transition: border-color .2s, box-shadow .2s;
    width: 100%;
}

.form-input:focus,
.form-textarea:focus {
    outline: none;
    border-color: var(--violet);
    box-shadow: 0 0 0 3px rgba(124, 92, 255, 0.1);
}

.form-input::placeholder,
.form-textarea::placeholder { color: #b5b5b5; }

.form-textarea {
    resize: vertical;
    min-height: 80px;
    line-height: 1.5;
}

/* ============ CARDS GRID (выбор маркетплейса/стиля) ============ */
.cards-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 10px;
}

.cards-grid-sm {
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
}

.select-card {
    position: relative;
    cursor: pointer;
}

.select-card input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.select-card-content {
    padding: 14px 16px;
    border-radius: 12px;
    border: 1px solid var(--border-strong);
    background: #fff;
    transition: all .2s;
}

.select-card:hover .select-card-content {
    border-color: #b5b5b5;
    transform: translateY(-2px);
}

.select-card input:checked + .select-card-content {
    border-color: var(--card-dark);
    background: var(--card-dark);
    color: #fff;
}

.select-card-icon {
    font-size: 22px;
    margin-bottom: 8px;
}

.select-card-name {
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 3px;
}

.select-card-meta {
    font-size: 11px;
    opacity: 0.6;
    line-height: 1.4;
}

.select-card-check {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: var(--accent);
    color: var(--card-dark);
    font-size: 12px;
    font-weight: 900;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.5);
    transition: all .2s;
}

.select-card input:checked ~ .select-card-check {
    opacity: 1;
    transform: scale(1);
}

/* ============ UPLOAD ============ */
.upload-area {
    border: 2px dashed var(--border-strong);
    border-radius: 14px;
    background: #fff;
    transition: all .3s;
    position: relative;
}

.upload-area:hover {
    border-color: var(--violet);
}

.upload-area.dragover {
    border-color: var(--violet);
    background: rgba(124, 92, 255, 0.04);
}

.upload-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 160px;
    padding: 30px 24px;
    cursor: pointer;
    text-align: center;
}

.upload-icon { font-size: 38px; margin-bottom: 4px; }
.upload-placeholder p { font-size: 14px; font-weight: 600; }
.upload-placeholder span { font-size: 12px; color: var(--text-dim); }

.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    padding: 16px;
}

.preview-item {
    position: relative;
    width: 90px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    border: 2px solid var(--border-strong);
    cursor: zoom-in;
    transition: transform .2s;
}

.preview-item:hover { transform: scale(1.05); }

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.preview-remove {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.preview-remove:hover { background: #e04b4b; }

/* ============ PREVIEW CARD (правая колонка, тёмная) ============ */
.preview-dark {
    background: var(--card-dark);
    color: #fff;
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
}

.preview-dark-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 20px;
}

.preview-dark-label {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.5);
    margin-bottom: 6px;
}

.preview-dark-title {
    font-size: 20px;
    font-weight: 800;
}

.preview-dark-badge {
    padding: 6px 12px;
    border-radius: 100px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.15);
    font-size: 12px;
    font-weight: 600;
}

.preview-card-visual {
    border-radius: 14px;
    background: linear-gradient(135deg, #77766f, #d9d6cc, #c9ff4a);
    padding: 16px;
    aspect-ratio: 1;
    position: relative;
    margin-bottom: 16px;
}

.preview-card-tag {
    display: inline-block;
    padding: 6px 12px;
    border-radius: 100px;
    background: rgba(23, 23, 23, 0.85);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
}

.preview-score {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-radius: 12px;
    background: rgba(255,255,255,0.05);
    margin-bottom: 16px;
}

.preview-score-label {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: rgba(255,255,255,0.6);
}

.preview-score-value {
    font-size: 16px;
    font-weight: 700;
    color: var(--green);
}

.preview-dark-actions {
    display: flex;
    gap: 10px;
}

/* ============ PROMPT ============ */
.prompt-display {
    background: #0f0f0f;
    color: #e0e0e0;
    padding: 16px 20px;
    border-radius: 12px;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.7;
    max-height: 240px;
    overflow-y: auto;
    word-break: break-word;
}

.prompt-textarea {
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
    line-height: 1.7;
    min-height: 140px;
    background: #0f0f0f !important;
    color: #e0e0e0 !important;
    border: 1px solid rgba(255,255,255,0.1) !important;
}

/* ============ RESULT CARDS ============ */
.result-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.result-item {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px;
    border-radius: 14px;
    background: #fff;
    border: 1px solid var(--border);
    transition: border-color .2s;
}

.result-item:hover { border-color: var(--border-strong); }

.result-thumb {
    width: 64px;
    height: 64px;
    border-radius: 10px;
    flex-shrink: 0;
    background: linear-gradient(135deg, #77766f, #c9ff4a);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    overflow: hidden;
}

.result-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.result-info {
    flex: 1;
    min-width: 0;
}

.result-title {
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.result-meta {
    font-size: 12px;
    color: var(--text-dim);
    display: flex;
    gap: 8px;
    align-items: center;
}

.result-status {
    padding: 4px 10px;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
}

.result-status.ready {
    background: #d1fae5;
    color: #065f46;
}

.result-status.draft {
    background: #fef3c7;
    color: #92400e;
}

/* ============ SUMMARY BAR ============ */
.summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    padding: 20px 24px;
    background: var(--card-dark);
    color: #fff;
    border-radius: 16px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.summary-cost {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.summary-cost-icon { font-size: 18px; }

.summary-cost-value {
    font-size: 26px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: -0.02em;
}

.summary-cost-label {
    color: rgba(255,255,255,0.6);
    font-size: 14px;
}

.summary-note {
    font-size: 13px;
    color: rgba(255,255,255,0.5);
    margin-top: 4px;
}

.summary-note strong { color: #fff; }

/* ============ PROGRESS ============ */
.generation-progress {
    padding: 40px 32px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    text-align: center;
}

.progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 28px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex: 1;
    font-size: 12px;
    color: var(--text-light);
    font-weight: 600;
    transition: color .3s;
}

.progress-step span {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #e0ded8;
    color: var(--text-dim);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    transition: all .3s;
}

.progress-step.active { color: var(--text); }

.progress-step.active span {
    background: var(--violet);
    color: #fff;
    box-shadow: 0 0 20px rgba(124, 92, 255, 0.4);
}

.progress-step.done span {
    background: var(--accent-dark);
    color: #fff;
    font-size: 0;
}

.progress-step.done span::after {
    content: '✓';
    font-size: 16px;
}

.progress-bar {
    width: 100%;
    height: 6px;
    background: #e0ded8;
    border-radius: 100px;
    overflow: hidden;
    margin-bottom: 14px;
}

.progress-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--violet), var(--accent));
    border-radius: 100px;
    width: 0;
    transition: width 0.6s ease;
}

.progress-text {
    color: var(--text-dim);
    font-size: 13px;
}

/* ============ MODAL ============ */
.image-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 24px;
    cursor: zoom-out;
}

.image-modal.open { display: flex; }

.image-modal img {
    max-width: 75vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    cursor: default;
}

.image-modal-close {
    position: absolute;
    top: 20px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
}

/* ============ LANDING ============ */
.landing-hero {
    max-width: 1200px;
    margin: 0 auto;
    padding: 80px 24px 40px;
    text-align: center;
}

.landing-hero-badge {
    display: inline-block;
    padding: 6px 16px;
    border-radius: 100px;
    background: #e7edcf;
    color: var(--accent-dark);
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 24px;
}

.landing-hero h1 {
    font-size: clamp(36px, 6vw, 64px);
    font-weight: 900;
    letter-spacing: -0.03em;
    line-height: 1.05;
    margin-bottom: 20px;
}

.landing-hero h1 .accent {
    background: linear-gradient(135deg, var(--violet), var(--accent-dark));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.landing-hero p {
    font-size: 18px;
    color: var(--text-dim);
    max-width: 620px;
    margin: 0 auto 32px;
    line-height: 1.6;
}

.landing-hero-actions {
    display: flex;
    gap: 16px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
    .app-layout { flex-direction: column; }
    .sidebar {
        width: 100%;
        height: auto;
        position: relative;
        flex-direction: row;
        flex-wrap: wrap;
        padding: 16px;
    }
    .sidebar-logo { width: 100%; border-bottom: none; padding-bottom: 0; }
    .sidebar-nav { flex-direction: row; flex-wrap: wrap; width: 100%; }
    .sidebar-balance { width: 100%; margin-top: 0; }
    .content-shell { padding: 20px; }
    .page-title { font-size: 26px; }
}

@media (max-width: 500px) {
    .main-content { padding: 12px; }
    .panel-body { padding: 16px; }
    .cards-grid, .cards-grid-sm { grid-template-columns: 1fr 1fr; }
    .summary-bar { flex-direction: column; align-items: stretch; text-align: center; }
}

/* ============ TOPBAR ============ */
.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 24px;
}

.auth-buttons {
    display: flex;
    gap: 10px;
}

.user-chip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 14px;
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: 100px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--card-dark);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 16px;
    flex-shrink: 0;
}

.user-info { min-width: 0; }

.user-name {
    font-weight: 700;
    font-size: 14px;
    line-height: 1.2;
}

.user-email {
    font-size: 12px;
    color: var(--text-dim);
    line-height: 1.2;
}

/* ============ MODAL ============ */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(23, 23, 23, 0.6);
    backdrop-filter: blur(4px);
    z-index: 1000;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.modal-overlay.open {
    display: flex;
    animation: fadeIn 0.2s ease-out;
}

.modal {
    background: var(--card);
    border-radius: 20px;
    padding: 32px;
    width: 100%;
    max-width: 440px;
    position: relative;
    box-shadow: 0 40px 80px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: var(--bg-soft);
    color: var(--text-dim);
    font-size: 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .2s;
}

.modal-close:hover {
    background: var(--border);
}

.modal-header {
    margin-bottom: 24px;
}

.modal-label {
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--accent-dark);
    margin-bottom: 8px;
}

.modal-title {
    font-size: 26px;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.modal-desc {
    font-size: 14px;
    color: var(--text-dim);
    line-height: 1.5;
}

.modal-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.modal-error {
    color: #e04b4b;
    font-size: 13px;
    text-align: center;
    min-height: 18px;
}

.modal-footer {
    text-align: center;
    font-size: 13px;
    color: var(--text-dim);
    margin-top: 8px;
}

.modal-footer a {
    color: var(--violet);
    font-weight: 600;
}

/* ============ TOAST ============ */
.toast {
    position: fixed;
    bottom: 30px;
    right: 30px;
    background: var(--card-dark);
    color: #fff;
    padding: 14px 20px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 20px 50px rgba(0, 0, 0, 0.3);
    z-index: 10000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s;
    max-width: 400px;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* ============ ACCOUNT HERO ============ */
.account-hero {
    position: relative;
    padding: 40px;
    border-radius: 20px;
    overflow: hidden;
    margin-bottom: 32px;
    background: linear-gradient(135deg, #171717 0%, #2a2a2a 100%);
    color: #fff;
}

.account-hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 20% 30%, rgba(201, 255, 74, 0.15) 0%, transparent 50%),
        radial-gradient(circle at 80% 70%, rgba(124, 92, 255, 0.15) 0%, transparent 50%);
    pointer-events: none;
}

.account-hero-content {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
}

.account-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, #c9ff4a, #687044);
    color: #171717;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 900;
    flex-shrink: 0;
    box-shadow: 0 10px 30px rgba(201, 255, 74, 0.3);
}

.account-hero-info {
    flex: 1;
    min-width: 200px;
}

.account-hero-name {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.account-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}

.account-hero-email {
    font-size: 14px;
    color: rgba(255,255,255,0.6);
}

.account-badge {
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 600;
}

.account-badge-success {
    background: rgba(201, 255, 74, 0.15);
    color: #c9ff4a;
    border: 1px solid rgba(201, 255, 74, 0.3);
}

.account-badge-warning {
    background: rgba(251, 191, 36, 0.15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, 0.3);
}

.account-hero-date {
    font-size: 13px;
    color: rgba(255,255,255,0.4);
}

.account-hero-btn {
    border-color: rgba(255,255,255,0.2) !important;
    color: #fff !important;
    background: rgba(255,255,255,0.05) !important;
}

.account-hero-btn:hover {
    background: rgba(255,255,255,0.1) !important;
}

/* ============ STATS ============ */
.stat-card {
    padding: 20px;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    position: relative;
    overflow: hidden;
}

.stat-card-icon {
    font-size: 20px;
    margin-bottom: 8px;
    opacity: 0.7;
}

.stat-card-label {
    font-size: 11px;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 8px;
    font-weight: 700;
}

.stat-card-value {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.02em;
    color: var(--text);
    line-height: 1.1;
    margin-bottom: 4px;
}

.stat-card-hint {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 6px;
}

.stat-card-accent {
    background: linear-gradient(135deg, #171717 0%, #2a2a2a 100%);
    border-color: transparent;
    color: #fff;
}

.stat-card-accent .stat-card-label,
.stat-card-accent .stat-card-hint {
    color: rgba(255,255,255,0.5);
}

.stat-card-accent .stat-card-value {
    color: #c9ff4a;
}

.stat-card-progress {
    width: 100%;
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 100px;
    overflow: hidden;
    margin-top: 12px;
}

.stat-card-progress-bar {
    height: 100%;
    background: linear-gradient(90deg, #c9ff4a, #687044);
    border-radius: 100px;
    transition: width 0.6s ease;
}

/* ============ ALERT ============ */
.alert {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 14px;
    margin-bottom: 24px;
}

.alert-warning {
    background: #fef3c7;
    border: 1px solid #fde68a;
}

.alert-icon {
    font-size: 24px;
    flex-shrink: 0;
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-weight: 700;
    font-size: 14px;
    color: #92400e;
    margin-bottom: 2px;
}

.alert-desc {
    font-size: 13px;
    color: #a16207;
}

/* ============ TRANSACTIONS ============ */
.tx-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.tx-item {
    display: grid;
    grid-template-columns: 40px 1fr auto auto;
    gap: 16px;
    align-items: center;
    padding: 14px 16px;
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 12px;
    transition: border-color .2s;
}

.tx-item:hover {
    border-color: var(--border-strong);
}

.tx-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    font-weight: 700;
}

.tx-icon-positive {
    background: #d1fae5;
    color: #065f46;
}

.tx-icon-negative {
    background: #fee2e2;
    color: #991b1b;
}

.tx-desc {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 2px;
    color: var(--text);
}

.tx-date {
    font-size: 12px;
    color: var(--text-dim);
}

.tx-amount {
    font-weight: 900;
    font-size: 18px;
    letter-spacing: -0.01em;
}

.tx-positive { color: #065f46; }
.tx-negative { color: #991b1b; }

.tx-balance {
    font-size: 12px;
    color: var(--text-light);
    min-width: 60px;
    text-align: right;
}

/* ============ GENERATIONS ============ */
.gen-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 16px;
}

.gen-card {
    background: #fff;
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
    transition: transform .3s, border-color .3s;
}

.gen-card:hover {
    transform: translateY(-4px);
    border-color: var(--border-strong);
}

.gen-card-image {
    aspect-ratio: 1;
    background: linear-gradient(135deg, #f5f3ee, #e7edcf);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.gen-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.gen-card-placeholder {
    font-size: 48px;
    opacity: 0.4;
}

.gen-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: rgba(23,23,23,0.85);
    color: #fff;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.gen-card-body {
    padding: 16px;
}

.gen-card-title {
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 4px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.gen-card-meta {
    font-size: 12px;
    color: var(--text-dim);
    margin-bottom: 4px;
}

.gen-card-date {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 12px;
}

.gen-card-prompt summary {
    cursor: pointer;
    color: var(--violet);
    font-size: 12px;
    font-weight: 600;
}

/* ============ EMPTY STATE ============ */
.empty-state {
    text-align: center;
    padding: 60px 20px;
}

.empty-state-icon {
    font-size: 48px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 6px;
}

.empty-state-desc {
    font-size: 14px;
    color: var(--text-dim);
    max-width: 320px;
    margin: 0 auto;
}

@media (max-width: 700px) {
    .account-hero { padding: 24px; }
    .account-avatar { width: 60px; height: 60px; font-size: 24px; }
    .account-hero-name { font-size: 22px; }
    .tx-item { grid-template-columns: 40px 1fr auto; }
    .tx-balance { display: none; }
    .stat-card-value { font-size: 24px; }
}

/* ============ ADMIN (Linear-style) ============ */
.admin-body {
    background: #fafafa;
}

.sidebar-admin {
    background: #0a0a0a;
    border-right: 1px solid rgba(255,255,255,0.06);
}

.sidebar-logo-mark-admin {
    background: #fff;
    color: #0a0a0a;
}

.nav-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.sidebar-nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-radius: 8px;
    color: rgba(255,255,255,0.6);
    font-size: 13px;
    font-weight: 500;
    transition: all 0.15s;
    text-decoration: none;
}

.sidebar-nav-item:hover {
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.9);
}

.sidebar-nav-item.active {
    background: rgba(255,255,255,0.08);
    color: #fff;
}

.sidebar-user {
    margin-top: auto;
    padding: 16px;
    border-radius: 12px;
    background: rgba(255,255,255,0.03);
    border: 1px solid rgba(255,255,255,0.06);
}

.sidebar-user-label {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.4);
    margin-bottom: 8px;
}

.sidebar-user-name {
    font-size: 13px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 2px;
}

.sidebar-user-email {
    font-size: 11px;
    color: rgba(255,255,255,0.4);
    margin-bottom: 12px;
    word-break: break-all;
}

.sidebar-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    background: rgba(255,255,255,0.05);
    color: rgba(255,255,255,0.8);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.15s;
    width: 100%;
    justify-content: center;
}

.sidebar-back-btn:hover {
    background: rgba(255,255,255,0.1);
    color: #fff;
}

/* Page header */
.page-header-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #6b6b6b;
    margin-bottom: 6px;
}

.page-title {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #0a0a0a;
    margin-bottom: 4px;
}

.page-subtitle {
    font-size: 13px;
    color: #6b6b6b;
}

/* Search form */
.search-form {
    position: relative;
    display: flex;
    align-items: center;
}

.search-icon {
    position: absolute;
    left: 12px;
    width: 14px;
    height: 14px;
    color: #999;
    pointer-events: none;
}

.search-input {
    padding: 9px 14px 9px 34px;
    border-radius: 8px;
    border: 1px solid #e5e5e5;
    background: #fff;
    font-size: 13px;
    min-width: 260px;
    color: #0a0a0a;
    transition: border-color 0.15s, box-shadow 0.15s;
}

.search-input:focus {
    outline: none;
    border-color: #0a0a0a;
    box-shadow: 0 0 0 3px rgba(10,10,10,0.08);
}

/* Flat panel */
.panel-flat {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
}

.panel-body-flat {
    padding: 0;
}

/* Data table */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
}

.data-table thead {
    background: #fafafa;
    border-bottom: 1px solid #e5e5e5;
}

.data-table th {
    text-align: left;
    padding: 11px 16px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6b6b6b;
}

.data-table td {
    padding: 14px 16px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

.data-table tbody tr:last-child td {
    border-bottom: none;
}

.data-table tbody tr:hover {
    background: #fafafa;
}

.td-id {
    color: #999;
    font-family: 'SF Mono', 'Consolas', monospace;
    font-size: 12px;
}

/* User cell */
.user-cell {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-cell-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #0a0a0a;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.user-cell-name {
    font-weight: 600;
    color: #0a0a0a;
    font-size: 13px;
    line-height: 1.3;
}

.user-cell-email {
    font-size: 12px;
    color: #999;
    line-height: 1.3;
}

/* Rays badge */
.rays-badge {
    display: inline-flex;
    align-items: center;
    padding: 3px 10px;
    border-radius: 100px;
    background: #f5f5f5;
    color: #0a0a0a;
    font-size: 12px;
    font-weight: 700;
    font-family: 'SF Mono', monospace;
}

/* Status badges */
.status-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.status-badge {
    display: inline-flex;
    align-items: center;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.status-badge-admin {
    background: #fee;
    color: #c00;
}

.status-badge-verified {
    background: #e8f5e9;
    color: #2e7d32;
}

.status-badge-pending {
    background: #fff8e1;
    color: #b76e00;
}

.status-badge-blocked {
    background: #f5f5f5;
    color: #666;
}

/* Icon buttons */
.action-buttons {
    display: flex;
    gap: 4px;
    justify-content: flex-end;
}

.icon-btn {
    width: 30px;
    height: 30px;
    padding: 0;
    border-radius: 6px;
    border: 1px solid transparent;
    background: transparent;
    color: #666;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
}

.icon-btn svg {
    width: 15px;
    height: 15px;
}

.icon-btn:hover {
    background: #f0f0f0;
    color: #0a0a0a;
    border-color: #e5e5e5;
}

.icon-btn-active {
    background: #0a0a0a;
    color: #fff;
    border-color: #0a0a0a;
}

.icon-btn-active:hover {
    background: #2a2a2a;
    color: #fff;
    border-color: #2a2a2a;
}

.icon-btn-danger:hover {
    background: #fee;
    color: #c00;
    border-color: #fcc;
}

/* Pagination */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 20px;
    border-top: 1px solid #f0f0f0;
}

.page-link {
    padding: 6px 12px;
    border-radius: 6px;
    background: #fafafa;
    color: #0a0a0a;
    text-decoration: none;
    font-size: 12px;
    font-weight: 500;
    border: 1px solid #e5e5e5;
    transition: all 0.15s;
}

.page-link:hover {
    background: #f0f0f0;
}

.page-info {
    font-size: 12px;
    color: #6b6b6b;
}

/* Modal improvements */
.modal-actions {
    display: flex;
    gap: 8px;
    justify-content: flex-end;
    margin-top: 8px;
}

.form-field-optional {
    color: #999;
    font-weight: 400;
    font-size: 12px;
}

/* ============ DASHBOARD ============ */
.kpi-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 16px;
}

.kpi-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    padding: 20px;
    transition: border-color 0.15s;
}

.kpi-card:hover {
    border-color: #d0d0d0;
}

.kpi-card-primary {
    background: #0a0a0a;
    border-color: #0a0a0a;
    color: #fff;
}

.kpi-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.kpi-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #6b6b6b;
}

.kpi-card-primary .kpi-label {
    color: rgba(255,255,255,0.5);
}

.kpi-icon {
    width: 16px;
    height: 16px;
    color: #999;
}

.kpi-card-primary .kpi-icon {
    color: rgba(255,255,255,0.4);
}

.kpi-value {
    font-size: 32px;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.1;
    margin-bottom: 6px;
    color: #0a0a0a;
}

.kpi-card-primary .kpi-value {
    color: #fff;
}

.kpi-footer {
    font-size: 12px;
    color: #6b6b6b;
}

.kpi-card-primary .kpi-footer {
    color: rgba(255,255,255,0.5);
}

.kpi-delta {
    color: #16a34a;
    font-weight: 600;
}

.kpi-card-primary .kpi-delta {
    color: #4ade80;
}

/* Panel header (clean) */
.panel-header-clean {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #f0f0f0;
}

.panel-header-clean .panel-title {
    font-size: 14px;
    font-weight: 600;
    color: #0a0a0a;
    margin-bottom: 2px;
}

.panel-header-clean .panel-desc {
    font-size: 12px;
    color: #999;
}

.panel-total {
    font-size: 12px;
    color: #6b6b6b;
}

.panel-total strong {
    color: #0a0a0a;
    font-size: 14px;
}

.panel-body-clean {
    padding: 8px 20px;
}

/* Chart */
.chart-container {
    padding: 20px;
}

.bar-chart {
    width: 100%;
    height: 120px;
    display: block;
}

.chart-labels {
    display: flex;
    justify-content: space-between;
    margin-top: 8px;
    font-size: 11px;
    color: #999;
    font-family: 'SF Mono', monospace;
}

/* Stat rows */
.stat-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.stat-row:last-child {
    border-bottom: none;
}

.stat-row-divider {
    border-top: 1px solid #e5e5e5;
    margin-top: 4px;
    padding-top: 16px;
}

.stat-label {
    font-size: 13px;
    color: #6b6b6b;
}

.stat-value {
    font-size: 15px;
    font-weight: 700;
    color: #0a0a0a;
    font-family: 'SF Mono', monospace;
}

.stat-value-positive {
    color: #16a34a;
}

.stat-value-negative {
    color: #dc2626;
}

/* List rows */
.list-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.list-row:last-child {
    border-bottom: none;
}

.list-rank {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: #f0f0f0;
    color: #6b6b6b;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    font-weight: 700;
    flex-shrink: 0;
}

.list-content {
    flex: 1;
    min-width: 0;
}

.list-name {
    font-size: 13px;
    font-weight: 600;
    color: #0a0a0a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-meta {
    font-size: 11px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.list-value {
    font-size: 14px;
    font-weight: 700;
    color: #0a0a0a;
    font-family: 'SF Mono', monospace;
    flex-shrink: 0;
}

/* Events */
.event-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.event-row:last-child {
    border-bottom: none;
}

.event-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: #f5f5f5;
    color: #6b6b6b;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.event-icon svg {
    width: 14px;
    height: 14px;
}

.event-icon-user {
    background: #e3f2fd;
    color: #1976d2;
}

.event-icon-generation {
    background: #f3e5f5;
    color: #7b1fa2;
}

.event-icon-transaction {
    background: #fff8e1;
    color: #b76e00;
}

.event-content {
    flex: 1;
    min-width: 0;
}

.event-title {
    font-size: 13px;
    font-weight: 600;
    color: #0a0a0a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-desc {
    font-size: 11px;
    color: #999;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.event-time {
    font-size: 11px;
    color: #999;
    font-family: 'SF Mono', monospace;
    flex-shrink: 0;
}

/* Empty block */
.empty-block {
    text-align: center;
    padding: 32px 20px;
    color: #999;
    font-size: 13px;
}

/* Dashboard layout */
.dashboard-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-top: 16px;
}

@media (max-width: 900px) {
    .dashboard-row {
        grid-template-columns: 1fr;
    }
}

/* ============ IMAGE MODAL (уменьшенная) ============ */
.image-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    padding: 40px;
    cursor: zoom-out;
}

.image-modal.open {
    display: flex;
    animation: fadeIn 0.15s ease-out;
}

.image-modal img {
    max-width: 75vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 14px;
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.6);
    cursor: default;
    background: #fff;
}

.image-modal-close {
    position: absolute;
    top: 24px;
    right: 24px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
    padding: 0;
}

.image-modal-close:hover {
    background: rgba(255,255,255,0.2);
    transform: scale(1.05);
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@media (max-width: 700px) {
    .image-modal { padding: 20px; }
    .image-modal img {
        max-width: 75vw;
        max-height: 80vh;
    }
    .image-modal-close {
        top: 12px;
        right: 12px;
    }
}

/* ============ UPLOAD ADD BUTTON ============ */
.upload-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: calc(100% - 32px);
    margin: 0 16px 16px;
    padding: 10px 16px;
    border: 1px dashed #d0d0d0;
    border-radius: 10px;
    background: transparent;
    color: #6b6b6b;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
}
.upload-add-btn:hover {
    border-color: #0a0a0a;
    color: #0a0a0a;
    background: #fafafa;
}

/* ============ UPLOAD PREVIEW (обновлённые) ============ */
.upload-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    padding: 16px;
    justify-content: center;
}

.preview-item {
    position: relative;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    overflow: hidden;
    border: 2px solid #e5e5e5;
    transition: all 0.2s;
    cursor: zoom-in;
    background: #fafafa;
}

.preview-item:hover {
    border-color: #0a0a0a;
    transform: scale(1.03);
    box-shadow: 0 8px 20px rgba(0,0,0,0.08);
}

.preview-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.preview-remove {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border: none;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    opacity: 0;
    transition: all 0.15s;
}

.preview-item:hover .preview-remove {
    opacity: 1;
}

.preview-remove:hover {
    background: #e04b4b;
    transform: scale(1.1);
}

/* Кнопка "Добавить ещё" */
.upload-add-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100px;
    height: 100px;
    margin: 0;
    padding: 0;
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    background: #fafafa;
    color: #6b6b6b;
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.15s;
    flex-shrink: 0;
    flex-direction: column;
}

.upload-add-btn:hover {
    border-color: #0a0a0a;
    color: #0a0a0a;
    background: #fff;
}

.upload-add-btn svg {
    width: 20px;
    height: 20px;
}

/* ============ UPLOAD ADD TILE (правильная кнопка "+") ============ */
.upload-add-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 100px;
    height: 100px;
    padding: 8px;
    border: 2px dashed #c0c0c0;
    border-radius: 12px;
    background: #fafafa;
    color: #6b6b6b;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    font-family: inherit;
    box-sizing: border-box;
    line-height: 1;
}

.upload-add-tile:hover {
    border-color: #0a0a0a;
    color: #0a0a0a;
    background: #fff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.08);
}

.upload-add-tile:active {
    transform: translateY(0);
    box-shadow: none;
}

.upload-add-tile svg {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.upload-add-tile span {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

/* ============ TEMPLATES ============ */
.templates-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 24px;
}

.template-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.2s;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.template-card:hover {
    border-color: #0a0a0a;
    transform: translateY(-4px);
    box-shadow: 0 12px 30px rgba(0,0,0,0.08);
}

.template-preview {
    height: 160px;
    background: linear-gradient(135deg, #f5f3ee, #e7edcf);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.template-preview-inner svg {
    width: 40px;
    height: 40px;
    color: rgba(0,0,0,0.2);
}

.template-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    padding: 4px 10px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border-radius: 100px;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
}

.template-body { padding: 16px; flex: 1; }
.template-title { font-size: 15px; font-weight: 700; margin-bottom: 4px; }
.template-desc { font-size: 12px; color: #6b6b6b; margin-bottom: 12px; line-height: 1.5; }
.template-meta { display: flex; gap: 8px; flex-wrap: wrap; }
.template-meta-item { font-size: 11px; color: #999; padding: 3px 8px; background: #f5f5f5; border-radius: 4px; }

.template-btn {
    width: 100%;
    padding: 12px;
    border: none;
    border-top: 1px solid #f0f0f0;
    background: #fafafa;
    color: #0a0a0a;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.15s;
    font-family: inherit;
}

.template-btn:hover { background: #0a0a0a; color: #fff; }

/* ============ FILES ============ */
.files-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 16px;
    margin-top: 24px;
}

.file-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
}

.file-card:hover { border-color: #0a0a0a; transform: translateY(-2px); }

.file-preview {
    aspect-ratio: 1;
    background: #f5f5f5;
    overflow: hidden;
    max-height: 200px;
}

.file-preview img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.file-info { padding: 12px; }
.file-name { font-size: 12px; font-weight: 600; margin-bottom: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-size { font-size: 11px; color: #999; }

/* ============ PRICING ============ */
.balance-pill {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #0a0a0a;
    color: #fff;
    border-radius: 100px;
    font-size: 14px;
}

.balance-pill-icon { font-size: 16px; }
.balance-pill-value { font-size: 18px; font-weight: 800; color: #c9ff4a; }
.balance-pill-label { color: rgba(255,255,255,0.6); }

.plans-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-top: 32px;
}

.plan-card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 16px;
    padding: 28px 24px;
    position: relative;
    display: flex;
    flex-direction: column;
}

.plan-card-highlight {
    border-color: #0a0a0a;
    background: #0a0a0a;
    color: #fff;
    box-shadow: 0 20px 40px rgba(0,0,0,0.15);
}

.plan-card-highlight .plan-name,
.plan-card-highlight .plan-price-value,
.plan-card-highlight .plan-desc,
.plan-card-highlight .plan-features li { color: #fff; }

.plan-badge {
    position: absolute;
    top: -12px;
    left: 50%;
    transform: translateX(-50%);
    padding: 5px 14px;
    background: #c9ff4a;
    color: #0a0a0a;
    border-radius: 100px;
    font-size: 11px;
    font-weight: 700;
}

.plan-name { font-size: 18px; font-weight: 700; margin-bottom: 16px; color: #0a0a0a; }
.plan-price { display: flex; align-items: baseline; gap: 4px; margin-bottom: 8px; }
.plan-price-value { font-size: 36px; font-weight: 800; color: #0a0a0a; }
.plan-price-currency { font-size: 20px; color: #6b6b6b; }

.plan-rays {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    background: rgba(201,255,74,0.15);
    color: #687044;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 12px;
    align-self: flex-start;
}

.plan-desc { font-size: 13px; color: #6b6b6b; margin-bottom: 20px; }
.plan-features { list-style: none; margin-bottom: 24px; flex: 1; }
.plan-features li { display: flex; align-items: center; gap: 8px; padding: 6px 0; font-size: 13px; color: #0a0a0a; }
.plan-features li svg { width: 14px; height: 14px; color: #16a34a; flex-shrink: 0; }

.pricing-info { margin-top: 48px; padding: 32px; background: #fafafa; border-radius: 16px; }
.pricing-info h3 { font-size: 18px; font-weight: 700; margin-bottom: 20px; }
.pricing-info-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; }
.pricing-info-item { text-align: center; padding: 16px; background: #fff; border-radius: 12px; }
.pricing-info-icon { font-size: 28px; margin-bottom: 8px; }
.pricing-info-title { font-size: 13px; color: #6b6b6b; margin-bottom: 4px; }
.pricing-info-value { font-size: 16px; font-weight: 700; color: #0a0a0a; }
