/* ════════════════════════════════════════════════════════
   AutoPoster Admin — CSS
   Premium dark theme with glassmorphism
   ════════════════════════════════════════════════════════ */

:root {
    /* Colors */
    --bg-primary: #0a0e17;
    --bg-secondary: #111827;
    --bg-card: rgba(17, 24, 39, 0.8);
    --bg-card-hover: rgba(31, 41, 55, 0.9);
    --bg-input: rgba(17, 24, 39, 0.6);
    --bg-sidebar: rgba(7, 11, 20, 0.95);

    --border: rgba(75, 85, 99, 0.3);
    --border-focus: rgba(99, 102, 241, 0.5);
    --border-light: rgba(75, 85, 99, 0.15);

    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;

    --accent: #6366f1;
    --accent-hover: #818cf8;
    --accent-glow: rgba(99, 102, 241, 0.25);
    --accent-gradient: linear-gradient(135deg, #6366f1 0%, #8b5cf6 50%, #a78bfa 100%);

    --success: #10b981;
    --success-bg: rgba(16, 185, 129, 0.1);
    --warning: #f59e0b;
    --warning-bg: rgba(245, 158, 11, 0.1);
    --danger: #ef4444;
    --danger-bg: rgba(239, 68, 68, 0.1);

    /* Spacing */
    --sidebar-width: 260px;
    --radius: 12px;
    --radius-sm: 8px;
    --radius-lg: 16px;

    /* Transitions */
    --transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

/* ── Reset ─────────────────────────────────────────── */

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

[hidden] {
    display: none !important;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    line-height: 1.6;
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3 {
    font-weight: 700;
    letter-spacing: -0.02em;
}

a {
    color: var(--accent);
    text-decoration: none;
}

code {
    background: rgba(99, 102, 241, 0.15);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
    color: var(--accent-hover);
}

/* ── Login Screen ──────────────────────────────────── */

.login-screen {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    position: fixed;
    inset: 0;
    z-index: 200;
    background: var(--bg-primary);
    overflow: hidden;
}

.login-bg-orbs {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: orbFloat 8s ease-in-out infinite;
}

.orb-1 {
    width: 300px;
    height: 300px;
    background: #6366f1;
    top: 10%;
    left: 15%;
    animation-delay: 0s;
}

.orb-2 {
    width: 250px;
    height: 250px;
    background: #8b5cf6;
    top: 60%;
    right: 15%;
    animation-delay: -3s;
}

.orb-3 {
    width: 200px;
    height: 200px;
    background: #a78bfa;
    bottom: 10%;
    left: 40%;
    animation-delay: -5s;
}

@keyframes orbFloat {

    0%,
    100% {
        transform: translate(0, 0) scale(1);
    }

    33% {
        transform: translate(30px, -20px) scale(1.05);
    }

    66% {
        transform: translate(-20px, 15px) scale(0.95);
    }
}

.login-card {
    position: relative;
    z-index: 1;
    background: rgba(17, 24, 39, 0.75);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 3rem;
    width: 100%;
    max-width: 420px;
    box-shadow:
        0 0 0 1px rgba(255, 255, 255, 0.05),
        0 25px 50px rgba(0, 0, 0, 0.5);
    animation: cardAppear 0.6s ease-out;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.login-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.logo-icon {
    font-size: 3rem;
    display: block;
    margin-bottom: 0.5rem;
    animation: logoPulse 2s ease-in-out infinite;
}

@keyframes logoPulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.08);
    }
}

.login-logo h1 {
    font-size: 1.75rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-subtitle {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 0.25rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}

.login-error {
    background: var(--danger-bg);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
    padding: 0.75rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-8px);
    }

    75% {
        transform: translateX(8px);
    }
}

.login-hint {
    margin-top: 1.5rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--text-muted);
}

/* ── Input ─────────────────────────────────────────── */

.input-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.input-group label {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    color: var(--text-muted);
    pointer-events: none;
}

