/* ============================================
   CMS Admin - Sidebar Layout
   ============================================ */

:root {
    --cms-sidebar-width: 260px;
    --cms-sidebar-bg: #212529;
    --cms-sidebar-color: #adb5bd;
    --cms-sidebar-active-bg: #0d6efd;
    --cms-sidebar-active-color: #ffffff;
    --cms-sidebar-hover-bg: rgba(255, 255, 255, 0.08);
    --cms-sidebar-border: rgba(255, 255, 255, 0.1);
    --cms-topbar-height: 56px;
    --cms-content-bg: #f8f9fa;
}

/* Reset */
body.cms-admin-body {
    margin: 0;
    padding: 0;
    background-color: var(--cms-content-bg);
    min-height: 100vh;
}

/* Wrapper */
.cms-admin-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ============================================
   Sidebar
   ============================================ */
.cms-sidebar {
    width: var(--cms-sidebar-width);
    min-height: 100vh;
    background-color: var(--cms-sidebar-bg);
    color: var(--cms-sidebar-color);
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    z-index: 1040;
    overflow-y: auto;
    overflow-x: hidden;
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
}

/* Sidebar Brand / Logo */
.cms-sidebar-brand {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--cms-sidebar-border);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: #ffffff;
    font-size: 1.1rem;
    font-weight: 600;
    flex-shrink: 0;
}

.cms-sidebar-brand:hover {
    color: #ffffff;
    text-decoration: none;
}

.cms-sidebar-brand img {
    width: 32px;
    height: 32px;
    object-fit: contain;
    border-radius: 4px;
}

.cms-sidebar-brand .bi {
    font-size: 1.4rem;
}

/* Sidebar Navigation */
.cms-sidebar-nav {
    flex: 1;
    padding: 0.5rem 0;
    overflow-y: auto;
}

.cms-sidebar-section {
    padding: 0.5rem 0 0.25rem 0;
}

.cms-sidebar-heading {
    padding: 0.5rem 1.25rem 0.25rem;
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255, 255, 255, 0.35);
}

.cms-sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1.25rem;
    color: var(--cms-sidebar-color);
    text-decoration: none;
    font-size: 0.875rem;
    transition: background-color 0.15s ease, color 0.15s ease;
    border-left: 3px solid transparent;
}

.cms-sidebar-link:hover {
    background-color: var(--cms-sidebar-hover-bg);
    color: #ffffff;
    text-decoration: none;
}

.cms-sidebar-link.active {
    background-color: rgba(13, 110, 253, 0.15);
    color: var(--cms-sidebar-active-color);
    border-left-color: var(--cms-sidebar-active-bg);
}

.cms-sidebar-link .bi {
    font-size: 1.1rem;
    width: 1.25rem;
    text-align: center;
    flex-shrink: 0;
}

.cms-sidebar-divider {
    border-top: 1px solid var(--cms-sidebar-border);
    margin: 0.5rem 1rem;
}

/* Sidebar Footer */
.cms-sidebar-footer {
    padding: 0.5rem 0;
    border-top: 1px solid var(--cms-sidebar-border);
    flex-shrink: 0;
}

/* ============================================
   Main Content Area
   ============================================ */
.cms-admin-main {
    flex: 1;
    margin-left: var(--cms-sidebar-width);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ============================================
   Top Bar
   ============================================ */
.cms-topbar {
    height: var(--cms-topbar-height);
    background-color: #ffffff;
    border-bottom: 1px solid #dee2e6;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.cms-topbar-left {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cms-topbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.cms-topbar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #212529;
    margin: 0;
}

.cms-sidebar-toggle {
    display: none;
    background: none;
    border: none;
    font-size: 1.25rem;
    color: #212529;
    cursor: pointer;
    padding: 0.25rem;
}

/* ============================================
   Content Area
   ============================================ */
.cms-content {
    flex: 1;
    padding: 1.5rem;
}

/* ============================================
   Breadcrumb
   ============================================ */
.cms-breadcrumb {
    padding: 0.75rem 1.5rem;
    background-color: transparent;
    margin: 0;
}

.cms-breadcrumb .breadcrumb {
    margin: 0;
    font-size: 0.875rem;
}

/* ============================================
   Dashboard Cards
   ============================================ */
.cms-stat-card {
    background: #ffffff;
    border-radius: 0.5rem;
    padding: 1.25rem;
    border: 1px solid #dee2e6;
    transition: box-shadow 0.15s ease;
}

.cms-stat-card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.cms-stat-card .stat-icon {
    width: 48px;
    height: 48px;
    border-radius: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
}

.cms-stat-card .stat-value {
    font-size: 1.75rem;
    font-weight: 700;
    color: #212529;
    line-height: 1;
}

.cms-stat-card .stat-label {
    font-size: 0.8rem;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Quick Actions */
.cms-quick-action {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    background: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 0.5rem;
    color: #212529;
    text-decoration: none;
    transition: all 0.15s ease;
}

.cms-quick-action:hover {
    border-color: #0d6efd;
    color: #0d6efd;
    text-decoration: none;
    box-shadow: 0 2px 4px rgba(13, 110, 253, 0.1);
}

.cms-quick-action .bi {
    font-size: 1.25rem;
}

/* Recent Pages Table */
.cms-recent-table {
    background: #ffffff;
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    overflow: hidden;
}

.cms-recent-table .table {
    margin: 0;
}

.cms-recent-table .table th {
    background-color: #f8f9fa;
    border-bottom: 2px solid #dee2e6;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #6c757d;
    padding: 0.75rem 1rem;
}

.cms-recent-table .table td {
    padding: 0.75rem 1rem;
    vertical-align: middle;
    font-size: 0.875rem;
}

/* Status Badges */
.cms-badge-published {
    background-color: #198754;
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

.cms-badge-draft {
    background-color: #6c757d;
    color: #ffffff;
    font-size: 0.75rem;
    padding: 0.25rem 0.5rem;
    border-radius: 0.25rem;
}

/* ============================================
   Messages / Alerts
   ============================================ */
.cms-messages {
    padding: 0.75rem 1.5rem 0;
}

.cms-messages .alert {
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
}

/* ============================================
   Responsive: Mobile Sidebar
   ============================================ */
@media (max-width: 991.98px) {
    .cms-sidebar {
        transform: translateX(-100%);
    }

    .cms-sidebar.show {
        transform: translateX(0);
    }

    .cms-admin-main {
        margin-left: 0;
    }

    .cms-sidebar-toggle {
        display: block;
    }

    /* Overlay when sidebar is open */
    .cms-sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1035;
    }

    .cms-sidebar-overlay.show {
        display: block;
    }
}

/* ============================================
   Scrollbar Styling (Sidebar)
   ============================================ */
.cms-sidebar::-webkit-scrollbar {
    width: 4px;
}

.cms-sidebar::-webkit-scrollbar-track {
    background: transparent;
}

.cms-sidebar::-webkit-scrollbar-thumb {
    background-color: rgba(255, 255, 255, 0.2);
    border-radius: 2px;
}

.cms-sidebar::-webkit-scrollbar-thumb:hover {
    background-color: rgba(255, 255, 255, 0.3);
}
