/* ============================================================
   DASHBOARD STYLES
   ============================================================ */

/* === LAYOUT === */
.dash-wrapper { display: flex; min-height: calc(100vh - var(--header-h)); }

.dash-sidebar {
    width: var(--sidebar-w); background: var(--white);
    border-right: 1px solid var(--gray-200);
    position: fixed; top: var(--header-h); bottom: 0; left: 0;
    overflow-y: auto; z-index: 80;
    transition: transform 0.3s ease;
}
.dash-sidebar.collapsed { transform: translateX(-100%); }

.dash-content {
    flex: 1; margin-left: var(--sidebar-w);
    padding: 1.5rem; min-width: 0;
    transition: margin 0.3s ease;
}
.dash-sidebar.collapsed + .dash-content { margin-left: 0; }

/* === SIDEBAR - ACCORDION MENU (CSS3 puro) === */
.dash-nav { padding: 0.5rem 0; }
.dash-nav-section {
    padding: 0.5rem 1.25rem 0.25rem;
    font-size: 0.6875rem; font-weight: 600;
    text-transform: uppercase; letter-spacing: 0.08em;
    color: var(--gray-400);
}

.dash-nav-item { position: relative; }
.dash-nav-item > a {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 1.25rem; color: var(--gray-600);
    font-size: 0.875rem; font-weight: 500;
    transition: var(--transition);
    border-left: 3px solid transparent;
}
.dash-nav-item > a:hover {
    background: var(--gray-50); color: var(--primary);
}
.dash-nav-item > a.active {
    background: var(--primary-light); color: var(--primary);
    border-left-color: var(--primary); font-weight: 600;
}
.dash-nav-item > a i { width: 1.25rem; text-align: center; font-size: 0.9rem; }
.dash-nav-item > a .nav-label { flex: 1; }
.dash-nav-item > a .nav-arrow {
    font-size: 0.7rem; transition: transform 0.2s ease;
    color: var(--gray-400);
}

/* Accordion: puro CSS usando checkbox oculto */
.dash-nav-item input[type="checkbox"] {
    display: none;
}
.dash-nav-item input[type="checkbox"]:checked ~ .dash-subnav {
    max-height: 500px; opacity: 1;
}
.dash-nav-item input[type="checkbox"]:checked ~ a .nav-arrow {
    transform: rotate(90deg);
}

.dash-subnav {
    max-height: 0; overflow: hidden; opacity: 0;
    transition: max-height 0.3s ease, opacity 0.2s ease;
    background: var(--gray-50);
}
.dash-subnav a {
    display: flex; align-items: center; gap: 0.625rem;
    padding: 0.5rem 1.25rem 0.5rem 3.25rem;
    color: var(--gray-500); font-size: 0.8125rem;
    transition: var(--transition);
}
.dash-subnav a:hover { color: var(--primary); }
.dash-subnav a.active { color: var(--primary); font-weight: 600; }
.dash-subnav a i { width: 1rem; text-align: center; font-size: 0.75rem; }

/* === DASHBOARD HEADER === */
.dash-page-header {
    display: flex; align-items: center; justify-content: space-between;
    margin-bottom: 1.5rem; flex-wrap: wrap; gap: 1rem;
}
.dash-page-header h1 { font-size: 1.5rem; }
.dash-breadcrumb {
    display: flex; align-items: center; gap: 0.375rem;
    font-size: 0.8125rem; color: var(--gray-400);
}
.dash-breadcrumb a { color: var(--gray-500); }
.dash-breadcrumb a:hover { color: var(--primary); }

/* === STAT GRID === */
.stats-grid {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 1rem; margin-bottom: 1.5rem;
}

/* === CHART CONTAINER === */
.chart-container {
    background: var(--white); border-radius: var(--radius-lg);
    padding: 1.25rem; box-shadow: var(--shadow);
    border: 1px solid var(--gray-100); margin-bottom: 1.5rem;
}
.chart-container h3 { font-size: 1rem; margin-bottom: 1rem; }
.chart-container canvas { width: 100% !important; max-height: 300px; }