.input-wrapper input {
    padding-left: 42px;
}

input,
select,
textarea {
    width: 100%;
    padding: 0.75rem 1rem;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9375rem;
    transition: var(--transition);
    outline: none;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-glow);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-muted);
}

select {
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' fill='%239ca3af' viewBox='0 0 16 16'%3E%3Cpath d='M8 11L3 6h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 36px;
}

select option {
    background: var(--bg-secondary);
    color: var(--text-primary);
}

/* ── Buttons ───────────────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.65rem 1.25rem;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    white-space: nowrap;
}

.btn svg {
    width: 16px;
    height: 16px;
}

.btn-primary {
    background: var(--accent-gradient);
    color: white;
    border-color: transparent;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 24px var(--accent-glow);
}

.btn-primary:active {
    transform: translateY(0);
}

.btn-ghost {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.btn-danger {
    background: var(--danger-bg);
    color: var(--danger);
    border-color: rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.2);
}

.btn-sm {
    padding: 0.4rem 0.75rem;
    font-size: 0.8rem;
}

.btn-lg {
    padding: 0.875rem 1.5rem;
    font-size: 1rem;
}

.btn-full {
    width: 100%;
    justify-content: center;
}

/* ── App Layout ────────────────────────────────────── */

.app {
    display: flex;
    min-height: 100vh;
}

/* ── Sidebar ───────────────────────────────────────── */

.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    border-right: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 100;
    backdrop-filter: blur(12px);
}

.sidebar-header {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid var(--border-light);
}

.logo-icon-sm {
    font-size: 1.5rem;
}

.sidebar-title {
    font-weight: 700;
    font-size: 1.125rem;
    background: var(--accent-gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    position: relative;
}

.nav-item svg {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: var(--accent-glow);
    color: var(--accent-hover);
}

.nav-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: var(--accent);
    border-radius: 0 2px 2px 0;
}

.sidebar-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 1rem;
    border-radius: var(--radius-sm);
    color: var(--text-muted);
    font-size: 0.9rem;
    font-weight: 500;
    transition: var(--transition);
    background: none;
    border: none;
    cursor: pointer;
    width: 100%;
    font-family: inherit;
}

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

.btn-logout:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

/* ── Main Content ──────────────────────────────────── */

.main-content {
    flex: 1;
    margin-left: var(--sidebar-width);
    padding: 2rem 2.5rem;
    min-height: 100vh;
}

.page-header {
    margin-bottom: 2rem;
}

.page-header h1 {
    font-size: 1.75rem;
    margin-bottom: 0.25rem;
}

.page-desc {
    color: var(--text-muted);
    font-size: 0.9rem;
}

/* ── Tabs ──────────────────────────────────────────── */

.tab-content {
    display: none;
    animation: fadeIn 0.3s ease-out;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ── Cards ─────────────────────────────────────────── */

.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    backdrop-filter: blur(8px);
    transition: var(--transition);
}

.card:hover {
    border-color: rgba(75, 85, 99, 0.5);
}

.card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.card-header h2 {
    font-size: 1.1rem;
    font-weight: 600;
}

/* ── Stats Grid ────────────────────────────────────── */

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    border-color: rgba(75, 85, 99, 0.5);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
}

.stat-icon {
    width: 48px;
    height: 48px;
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    flex-shrink: 0;
}

.stat-icon.purple {
    background: rgba(99, 102, 241, 0.15);
}

.stat-icon.green {
    background: rgba(16, 185, 129, 0.15);
}

.stat-icon.amber {
    background: rgba(245, 158, 11, 0.15);
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.15);
}

.stat-info h3 {
    font-size: 1.5rem;
    font-weight: 800;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 600;
}

/* ── Channels Grid ─────────────────────────────────── */

.channels-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(380px, 1fr));
    gap: 1.5rem;
}

.channel-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: var(--transition);
}

