/* === CABINET.CSS === */
/* assets/css/cabinet.css */

:root {
    --bg: #0f1117;
    --bg2: #1a1d27;
    --bg3: #22263a;
    --border: #2e3347;
    --accent: #6c63ff;
    --accent2: #9b94ff;
    --green: #34c77b;
    --red: #ff4f6a;
    --yellow: #f5a623;
    --text: #e8eaf0;
    --text2: #8b90a7;
    --radius: 12px;
    --shadow: 0 4px 24px rgba(0,0,0,.4);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: 'Inter', system-ui, sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    font-size: 14px;
    line-height: 1.5;
}

/* LOGIN */
.login-page { display: flex; align-items: center; justify-content: center; min-height: 100vh; }
.login-wrap {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px;
    width: 360px;
    box-shadow: var(--shadow);
}
.login-logo { font-size: 22px; font-weight: 700; margin-bottom: 4px; }
.login-logo span { color: var(--accent); }
.login-subtitle { color: var(--text2); font-size: 13px; margin-bottom: 28px; }
.login-error {
    background: rgba(255,79,106,.12);
    border: 1px solid rgba(255,79,106,.3);
    color: var(--red);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 16px;
    font-size: 13px;
}
.login-form .field { margin-bottom: 16px; }
.login-form label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 6px; }
.login-form input {
    width: 100%;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 14px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}
.login-form input:focus { border-color: var(--accent); }

/* BUTTONS */
.btn-primary {
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s, transform .1s;
}
.btn-primary:hover { opacity: .88; }
.btn-primary:active { transform: scale(.98); }
.btn-primary.btn-full { width: 100%; padding: 12px; margin-top: 8px; }

.btn-secondary {
    background: var(--bg3);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 16px;
    font-size: 13px;
    cursor: pointer;
    transition: background .2s;
}
.btn-secondary:hover { background: var(--border); }

.btn-approve {
    background: var(--green);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity .2s;
}
.btn-approve:hover { opacity: .85; }

.btn-reject {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
    border-radius: 8px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background .2s;
}
.btn-reject:hover { background: rgba(255,79,106,.1); }

.btn-logout {
    color: var(--text2);
    font-size: 13px;
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1px solid var(--border);
    transition: color .2s;
}
.btn-logout:hover { color: var(--text); }

/* HEADER */
.cab-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.cab-header-left, .cab-header-right { display: flex; align-items: center; gap: 20px; }
.cab-logo { font-size: 18px; font-weight: 700; }
.cab-logo span { color: var(--accent); }

.cab-stats { display: flex; gap: 16px; }
.stat-item { font-size: 13px; color: var(--text2); }
.stat-item span { color: var(--text); font-weight: 600; }
.stat-item.approved span { color: var(--green); }
.stat-item.published span { color: var(--accent2); }

.cab-user { display: flex; align-items: center; gap: 8px; }
.user-avatar {
    width: 32px; height: 32px;
    background: var(--accent);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 700; font-size: 14px;
}
.user-name { font-size: 13px; }

/* TABS */
.cab-tabs {
    display: flex;
    gap: 4px;
    padding: 16px 24px 0;
    border-bottom: 1px solid var(--border);
    background: var(--bg2);
}
.tab {
    background: none;
    border: none;
    border-bottom: 3px solid transparent;
    padding: 10px 18px;
    color: var(--text2);
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: color .2s, border-color .2s;
    display: flex;
    align-items: center;
    gap: 6px;
}
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.badge {
    background: var(--accent);
    color: #fff;
    border-radius: 20px;
    padding: 1px 7px;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    text-align: center;
}
.badge:empty { display: none; }

/* BODY */
.cab-body { padding: 20px 24px; max-width: 1400px; }

.queue-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}
.queue-info { font-size: 13px; color: var(--text2); }

/* GRID */
.queue-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 16px;
}

.post-card {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: border-color .2s, transform .15s;
    cursor: pointer;
}
.post-card:hover { border-color: var(--accent); transform: translateY(-2px); }

.post-card-image {
    aspect-ratio: 1/1;
    background: var(--bg3);
    overflow: hidden;
    position: relative;
}
.post-card-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    display: block;
}
.post-card-no-image {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: var(--text2); font-size: 13px;
}