/* === PENDING ADS LIST === */
.pending-list { margin-bottom: 1.5rem; }
.pending-item {
    display: flex; align-items: center; justify-content: space-between;
    padding: 0.75rem 0; border-bottom: 1px solid var(--gray-100);
    gap: 1rem;
}
.pending-item:last-child { border-bottom: none; }
.pending-info { flex: 1; min-width: 0; }
.pending-title { font-weight: 500; color: var(--gray-800); font-size: 0.875rem; }
.pending-meta { font-size: 0.75rem; color: var(--gray-400); margin-top: 0.125rem; }
.pending-actions { display: flex; gap: 0.375rem; flex-shrink: 0; }

/* === CATEGORY TREE (Drag & Drop) === */
.category-tree { padding: 0.5rem 0; }
.tree-item {
    background: var(--white); border: 1px solid var(--gray-200);
    border-radius: var(--radius); margin-bottom: 0.5rem;
    transition: var(--transition);
}
.tree-item.dragging { opacity: 0.5; box-shadow: var(--shadow-lg); }
.tree-item.drag-over { border-color: var(--primary); background: var(--primary-light); }

.tree-item-content {
    display: flex; align-items: center; gap: 0.75rem;
    padding: 0.625rem 0.875rem;
}
.tree-drag-handle {
    cursor: grab; color: var(--gray-400);
    display: flex; align-items: center;
    padding: 0.25rem;
}
.tree-drag-handle:active { cursor: grabbing; }
.tree-item-icon { color: var(--gray-500); width: 1.25rem; text-align: center; }
.tree-item-name { flex: 1; font-size: 0.875rem; font-weight: 500; }
.tree-item-actions { display: flex; gap: 0.25rem; }
.tree-children {
    padding-left: 1.5rem; margin: 0 0.5rem 0.5rem;
    border-left: 2px solid var(--gray-200);
}

/* === WYSIWYG MINIMAL === */
.wysiwyg-toolbar {
    display: flex; align-items: center; flex-wrap: wrap; gap: 0.125rem;
    padding: 0.5rem; background: var(--gray-50);
    border: 1px solid var(--gray-300); border-bottom: none;
    border-radius: var(--radius) var(--radius) 0 0;
}
.wysiwyg-toolbar button {
    width: 32px; height: 32px; border-radius: var(--radius-sm);
    background: none; color: var(--gray-600); cursor: pointer;
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition); font-size: 0.8125rem;
}
.wysiwyg-toolbar button:hover { background: var(--gray-200); }
.wysiwyg-toolbar button.active { background: var(--primary-light); color: var(--primary); }
.wysiwyg-toolbar .separator {
    width: 1px; height: 1.25rem; background: var(--gray-300); margin: 0 0.25rem;
}
.wysiwyg-editor {
    min-height: 200px; padding: 0.875rem;
    border: 1px solid var(--gray-300); border-radius: 0 0 var(--radius) var(--radius);
    background: var(--white); outline: none;
    font-size: 0.9375rem; line-height: 1.6;
}
.wysiwyg-editor:focus { border-color: var(--primary); }

/* === RESPONSIVE DASHBOARD === */
@media (max-width: 1024px) {
    .dash-sidebar {
        transform: translateX(-100%);
        z-index: 200;
        box-shadow: var(--shadow-xl);
    }
    .dash-sidebar.open { transform: translateX(0); }
    .dash-content { margin-left: 0; }
    .stats-grid { grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}

@media (max-width: 768px) {
    .dash-content { padding: 1rem; }
    .dash-page-header h1 { font-size: 1.25rem; }
    .stats-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 480px) {
    .stats-grid { grid-template-columns: 1fr; }
    .pending-item { flex-direction: column; align-items: flex-start; }
    .pending-actions { width: 100%; justify-content: flex-end; }
}
