:root {
    --sidebar-width: 272px;
    --header-height: 64px;
    --footer-height: 52px;

    --sidebar-bg: #0f172a;
    --sidebar-border: rgba(255, 255, 255, 0.08);
    --sidebar-text: #cbd5e1;
    --sidebar-text-hover: #e2e8f0;
    --sidebar-active-bg: rgba(255, 255, 255, 0.08);
    --sidebar-active-text: #ffffff;
    --sidebar-active-indicator: #3b82f6;

    --header-bg: #ffffff;
    --content-bg: #f1f5f9;
    --card-bg: #ffffff;
    --border-color: #e2e8f0;

    --primary: #3b82f6;
    --primary-dark: #2563eb;

    --text-900: #0f172a;
    --text-800: #1e293b;
    --text-700: #334155;
    --text-600: #475569;
    --text-500: #64748b;
    --text-400: #94a3b8;
}


.panel-layout {
    display: flex;
    min-height: 100vh;
    background: var(--content-bg);
}


.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: var(--sidebar-width);
    height: 100vh;
    background: var(--sidebar-bg);
    display: flex;
    flex-direction: column;
    z-index: 1000;
    transition: transform 0.3s ease;
}

.sidebar-header {
    padding: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--sidebar-border);
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
}

.sidebar-logo {
    height: 36px;
    width: auto;
    border-radius: 8px;
}

.sidebar-brand-text {
    font-size: 1.0625rem;
    font-weight: 700;
    color: #ffffff;
}

.sidebar-close {
    width: 32px;
    height: 32px;
    border: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--sidebar-text);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
}

.sidebar-close:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 0.875rem;
}

.sidebar-section {
    margin-bottom: 1.75rem;
}

.sidebar-section:last-child {
    margin-bottom: 0;
}

.sidebar-section-title {
    padding: 0 0.75rem 0.625rem;
    font-size: 0.6875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
}

.sidebar-menu {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-item {
    margin-bottom: 2px;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.6875rem 0.875rem;
    border-radius: 8px;
    color: var(--sidebar-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 500;
    transition: color 0.15s, background 0.15s;
    position: relative;
}

.sidebar-link:hover {
    color: var(--sidebar-text-hover);
    background: rgba(255, 255, 255, 0.04);
    text-decoration: none;
}

.sidebar-link.active {
    color: var(--sidebar-active-text);
    background: var(--sidebar-active-bg);
}

.sidebar-link.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 20px;
    background: var(--sidebar-active-indicator);
    border-radius: 0 3px 3px 0;
}

.sidebar-icon {
    width: 20px;
    font-size: 0.9375rem;
    text-align: center;
    opacity: 0.65;
}

.sidebar-link:hover .sidebar-icon,
.sidebar-link.active .sidebar-icon {
    opacity: 1;
}

.sidebar-text {
    white-space: nowrap;
}

.sidebar-badge {
    margin-left: auto;
    padding: 0.125rem 0.4375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    background: var(--primary);
    color: #fff;
    border-radius: 8px;
}


.sidebar-user {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    margin: 0 0.875rem 1rem;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 10px;
}


.sidebar-user-avatar {
    width: 42px;
    height: 42px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 10px;
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}



.sidebar-user-name {
    font-size: 0.875rem;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}


.sidebar-footer {
    padding: 0.75rem 0.875rem;
    border-top: 1px solid var(--sidebar-border);
}

.sidebar-footer .sidebar-link {
    padding: 0.5rem 0.875rem;
    font-size: 0.8125rem;
}

.sidebar-footer .sidebar-link.text-danger {
    color: #f87171;
}

.sidebar-footer .sidebar-link.text-danger:hover {
    background: rgba(248, 113, 113, 0.1);
    color: #fca5a5;
}

.sidebar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(4px);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.sidebar-overlay.active {
    opacity: 1;
    visibility: visible;
}

.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    position: sticky;
    top: 0;
    height: var(--header-height);
    background: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    z-index: 100;
}

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