.post-card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; gap: 8px; }

.post-card-source {
    display: flex; align-items: center; gap: 8px;
    font-size: 12px; color: var(--text2);
}
.post-card-source .channel { color: var(--accent2); font-weight: 600; }
.post-card-metrics { display: flex; gap: 10px; font-size: 12px; color: var(--text2); }
.metric { display: flex; align-items: center; gap: 3px; }
.metric.hot { color: var(--yellow); }

.post-card-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-card-schedule {
    font-size: 12px;
    color: var(--text2);
    margin-top: auto;
}
.post-card-schedule .time { color: var(--yellow); font-weight: 600; }

.post-card-actions {
    padding: 10px 12px;
    border-top: 1px solid var(--border);
    display: flex;
    gap: 8px;
}

/* СТАТУСЫ карточек */
.post-card.status-approved { border-color: rgba(52,199,123,.3); }
.post-card.status-published { border-color: rgba(108,99,255,.3); opacity: .8; }
.post-card.status-rejected { opacity: .5; }

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 20px;
}
.status-badge.pending { background: rgba(245,166,35,.15); color: var(--yellow); }
.status-badge.approved { background: rgba(52,199,123,.15); color: var(--green); }
.status-badge.published { background: rgba(108,99,255,.15); color: var(--accent2); }
.status-badge.rejected { background: rgba(255,79,106,.15); color: var(--red); }
.status-badge.auto { background: rgba(245,166,35,.15); color: var(--yellow); }

/* MODAL */
dialog {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    color: var(--text);
    padding: 0;
    max-width: 680px;
    width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: var(--shadow);
}
dialog::backdrop { background: rgba(0,0,0,.7); }

.modal-inner { padding: 24px; position: relative; }
.modal-close {
    position: absolute; top: 16px; right: 16px;
    background: none; border: none; color: var(--text2);
    font-size: 22px; cursor: pointer; line-height: 1;
    width: 32px; height: 32px; border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
}
.modal-close:hover { background: var(--bg3); color: var(--text); }

.modal-image-wrap { margin-bottom: 16px; border-radius: 8px; overflow: hidden; }
.modal-image-wrap img { width: 100%; display: block; max-height: 360px; object-fit: cover; }

.modal-text {
    font-size: 14px;
    line-height: 1.65;
    white-space: pre-wrap;
    background: var(--bg3);
    border-radius: 8px;
    padding: 14px;
    margin-bottom: 14px;
}

.modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 12px;
    color: var(--text2);
    margin-bottom: 16px;
    padding: 10px 14px;
    background: var(--bg3);
    border-radius: 8px;
}
.modal-meta strong { color: var(--text); }

.modal-actions { display: flex; gap: 10px; justify-content: flex-end; }

/* EMPTY, LOADING */
.loading, .empty-state {
    grid-column: 1/-1;
    text-align: center;
    padding: 60px 20px;
    color: var(--text2);
    font-size: 15px;
}
.empty-state .emoji { font-size: 36px; display: block; margin-bottom: 10px; }

/* FIELD */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--text2); margin-bottom: 5px; }
.field input {
    width: 100%; background: var(--bg3); border: 1px solid var(--border);
    border-radius: 8px; padding: 9px 13px; color: var(--text); font-size: 14px; outline: none;
}
.field input:focus { border-color: var(--accent); }

/* AUTO-PUBLISH badge */
.auto-badge {
    font-size: 11px;
    color: var(--yellow);
    background: rgba(245,166,35,.12);
    border-radius: 20px;
    padding: 2px 8px;
}

/* ===================== APP LAYOUT ===================== */
html, body { height: 100%; }
.app-wrap { display: flex; height: 100vh; overflow: hidden; }
.main-content { flex: 1; display: flex; flex-direction: column; overflow: hidden; min-width: 0; }
.section { display: none; flex: 1; overflow-y: auto; }
.section.active { display: flex; flex-direction: column; }

/* ===================== SIDEBAR ===================== */
.sidebar {
    width: 200px;
    flex-shrink: 0;
    background: var(--bg2);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    transition: width 0.2s ease;
    overflow: hidden;
}
.sidebar.collapsed { width: 52px; }

