/* ===== DASHBOARD LAYOUT ===== */
.dashboard-wrapper {
    display: flex;
    min-height: 100vh;
}

/* Sidebar */
.dashboard-sidebar {
    width: 260px;
    background: #1a1a2e;
    color: white;
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    overflow-y: auto;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    padding: 20px 24px;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}

.sidebar-nav {
    padding: 20px 0;
}

.sidebar-nav ul {
    list-style: none;
    padding: 0;
}

.sidebar-nav ul li a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    color: rgba(255,255,255,0.7);
    text-decoration: none;
    transition: all 0.3s;
    font-size: 0.9rem;
}

.sidebar-nav ul li a:hover {
    background: rgba(255,255,255,0.06);
    color: white;
}

.sidebar-nav ul li a.active {
    background: var(--primary);
    color: white;
}

.sidebar-nav ul li a i {
    width: 20px;
    text-align: center;
}

.nav-divider {
    padding: 12px 24px 6px;
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    color: rgba(255,255,255,0.3);
    font-weight: 600;
}

.badge {
    background: var(--primary);
    color: white;
    padding: 1px 8px;
    border-radius: 50px;
    font-size: 0.65rem;
    margin-left: auto;
}

/* Main Content */
.dashboard-main {
    flex: 1;
    margin-left: 260px;
    min-height: 100vh;
    background: var(--surface-2,#f5f7fa);
}

.dashboard-main.full-width {
    margin-left: 0;
}

/* Header */
.dashboard-header {
    height: 64px;
    background: var(--surface,#fff);
    border-bottom: 1px solid var(--border,#e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    position: sticky;
    top: 0;
    z-index: 100;
}

.dashboard-header .header-left {
    display: flex;
    align-items: center;
    gap: 16px;
}

.sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.3rem;
    cursor: pointer;
    color: var(--dark);
    padding: 4px 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

.sidebar-toggle:hover {
    background: var(--primary-bg);
}

.dashboard-header h1 {
    font-size: 1.1rem;
    font-weight: 600;
    margin: 0;
}

.dashboard-header .header-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.view-site-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    border-radius: 8px;
    background: var(--primary-bg);
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.85rem;
    transition: all 0.3s;
}

.view-site-btn:hover {
    background: var(--primary);
    color: white;
}

.user-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-gradient);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

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

/* Content */
.dashboard-content {
    padding: 24px;
}

.dashboard-header-section {
    margin-bottom: 30px;
}

.dashboard-header-section h1 {
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.dashboard-header-section h1 i {
    color: var(--primary);
}

.dashboard-header-section p {
    color: var(--gray);
}

/* Stats Grid */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 16px;
    margin-bottom: 30px;
}

.stat-card {
    background: var(--surface,#fff);
    padding: 20px 24px;
    border-radius: 12px;
    border: 1px solid var(--border,#e5e7eb);
    display: flex;
    align-items: center;
    gap: 16px;
    transition: all 0.3s;
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
}

.stat-icon {
    width: 48px;
    height: 48px;
    background: var(--primary-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--primary);
    font-size: 1.3rem;
}

.stat-number {
    display: block;
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.2;
}

.stat-label {
    font-size: 0.8rem;
    color: var(--gray);
}

/* Cards */
.card {
    background: var(--surface,#fff);
    border-radius: 12px;
    border: 1px solid var(--border,#e5e7eb);
    margin-bottom: 24px;
    overflow: hidden;
}

.card-header {
    padding: 16px 24px;
    border-bottom: 1px solid var(--border,#e5e7eb);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.card-header h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.card-body {
    padding: 24px;
}

/* Forms */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-weight: 500;
    margin-bottom: 6px;
}

.form-group label i {
    color: var(--primary);
    margin-right: 4px;
}

.form-control {
    width: 100%;
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 8px;
    font-size: 0.95rem;
    font-family: inherit;
    transition: border-color 0.3s, box-shadow 0.3s;
    background: var(--light);
}

.form-control:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(10, 143, 60, 0.1);
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

select.form-control {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23666' stroke-width='1.5' fill='none'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

textarea.form-control {
    resize: vertical;
    overflow-x: auto;
}

/* Tables */
.table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.9rem;
}

.table th {
    text-align: left;
    padding: 12px 16px;
    border-bottom: 2px solid var(--border,#e5e7eb);
    font-weight: 600;
    color: var(--gray);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    background: var(--light);
}

.table td {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f4f6;
}

.table tr:hover td {
    background: var(--surface-2,#f9fafb);
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    font-size: 0.85rem;
    border: none;
    cursor: pointer;
    transition: all 0.3s;
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: white;
}

.btn-primary:hover {
    background: var(--primary-dark);
}

.btn-outline {
    background: transparent;
    color: var(--gray);
    border: 1px solid var(--border,#e5e7eb);
}

.btn-outline:hover {
    border-color: var(--primary);
    color: var(--primary);
}

.btn-danger {
    background: #ef4444;
    color: white;
}

.btn-danger:hover {
    background: #dc2626;
}

.btn-sm {
    padding: 4px 12px;
    font-size: 0.75rem;
}

.btn-success {
    background: var(--success);
    color: white;
}

.btn-success:hover {
    background: var(--primary-dark);
}

/* Responsive */
@media (max-width: 992px) {
    .stats-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    .dashboard-sidebar {
        transform: translateX(-100%);
    }
    
    .dashboard-sidebar.open {
        transform: translateX(0);
    }
    
    .dashboard-main {
        margin-left: 0;
    }
    
    .sidebar-toggle {
        display: block;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .form-row {
        grid-template-columns: 1fr;
    }
    
    .dashboard-header .header-right .view-site-btn {
        display: none;
    }
    
    .user-name {
        display: none;
    }
}

@media (max-width: 480px) {
    .dashboard-content {
        padding: 16px;
    }
    
    .stat-card {
        padding: 16px 20px;
    }
    
    .table {
        font-size: 0.8rem;
    }
    
    .table th,
    .table td {
        padding: 8px 12px;
    }
}
/* ===== Posts list: status badges, tabs, pager ===== */
.status-badge { display: inline-block; padding: 3px 12px; border-radius: 50px; font-size: .72rem; font-weight: 600; text-transform: capitalize; background: #eceff1; color: #455a64; }
.status-badge.published, .status-badge.approved { background: #e3f6e8; color: #0a7a33; }
.status-badge.pending { background:var(--warn-bg,#fff3cd); color: #a86a00; }
.status-badge.draft { background: #e8eef5; color: #3d5a80; }
.status-badge.archived, .status-badge.spam { background: #f1e6e6; color: #8a3b3b; }
.post-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin: 4px 0 16px; }
.post-tabs a { padding: 7px 14px; border-radius: 50px; background: var(--surface,#fff); border: 1px solid var(--border); color: var(--gray); text-decoration: none; font-size: .85rem; display: inline-flex; gap: 8px; }
.post-tabs a span { background: var(--light); border-radius: 50px; padding: 0 8px; font-size: .75rem; }
.post-tabs a.active { background: var(--primary); border-color: var(--primary); color: #fff; }
.post-tabs a.active span { background: rgba(255,255,255,.25); }
.post-pager { display: flex; gap: 6px; justify-content: center; margin: 18px 0; }
.post-pager a { padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; text-decoration: none; color: var(--gray); background: var(--surface,#fff); }
.post-pager a.active { background: var(--primary); color: #fff; border-color: var(--primary); }


/* ===== Review fixes: never let wide content stretch the layout ===== */
.dashboard-main, .dashboard-content, .dashboard-page { min-width: 0; max-width: 100%; }
.dashboard-content table { max-width: 100%; }
.dashboard-content .card, .dashboard-content .table-responsive { overflow-x: auto; }
.page-header { flex-wrap: wrap; gap: 10px; }

/* ===== Mobile table / card layout ===== */
.dash-two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.dash-two-col > * { min-width: 0; }
.table td .actions, .table td.actions { display: flex; gap: 6px; flex-wrap: nowrap; align-items: center; }
.recent-item { min-width: 0; }
.recent-info { min-width: 0; overflow-wrap: anywhere; }
@media (max-width: 992px) { .dash-two-col { grid-template-columns: 1fr; } }
@media (max-width: 768px) {
    .dashboard-content .card-body[style*="overflow-x"], .table-responsive { overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .dashboard-content .table { min-width: 640px; }
    .dashboard-content .table th, .dashboard-content .table td { white-space: nowrap; }
    .dashboard-content .table td:first-child, .dashboard-content .table td.title-cell { white-space: normal; min-width: 200px; }
    .card-header { flex-wrap: wrap; gap: 8px; }
}

/* ===== Dashboard dark theme ===== */
[data-theme="dark"] .dashboard-main { background: var(--light); }
[data-theme="dark"] .dashboard-header, [data-theme="dark"] .dashboard-footer, [data-theme="dark"] .card, [data-theme="dark"] .stat-card { background: var(--surface); border-color: var(--border); color: var(--text); }
[data-theme="dark"] .dashboard-sidebar { background: #0A100A; border-right: 1px solid var(--border); }
[data-theme="dark"] .stat-icon { background: var(--primary-bg); color: var(--primary); }
[data-theme="dark"] .table th { background: var(--surface-3); color: var(--text-muted); border-color: var(--border); }
[data-theme="dark"] .table td { border-color: var(--border); color: var(--text); }
[data-theme="dark"] .table tr:hover td { background: var(--surface-3); }
[data-theme="dark"] .form-control, [data-theme="dark"] .dashboard-content input, [data-theme="dark"] .dashboard-content select, [data-theme="dark"] .dashboard-content textarea { background: var(--input-bg); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(76,175,80,.25); }
[data-theme="dark"] .form-group label, [data-theme="dark"] .card-header h3, [data-theme="dark"] .page-header h1, [data-theme="dark"] .stat-number { color: var(--text); }
[data-theme="dark"] .recent-item { border-color: var(--border); }
[data-theme="dark"] .status-badge { background: #1e2a3a; color: #9db4d1; }
[data-theme="dark"] .status-badge.published, [data-theme="dark"] .status-badge.approved { background: var(--ok-bg, #12301c); color: var(--ok-fg, #7ee2a0); }
[data-theme="dark"] .status-badge.pending { background: var(--warn-bg, #33270a); color: var(--warn-fg, #ffc966); }
[data-theme="dark"] .status-badge.draft { background: #1b2a3f; color: #8fb4e8; }
[data-theme="dark"] .status-badge.archived, [data-theme="dark"] .status-badge.spam { background: #3a1f1f; color: #f0a3a3; }
[data-theme="dark"] .post-tabs a, [data-theme="dark"] .post-pager a, [data-theme="dark"] .view-site-btn, [data-theme="dark"] .btn-outline, [data-theme="dark"] .btn-sm:not(.btn-danger):not(.btn-primary) { background: var(--surface); color: var(--text); border-color: var(--border); }
[data-theme="dark"] .post-tabs a.active, [data-theme="dark"] .post-pager a.active { background: var(--primary); color: #fff; }
[data-theme="dark"] .post-tabs a span { background: var(--surface-3); }
[data-theme="dark"] .dashboard-footer, [data-theme="dark"] .footer-version { color: var(--text-muted); }
.dash-theme-btn { background: transparent; border: 1px solid var(--border); border-radius: 50%; width: 38px; height: 38px; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; color: var(--text, inherit); }
.dash-theme-btn:hover { background: var(--primary-bg); border-color: var(--primary); }
[data-theme="dark"] .btn-primary, [data-theme="dark"] .sidebar-nav ul li a.active, [data-theme="dark"] .badge { background: #0A8F3C; color: #fff; }
[data-theme="dark"] .sidebar-nav ul li a:hover { background: rgba(255,255,255,.06); }
[data-theme="dark"] .pe-dd-btn, [data-theme="dark"] .post-tabs a.active, [data-theme="dark"] .post-content a.btn-link { background: #0A8F3C !important; color: #fff !important; }
[data-theme="dark"] .post-content th { background: #0f5a2a; color: #fff; }

/* ===== Legal consent checkbox ===== */
.consent-check{display:flex;align-items:flex-start;gap:10px;margin:14px 0 18px;font-size:.86rem;line-height:1.5;color:var(--text-muted,#5a6b5a);font-weight:400;cursor:pointer;text-align:left}
.consent-check input[type=checkbox]{flex:0 0 auto;width:18px;height:18px;margin-top:2px;accent-color:var(--primary,#0A8F3C);cursor:pointer}
.consent-check a{color:var(--primary,#0A8F3C);font-weight:600;text-decoration:underline;text-underline-offset:2px}
.consent-check:has(input:focus-visible){outline:2px solid var(--primary,#0A8F3C);outline-offset:3px;border-radius:6px}
.newsletter-form{flex-wrap:wrap}
.newsletter-form .consent-check{flex:1 0 100%;margin:6px 0 0}
@media (max-width:480px){.consent-check{font-size:.82rem}}

/* ===== Form controls inherit the page font (browsers default to Arial/monospace) ===== */
input,select,textarea,button{font-family:inherit}
textarea{line-height:1.5}