.menu-toggle {
    width: 40px;
    height: 40px;
    border: none;
    background: var(--content-bg);
    border-radius: 10px;
    color: var(--text-700);
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    transition: background 0.2s, color 0.2s;
}

.menu-toggle:hover {
    background: var(--border-color);
}

.header-search {
    position: relative;
    width: 300px;
}

.header-search i {
    position: absolute;
    left: 0.875rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-400);
    font-size: 0.875rem;
    pointer-events: none;
}

.search-input {
    width: 100%;
    height: 40px;
    padding: 0 1rem 0 2.5rem;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    background: var(--content-bg);
    font-size: 0.875rem;
    color: var(--text-800);
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
}

.search-input::placeholder {
    color: var(--text-400);
}

.search-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
    background: #fff;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 0.375rem;
}

.header-icon-btn {
    position: relative;
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    border-radius: 10px;
    color: var(--text-600);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.0625rem;
    transition: background 0.2s, color 0.2s;
}

.header-icon-btn:hover {
    background: var(--content-bg);
    color: var(--text-800);
}

.notification-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    background: #ef4444;
    color: #fff;
    font-size: 0.625rem;
    font-weight: 700;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-divider {
    width: 1px;
    height: 24px;
    background: var(--border-color);
    margin: 0 0.625rem;
}

.user-dropdown {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.3rem;
    padding-right: 0.625rem;
    border: 1px solid var(--border-color);
    background: #fff;
    border-radius: 10px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.user-dropdown:hover {
    background: var(--content-bg);
}

.user-avatar {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    border-radius: 8px;
    color: #fff;
    font-size: 0.8125rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    line-height: 1.2;
}

.user-name {
    font-size: 0.8125rem;
    font-weight: 600;
    color: var(--text-900);
}

.user-role {
    font-size: 0.6875rem;
    color: var(--text-500);
}

.user-chevron {
    font-size: 0.625rem;
    color: var(--text-400);
}

.dropdown-menu {
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.08);
    padding: 0.375rem;
    min-width: 180px;
    margin-top: 0.375rem;
}

.dropdown-item {
    padding: 0.5rem 0.75rem;
    border-radius: 6px;
    font-size: 0.8125rem;
    color: var(--text-700);
    transition: background 0.15s;
}

.dropdown-item:hover {
    background: var(--content-bg);
}

.dropdown-item.text-danger:hover {
    background: #fef2f2;
    color: #dc2626;
}

.dropdown-divider {
    margin: 0.375rem 0;
    border-color: var(--border-color);
}

.main-content {
    flex: 1;
    padding: 1.5rem;
}

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

.page-header-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.page-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-900);
    margin: 0 0 0.25rem;
    letter-spacing: -0.01em;
}

.page-subtitle {
    font-size: 0.875rem;
    color: var(--text-500);
    margin: 0;
}

.page-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.main-footer {
    height: var(--footer-height);
    padding: 0 1.5rem;
    background: #fff;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.8125rem;
    color: var(--text-500);
}

.footer-right {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.footer-right a {
    color: var(--text-500);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-right a:hover {
    color: var(--primary);
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.stat-card-new {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.25rem;
    position: relative;
}

.stat-card-new::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.stat-card-new.stat-primary::before {
    background: var(--primary);
}

.stat-card-new.stat-success::before {
    background: #10b981;
}

.stat-card-new.stat-warning::before {
    background: #f59e0b;
}

.stat-card-new.stat-info::before {
    background: #06b6d4;
}

.stat-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.875rem;
}

.stat-card-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.stat-primary .stat-card-icon {
    background: #eff6ff;
    color: var(--primary);
}

.stat-success .stat-card-icon {
    background: #ecfdf5;
    color: #10b981;
}

.stat-warning .stat-card-icon {
    background: #fffbeb;
    color: #f59e0b;
}

.stat-info .stat-card-icon {
    background: #ecfeff;
    color: #06b6d4;
}

.stat-card-label {
    font-size: 0.75rem;
    font-weight: 500;
    color: var(--text-500);
    margin-bottom: 0.25rem;
}

.stat-card-value {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--text-900);
    line-height: 1.1;
    margin-bottom: 0.125rem;
}

.stat-card-desc {
    font-size: 0.75rem;
    color: var(--text-500);
}

.stat-card-trend {
    display: inline-flex;
    align-items: center;
    gap: 0.1875rem;
    padding: 0.1875rem 0.4375rem;
    border-radius: 6px;
    font-size: 0.6875rem;
    font-weight: 600;
}

.stat-card-trend.up {
    background: #ecfdf5;
    color: #059669;
}

.stat-card-trend.down {
    background: #fef2f2;
    color: #dc2626;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    gap: 1rem;
}

.grid-col-8 {
    grid-column: span 8;
}

.grid-col-6 {
    grid-column: span 6;
}

.grid-col-4 {
    grid-column: span 4;
}

.grid-col-12 {
    grid-column: span 12;
}

.dashboard-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
}