.sidebar-logo {
    height: 52px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    color: var(--accent);
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    letter-spacing: 1px;
}

.sidebar-nav { flex: 1; padding: 8px 0; overflow: hidden; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--text2);
    cursor: pointer;
    border-left: 2px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s;
    white-space: nowrap;
    text-decoration: none;
    font-size: 13px;
    user-select: none;
}
.nav-item:hover { background: var(--bg3); color: var(--text); }
.nav-item.active { color: var(--accent); border-left-color: var(--accent); background: rgba(108,99,255,.08); }
.nav-item.nav-soon { opacity: .55; cursor: default; }
.nav-item.nav-soon:hover { background: none; color: var(--text2); }

.nav-icon { font-size: 18px; flex-shrink: 0; width: 24px; text-align: center; }
.nav-label { flex: 1; display: flex; align-items: center; gap: 6px; overflow: hidden; }

.sidebar.collapsed .nav-label { display: none; }
.sidebar.collapsed .sidebar-logo { font-size: 13px; }
.sidebar.collapsed .sidebar-footer .nav-label { display: none; }
.sidebar.collapsed .nav-logout { display: none; }

.soon-chip {
    font-size: 10px;
    background: rgba(245,166,35,.15);
    color: var(--yellow);
    border-radius: 20px;
    padding: 1px 6px;
}

.sidebar-footer {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 14px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
    overflow: hidden;
    white-space: nowrap;
}
.nav-user { font-size: 12px; color: var(--text2); flex: 1; overflow: hidden; text-overflow: ellipsis; }
.nav-logout {
    color: var(--text2); font-size: 14px; text-decoration: none;
    flex-shrink: 0; padding: 2px 4px; border-radius: 4px; transition: color .15s;
}
.nav-logout:hover { color: var(--red); }

/* Кнопка-гамбургер в шапке */
.sidebar-toggle {
    background: none; border: none; color: var(--text2);
    font-size: 18px; cursor: pointer; padding: 4px 8px;
    border-radius: 6px; transition: color .15s, background .15s;
    flex-shrink: 0;
}
.sidebar-toggle:hover { background: var(--bg3); color: var(--text); }

/* ===================== ШАПКА (обновлена) ===================== */
.cab-header {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
    background: var(--bg2);
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    z-index: 100;
    flex-shrink: 0;
}
.cab-stats { display: flex; gap: 16px; flex: 1; }
.cab-user { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }

/* ===================== СЕКЦИИ ===================== */
.cab-tabs { padding: 16px 24px 0; border-bottom: 1px solid var(--border); flex-shrink: 0; display: flex; gap: 4px; }
.cab-body { padding: 20px 24px; flex: 1; overflow-y: auto; }

/* ===================== ПОИСК ПОСТОВ ===================== */
.search-header { margin-bottom: 20px; }
.section-title { font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.section-sub { font-size: 13px; color: var(--text2); }

.search-bar {
    display: flex;
    gap: 10px;
    margin-bottom: 24px;
}
.search-bar input {
    flex: 1;
    background: var(--bg3);
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 10px 16px;
    color: var(--text);
    font-size: 14px;
    outline: none;
    transition: border-color .2s;
}
.search-bar input:focus { border-color: var(--accent); }

.search-count { font-size: 13px; color: var(--text2); margin-bottom: 12px; }

.search-list { display: flex; flex-direction: column; gap: 10px; }

.search-result-item {
    background: var(--bg2);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    transition: border-color .15s;
}
.search-result-item:hover { border-color: var(--accent); }

.search-result-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}
.score.hot { color: var(--yellow); font-weight: 600; }

.search-result-text {
    font-size: 13px;
    color: var(--text2);
    line-height: 1.55;
}

.btn-add-queue {
    margin-left: auto;
    padding: 6px 14px;
    font-size: 12px;
    font-weight: 600;
}
.btn-add-queue.btn-added {
    background: var(--green);
    cursor: default;
}

/* ===================== ЗАГЛУШКИ ===================== */
.soon-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 300px;
    color: var(--text2);
    gap: 10px;
}
.soon-icon { font-size: 48px; }
.soon-placeholder h2 { font-size: 18px; color: var(--text); }
.soon-placeholder p { font-size: 13px; }