.channel-card:hover {
    border-color: rgba(75, 85, 99, 0.5);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
}

.channel-card-header {
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.1) 0%, rgba(139, 92, 246, 0.05) 100%);
    padding: 1.5rem;
    border-bottom: 1px solid var(--border-light);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.channel-name {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.channel-name h3 {
    font-size: 1.1rem;
}

.channel-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.3rem 0.7rem;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
}

.channel-badge.active {
    background: var(--success-bg);
    color: var(--success);
}

.channel-badge.inactive {
    background: var(--danger-bg);
    color: var(--danger);
}

.channel-badge-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
}

.channel-card-body {
    padding: 1.5rem;
}

.channel-info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.channel-info-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.channel-info-value {
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
}

.channel-card-actions {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-light);
    display: flex;
    gap: 0.75rem;
}

/* ── Prompts ───────────────────────────────────────── */

.prompts-tabs {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.prompt-tab {
    padding: 0.6rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    background: var(--bg-card);
    border: 1px solid var(--border);
    color: var(--text-secondary);
    cursor: pointer;
    transition: var(--transition);
    font-family: inherit;
}

.prompt-tab:hover {
    background: var(--bg-card-hover);
    color: var(--text-primary);
}

.prompt-tab.active {
    background: var(--accent-glow);
    border-color: var(--accent);
    color: var(--accent-hover);
}

.prompt-editor {
    width: 100%;
    min-height: 500px;
    padding: 1.25rem;
    font-family: 'Inter', monospace;
    font-size: 0.9rem;
    line-height: 1.7;
    resize: vertical;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
}

/* ── Sources ───────────────────────────────────────── */

.source-form {
    margin-bottom: 0;
}

.form-row {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.form-row .input-group {
    flex: 1;
}

.form-row .btn {
    flex-shrink: 0;
    height: 42px;
}

.source-channel-group {
    margin-top: 1.5rem;
}

.source-channel-group h3 {
    font-size: 1rem;
    margin-bottom: 1rem;
    color: var(--text-secondary);
}

.source-list {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.source-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1rem;
    background: rgba(0, 0, 0, 0.15);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    transition: var(--transition);
}

.source-item:hover {
    background: rgba(0, 0, 0, 0.25);
    border-color: var(--border);
}

.source-info {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.source-favicon {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    background: var(--bg-secondary);
}

.source-name {
    font-weight: 500;
    font-size: 0.9rem;
}

.source-url {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-icon {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.4rem;
    border-radius: 4px;
    transition: var(--transition);
}

.btn-icon:hover {
    background: var(--danger-bg);
    color: var(--danger);
}

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

/* ── Schedule ──────────────────────────────────────── */

.schedule-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.schedule-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.schedule-header h3 {
    font-size: 1.1rem;
}

.schedule-times {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.time-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.5rem 0.9rem;
    background: rgba(99, 102, 241, 0.1);
    border: 1px solid rgba(99, 102, 241, 0.2);
    border-radius: 100px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--accent-hover);
}

.time-badge svg {
    width: 14px;
    height: 14px;
}

.schedule-form {
    display: flex;
    gap: 1rem;
    align-items: flex-end;
}

.schedule-form .input-group {
    flex: 1;
}

/* ── Toggle ────────────────────────────────────────── */

.toggle {
    position: relative;
    width: 48px;
    height: 26px;
    cursor: pointer;
}

.toggle input {
    opacity: 0;
    width: 0;
    height: 0;
    position: absolute;
}

.toggle-slider {
    position: absolute;
    inset: 0;
    background: rgb(55, 65, 81);
    border-radius: 13px;
    transition: var(--transition);
}

.toggle-slider::before {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    left: 3px;
    bottom: 3px;
    background: white;
    border-radius: 50%;
    transition: var(--transition);
}

.toggle input:checked+.toggle-slider {
    background: var(--accent);
}

.toggle input:checked+.toggle-slider::before {
    transform: translateX(22px);
}

/* ── Log Output ────────────────────────────────────── */

.log-output {
    background: rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    border-radius: var(--radius-sm);
    padding: 1rem;
    max-height: 400px;
    overflow-y: auto;
    font-family: 'Cascadia Code', 'Fira Code', monospace;
    font-size: 0.8rem;
    line-height: 1.6;
}

.log-line {
    color: var(--text-muted);
    padding: 1px 0;
}

.log-line.info {
    color: var(--text-secondary);
}

.log-line.warning {
    color: var(--warning);
}

.log-line.error {
    color: var(--danger);
}

/* ── Post Structure ────────────────────────────────── */

.structure-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
}

.structure-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.section-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1.25rem;
}

.section-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    padding: 0.45rem 0.85rem;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--success);
}