.dashboard-card-header {
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.dashboard-card-title {
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--text-900);
    margin: 0;
}

.dashboard-card-body {
    padding: 1.25rem;
}

.chart-wrap {
    position: relative;
    width: 100%;
}

.chart-wrap canvas {
    width: 100% !important;
    height: 100% !important;
}

.btn {
    font-weight: 600;
    font-size: 0.8125rem;
    padding: 0.5rem 0.875rem;
    border-radius: 8px;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--primary-dark);
    border-color: var(--primary-dark);
    color: #fff;
}

.btn-outline-primary {
    background: transparent;
    border-color: var(--border-color);
    color: var(--text-700);
}

.btn-outline-primary:hover {
    background: var(--content-bg);
    color: var(--text-800);
}

.btn-sm {
    padding: 0.375rem 0.625rem;
    font-size: 0.75rem;
}

.btn-group-sm .btn.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.review-summary-header {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.review-score {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-900);
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.review-item-new {
    display: flex;
    gap: 0.75rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid var(--border-color);
}

.review-item-new:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.review-avatar {
    width: 36px;
    height: 36px;
    background: var(--content-bg);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-600);
    flex-shrink: 0;
}

.review-content {
    flex: 1;
    min-width: 0;
}

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

.review-user {
    font-weight: 600;
    font-size: 0.8125rem;
    color: var(--text-900);
}

.review-stars-sm {
    color: #fbbf24;
    font-size: 0.6875rem;
}

.review-text {
    margin: 0;
    font-size: 0.8125rem;
    color: var(--text-600);
    line-height: 1.5;
}

.sidebar-nav::-webkit-scrollbar {
    width: 4px;
}

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

.sidebar-nav::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.1);
    border-radius: 4px;
}

@media (max-width: 1280px) {
    .stats-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .grid-col-8 {
        grid-column: span 12;
    }

    .grid-col-4 {
        grid-column: span 12;
    }
}

@media (max-width: 992px) {
    .sidebar {
        transform: translateX(-100%);
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .sidebar-close {
        display: flex;
    }

    .main-wrapper {
        margin-left: 0;
    }

    .menu-toggle {
        display: flex;
    }

    .header-search {
        width: 220px;
    }

    .grid-col-6 {
        grid-column: span 12;
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .main-content {
        padding: 1rem;
    }

    .top-header {
        padding: 0 1rem;
    }

    .page-header-top {
        flex-direction: column;
        align-items: stretch;
    }

    .page-actions {
        flex-wrap: wrap;
    }

    .main-footer {
        flex-direction: column;
        height: auto;
        padding: 0.875rem;
        gap: 0.375rem;
        text-align: center;
    }
}

@media (max-width: 576px) {
    .header-search {
        display: none !important;
    }

    .page-title {
        font-size: 1.25rem;
    }

    .stat-card-value {
        font-size: 1.375rem;
    }

    .user-info,
    .user-chevron {
        display: none !important;
    }

    .user-dropdown {
        padding: 0.25rem;
    }
}