/* === RSS Auto Publisher - Admin Dashboard Stylesheet === */

:root {
    --bg-dark: #0f1117;
    --bg-card: #1a1d27;
    --bg-card-hover: #1f2232;
    --sidebar-bg: #13151f;
    --sidebar-width: 260px;
    --accent: #6c63ff;
    --accent-hover: #7b73ff;
    --accent-glow: rgba(108, 99, 255, 0.25);
    --success: #22c55e;
    --danger: #ef4444;
    --warning: #f59e0b;
    --info: #3b82f6;
    --text-primary: #e2e8f0;
    --text-secondary: #94a3b8;
    --text-muted: #64748b;
    --border: rgba(255, 255, 255, 0.07);
    --border-accent: rgba(108, 99, 255, 0.4);
    --radius: 12px;
    --radius-sm: 8px;
    --shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    --transition: 0.2s ease;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body.app-body {
    font-family: 'Inter', sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    font-size: 14px;
    line-height: 1.6;
}

/* === LAYOUT === */
.app-layout {
    display: flex;
    min-height: 100vh;
}

/* === SIDEBAR === */
.sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
    flex-shrink: 0;
    transition: width var(--transition);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 16px;
    border-bottom: 1px solid var(--border);
}

.brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--accent), #9c6cff);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: white;
    flex-shrink: 0;
    box-shadow: 0 4px 12px var(--accent-glow);
}

.brand-name {
    display: block;
    font-weight: 700;
    font-size: 15px;
    color: var(--text-primary);
}

.brand-sub {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.sidebar-nav {
    padding: 12px 8px;
    flex: 1;
}

.nav-section {
    margin-bottom: 20px;
}

.nav-section-label {
    font-size: 10px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0 8px;
    margin-bottom: 4px;
    display: block;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    text-decoration: none;
    transition: var(--transition);
    font-weight: 500;
    font-size: 13.5px;
    position: relative;
    margin-bottom: 2px;
}

.nav-item:hover {
    background: rgba(255, 255, 255, 0.05);
    color: var(--text-primary);
}

.nav-item.active {
    background: linear-gradient(135deg, rgba(108, 99, 255, 0.2), rgba(108, 99, 255, 0.08));
    color: #a09bff;
    border: 1px solid var(--border-accent);
}

.nav-item i {
    font-size: 16px;
    opacity: 0.85;
}

.nav-badge {
    margin-left: auto;
    background: var(--accent);
    color: white;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 20px;
}

.sidebar-footer {
    padding: 12px;
    border-top: 1px solid var(--border);
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    transition: var(--transition);
}

.sidebar-user:hover {
    background: rgba(255, 255, 255, 0.05);
}

.user-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #9c6cff);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    color: white;
    flex-shrink: 0;
}

.user-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-primary);
}

.user-role {
    display: block;
    font-size: 11px;
    color: var(--text-muted);
}

.btn-logout {
    width: 100%;
    background: none;
    border: 1px solid var(--border);
    color: var(--text-muted);
    padding: 7px 12px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: var(--transition);
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 6px;
    justify-content: center;
}

.btn-logout:hover {
    border-color: var(--danger);
    color: var(--danger);
}

/* === MAIN CONTENT === */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.top-bar {
    background: var(--sidebar-bg);
    border-bottom: 1px solid var(--border);
    padding: 14px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.sidebar-toggle {
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 20px;
    padding: 4px;
    display: none;
}

.top-bar-title h1 {
    font-size: 17px;
    font-weight: 600;
    color: var(--text-primary);
}

.breadcrumb {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 2px;
}

.top-bar-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

.page-content {
    padding: 24px;
    flex: 1;
}

/* === ALERTS === */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 16px;
    margin: 0 24px 0;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    font-size: 13.5px;
    transition: opacity 0.5s;
}

.alert-success {
    background: rgba(34, 197, 94, 0.12);
    border-left: 3px solid var(--success);
    color: #86efac;
}

.alert-danger {
    background: rgba(239, 68, 68, 0.12);
    border-left: 3px solid var(--danger);
    color: #fca5a5;
}

.alert-close {
    margin-left: auto;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    font-size: 16px;
}

/* === CARDS === */
.card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-header {
    padding: 14px 20px;
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-title {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-primary);
}

.card-body {
    padding: 20px;
}

/* === STAT WIDGETS === */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 20px;
    display: flex;
    align-items: flex-start;
    gap: 16px;
    transition: var(--transition);
}

.stat-card:hover {
    border-color: var(--border-accent);
    transform: translateY(-2px);
}

.stat-icon {
    width: 44px;
    height: 44px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}

.stat-icon.purple {
    background: rgba(108, 99, 255, 0.15);
    color: #a09bff;
}

.stat-icon.green {
    background: rgba(34, 197, 94, 0.15);
    color: #4ade80;
}

.stat-icon.blue {
    background: rgba(59, 130, 246, 0.15);
    color: #60a5fa;
}

.stat-icon.amber {
    background: rgba(245, 158, 11, 0.15);
    color: #fbbf24;
}

.stat-icon.red {
    background: rgba(239, 68, 68, 0.15);
    color: #f87171;
}

.stat-icon.teal {
    background: rgba(20, 184, 166, 0.15);
    color: #2dd4bf;
}

.stat-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.1;
}

.stat-label {
    font-size: 12px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === TABLES === */
.table-wrapper {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

thead th {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 11.5px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-muted);
    text-align: left;
}

tbody td {
    padding: 12px 16px;
    border-bottom: 1px solid var(--border);
    font-size: 13.5px;
    color: var(--text-primary);
    vertical-align: middle;
}

tbody tr:hover td {
    background: rgba(255, 255, 255, 0.02);
}

tbody tr:last-child td {
    border-bottom: none;
}

/* === BADGES === */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 11.5px;
    font-weight: 600;
}

.badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: currentColor;
    opacity: 0.8;
}

.badge-success {
    background: rgba(34, 197, 94, 0.12);
    color: #4ade80;
}

.badge-danger {
    background: rgba(239, 68, 68, 0.12);
    color: #f87171;
}

.badge-warning {
    background: rgba(245, 158, 11, 0.12);
    color: #fbbf24;
}

.badge-info {
    background: rgba(59, 130, 246, 0.12);
    color: #60a5fa;
}

.badge-primary {
    background: rgba(108, 99, 255, 0.12);
    color: #a09bff;
}

.badge-secondary {
    background: rgba(100, 116, 139, 0.12);
    color: #94a3b8;
}

/* === BUTTONS === */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    border: none;
    transition: var(--transition);
}

.btn-primary {
    background: var(--accent);
    color: white;
}

.btn-primary:hover {
    background: var(--accent-hover);
    box-shadow: 0 4px 12px var(--accent-glow);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.06);
    color: var(--text-primary);
    border: 1px solid var(--border);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

.btn-success {
    background: rgba(34, 197, 94, 0.15);
    color: var(--success);
    border: 1px solid rgba(34, 197, 94, 0.3);
}

.btn-success:hover {
    background: rgba(34, 197, 94, 0.25);
}

.btn-danger {
    background: rgba(239, 68, 68, 0.15);
    color: var(--danger);
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.btn-danger:hover {
    background: rgba(239, 68, 68, 0.25);
}

.btn-sm {
    padding: 5px 12px;
    font-size: 12.5px;
}

.btn-xs {
    padding: 3px 9px;
    font-size: 12px;
}

.btn-icon {
    width: 34px;
    height: 34px;
    padding: 0;
    justify-content: center;
}

/* === FORMS === */
.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
}

.form-control {
    width: 100%;
    padding: 9px 14px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 13.5px;
    transition: var(--transition);
    font-family: inherit;
}

.form-control:focus {
    outline: none;
    border-color: var(--border-accent);
    background: rgba(108, 99, 255, 0.05);
}

.form-control::placeholder {
    color: var(--text-muted);
}

select.form-control option {
    background: var(--bg-card);
}

textarea.form-control {
    resize: vertical;
    min-height: 120px;
}

.form-hint {
    font-size: 11.5px;
    color: var(--text-muted);
    margin-top: 4px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-grid-3 {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 16px;
}

/* === PAGE GRID === */
.content-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.content-grid-3 {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
}

/* === ACTION BAR === */
.action-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
    gap: 12px;
    flex-wrap: wrap;
}

.action-bar-left {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

/* === PAGINATION === */
.pagination-wrapper {
    padding: 16px 0;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    gap: 4px;
    list-style: none;
}

.page-link {
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    text-decoration: none;
    background: var(--bg-card);
    border: 1px solid var(--border);
    transition: var(--transition);
}

.page-link:hover {
    border-color: var(--border-accent);
    color: var(--accent);
}

.page-item.active .page-link {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
}

/* === UTILITY === */
.d-flex {
    display: flex;
}

.gap-2 {
    gap: 8px;
}

.gap-3 {
    gap: 12px;
}

.mt-2 {
    margin-top: 8px;
}

.mt-3 {
    margin-top: 12px;
}

.mt-4 {
    margin-top: 16px;
}

.mb-0 {
    margin-bottom: 0;
}

.mb-4 {
    margin-bottom: 16px;
}

.text-muted {
    color: var(--text-muted);
}

.text-danger {
    color: var(--danger);
}

.text-success {
    color: var(--success);
}

.text-right {
    text-align: right;
}

.fw-600 {
    font-weight: 600;
}

.truncate {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.full-width {
    width: 100%;
}

.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-muted);
}

.empty-state i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: 0.4;
}

.empty-state p {
    font-size: 15px;
}

/* === LOGIN PAGE === */
.login-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--bg-dark);
}

.login-card {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 40px;
    width: 100%;
    max-width: 400px;
    box-shadow: var(--shadow);
}

.login-brand {
    text-align: center;
    margin-bottom: 32px;
}

.login-brand .brand-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    font-size: 24px;
    margin: 0 auto 12px;
}

.login-brand h1 {
    font-size: 20px;
    font-weight: 700;
}

.login-brand p {
    font-size: 13px;
    color: var(--text-muted);
    margin-top: 4px;
}

/* === ARTICLE PREVIEW === */
.article-preview-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.article-content {
    line-height: 1.8;
    color: var(--text-secondary);
}

.article-content h2 {
    color: var(--text-primary);
    font-size: 16px;
    margin: 16px 0 8px;
}

.article-content h3 {
    color: var(--text-primary);
    font-size: 14px;
    margin: 14px 0 6px;
}

.article-content p {
    margin-bottom: 12px;
}

/* === STATUS DOTS === */
.status-dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-radius: 50%;
}

.status-dot.active {
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
}

.status-dot.error {
    background: var(--danger);
}

.status-dot.inactive {
    background: var(--text-muted);
}

/* === CHART === */
.chart-container {
    position: relative;
    height: 200px;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        left: -260px;
        z-index: 200;
        transition: left 0.3s;
    }

    .sidebar.open {
        left: 0;
    }

    .sidebar-toggle {
        display: flex;
    }

    .form-grid,
    .form-grid-3,
    .content-grid,
    .article-preview-grid {
        grid-template-columns: 1fr;
    }

    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }

    .page-content {
        padding: 16px;
    }
}