.section-tag .tag-num {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.7rem;
}

.length-info {
    display: flex;
    gap: 2rem;
    margin-bottom: 1.25rem;
}

.length-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.length-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.length-value {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
}

/* ── Settings ──────────────────────────────────────── */

.settings-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.info-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.info-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--border-light);
}

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

.info-label {
    font-size: 0.85rem;
    color: var(--text-muted);
}

.info-value {
    font-size: 0.85rem;
    font-weight: 500;
}

/* ── Toast ─────────────────────────────────────────── */

.toast-container {
    position: fixed;
    top: 1.5rem;
    right: 1.5rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.toast {
    padding: 0.875rem 1.25rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 500;
    backdrop-filter: blur(12px);
    animation: toastIn 0.3s ease-out;
    min-width: 280px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.toast.success {
    background: rgba(16, 185, 129, 0.15);
    border: 1px solid rgba(16, 185, 129, 0.3);
    color: var(--success);
}

.toast.error {
    background: rgba(239, 68, 68, 0.15);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--danger);
}

.toast.info {
    background: rgba(99, 102, 241, 0.15);
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: var(--accent-hover);
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes toastOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }

    to {
        opacity: 0;
        transform: translateX(30px);
    }
}

/* ── Responsive ────────────────────────────────────── */

@media (max-width: 768px) {
    .sidebar {
        width: 60px;
    }

    .sidebar-header span:not(.logo-icon-sm),
    .sidebar-nav .nav-item span,
    .sidebar-footer .btn-logout span,
    .sidebar-footer .nav-item span {
        display: none;
    }

    .main-content {
        margin-left: 60px;
        padding: 1.5rem;
    }

    .form-row {
        flex-direction: column;
    }

    .channels-grid {
        grid-template-columns: 1fr;
    }
}

/* ── Text helpers ──────────────────────────────────── */

.text-muted {
    color: var(--text-muted);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.empty-state {
    text-align: center;
    padding: 3rem 2rem;
    color: var(--text-muted);
}

.empty-state svg {
    width: 48px;
    height: 48px;
    margin-bottom: 1rem;
    opacity: 0.3;
}

.empty-state h3 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    color: var(--text-secondary);
}

/* ── Post History ─────────────────────────────────────── */

.post-history-item {
    padding: 0.75rem 1rem;
    border-bottom: 1px solid var(--border);
    transition: background 0.2s;
}

.post-history-item:last-child {
    border-bottom: none;
}

.post-history-item:hover {
    background: rgba(255, 255, 255, 0.03);
}

.post-history-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.3rem;
}

.post-history-channel {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--accent);
    background: rgba(99, 102, 241, 0.15);
    padding: 0.15rem 0.5rem;
    border-radius: var(--radius-sm);
}

.post-history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.post-history-title {
    font-size: 0.9rem;
    color: var(--text-primary);
    line-height: 1.4;
}

#posts-history {
    max-height: 400px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

/* ── Scrollbar ─────────────────────────────────────── */

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(75, 85, 99, 0.3);
    border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(75, 85, 99, 0.5);
}