/* Base */
* {
    box-sizing: border-box;
}

html, body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    height: 100%;
}

/* Admin Layout */
.admin-layout {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Dark Theme - Override Syncfusion */
.sidebar-dark,
.sidebar-dark.e-sidebar,
.e-sidebar.sidebar-dark,
.e-sidebar.e-left.sidebar-dark,
div.sidebar-dark.e-sidebar {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%) !important;
    box-shadow: 4px 0 20px rgba(102, 126, 234, 0.3) !important;
    border: none !important;
}

/* Syncfusion Sidebar fixes */
.e-sidebar {
    z-index: 1000 !important;
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%) !important;
}

.e-sidebar.e-dock.e-close .logo-text,
.e-sidebar.e-dock.e-close .nav-link span {
    display: none !important;
}

.e-sidebar.e-dock.e-close .logo-container {
    justify-content: center;
}

.e-sidebar.e-dock.e-close .nav-link {
    justify-content: center;
    padding: 12px;
}

.e-sidebar.e-dock.e-close .nav-link i {
    margin: 0;
}

.sidebar-header {
    padding: 20px;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.logo-container {
    display: flex;
    align-items: center;
    gap: 12px;
}

.logo-icon {
    font-size: 28px;
    color: #e94560;
}

.logo-text {
    font-size: 16px;
    font-weight: 600;
    color: #fff;
    white-space: nowrap;
    letter-spacing: -0.3px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.2);
}

/* Sidebar Navigation */
.sidebar-nav {
    padding: 15px 0;
}

.nav-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.nav-item {
    margin: 4px 10px;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px;
    color: #fff !important;
    text-decoration: none !important;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-weight: 500;
}

.nav-link:hover {
    background: rgba(255,255,255,0.25) !important;
    color: #fff !important;
    transform: translateX(4px);
}

.nav-link.active {
    background: rgba(255,255,255,0.3) !important;
    color: #fff !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-left: 3px solid #fff;
}

.nav-link i {
    font-size: 18px;
    width: 24px;
    text-align: center;
}

.nav-link span {
    font-size: 14px;
    font-weight: 500;
}

.nav-divider {
    height: 1px;
    background: rgba(255,255,255,0.1);
    margin: 15px 10px;
}

/* Main Content */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 25px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.menu-toggle {
    background: none;
    border: none;
    font-size: 20px;
    color: #333;
    cursor: pointer;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.3s;
}

.menu-toggle:hover {
    background: #f0f0f0;
}

.page-title {
    font-size: 22px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

.header-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.admin-name {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    color: #666;
}

.admin-name i {
    font-size: 24px;
    color: #e94560;
}

/* Content Area */
.content-area {
    flex: 1;
    padding: 25px;
    overflow-y: auto;
}

/* Cards */
.admin-card {
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    padding: 25px;
    margin-bottom: 20px;
}

.admin-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.admin-card-title {
    font-size: 18px;
    font-weight: 600;
    color: #1a1a2e;
    margin: 0;
}

/* Stats Cards */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
}

.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    display: flex;
    align-items: center;
    gap: 15px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.stat-icon {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
}

.stat-icon.negocios { background: rgba(233, 69, 96, 0.1); color: #e94560; }
.stat-icon.categorias { background: rgba(15, 52, 96, 0.1); color: #0f3460; }
.stat-icon.anuncios { background: rgba(76, 175, 80, 0.1); color: #4caf50; }
.stat-icon.visitas { background: rgba(156, 39, 176, 0.1); color: #9c27b0; }

.stat-info h3 {
    font-size: 24px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0;
}

.stat-info p {
    font-size: 13px;
    color: #666;
    margin: 5px 0 0 0;
}

/* Syncfusion Grid Customization */
.e-grid {
    border-radius: 8px;
    overflow: hidden;
}

.e-grid .e-headercell {
    background: #f8f9fa !important;
    font-weight: 600;
}

/* Buttons */
.btn-primary-admin {
    background: linear-gradient(135deg, #e94560 0%, #0f3460 100%);
    border: none;
    color: #fff;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-primary-admin:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(233, 69, 96, 0.3);
}

/* Blazor Error UI */
#blazor-error-ui {
    background: #b32121;
    color: #fff;
    padding: 1rem;
    position: fixed;
    bottom: 0;
    width: 100%;
    display: none;
    z-index: 1000;
}

#blazor-error-ui .dismiss {
    cursor: pointer;
    float: right;
}

/* Image Preview */
.img-preview {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 8px;
}

/* Status Badge */
.badge-activo {
    background: #4caf50;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.badge-inactivo {
    background: #f44336;
    color: #fff;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

/* Responsive */
@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }

    .content-area {
        padding: 15px;
    }
}
