/**
 * Mind Tools - Estilos del Dashboard
 * Diseño inspirado en Tasks by WordBI
 */

:root {
    --color-header: #1a1a1a;
    --color-sidebar: #ffffff;
    --color-main: #f8f9fa;
    --color-card: #ffffff;
    --color-primary: #2563eb;
    --color-primary-light: #eff6ff;
    --color-success: #22c55e;
    --color-warning: #eab308;
    --color-danger: #ef4444;
    --color-text: #1f2937;
    --color-text-muted: #6b7280;
    --shadow-card: 0 1px 3px rgba(0,0,0,0.08);
    --shadow-card-hover: 0 4px 12px rgba(0,0,0,0.1);
    --sidebar-width: 260px;
    --header-height: 56px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    font-size: 14px;
    color: var(--color-text);
    background: var(--color-main);
    line-height: 1.5;
    min-height: 100vh;
}

/* Header */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: var(--header-height);
    background: var(--color-header);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 24px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.1);
}

.header-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    color: white;
    font-weight: 600;
}

.header-logo-img {
    height: 36px;
    width: auto;
    display: block;
}

.header-logo-icon {
    width: 32px;
    height: 32px;
    background: var(--color-primary);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}

.header-nav {
    display: flex;
    gap: 8px;
}

.header-nav a {
    color: rgba(255,255,255,0.9);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-nav a:hover {
    background: rgba(255,255,255,0.1);
}

.header-nav a.active {
    background: rgba(255,255,255,0.15);
}

.header-user {
    display: flex;
    align-items: center;
    gap: 10px;
}

.header-avatar {
    width: 36px;
    height: 36px;
    background: #4b5563;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 12px;
}

/* Layout principal */
.layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
}

/* Sidebar */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar);
    border-right: 1px solid #e5e7eb;
    overflow-y: auto;
    flex-shrink: 0;
}

.sidebar-section {
    padding: 20px 0;
    border-bottom: 1px solid #e5e7eb;
}

.sidebar-section:last-child {
    border-bottom: none;
}

.sidebar-title {
    font-size: 11px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 0 20px 12px;
}

.sidebar-nav a {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 20px;
    color: var(--color-text);
    text-decoration: none;
    transition: background 0.2s;
}

.sidebar-nav a:hover {
    background: var(--color-primary-light);
    color: var(--color-primary);
}

.sidebar-nav a.active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 500;
}

.sidebar-nav .icon {
    width: 20px;
    height: 20px;
    opacity: 0.8;
}

/* Contenido principal */
.main-content {
    flex: 1;
    padding: 24px;
    overflow-y: auto;
}

.page-header {
    margin-bottom: 24px;
}

.page-title {
    display: flex;
    align-items: center;
    gap: 16px;
    margin-bottom: 8px;
}

.page-title-icon {
    width: 48px;
    height: 48px;
    background: var(--color-primary-light);
    color: var(--color-primary);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.page-title h1 {
    font-size: 24px;
    font-weight: 700;
    color: var(--color-text);
}

.page-subtitle {
    color: var(--color-text-muted);
    font-size: 14px;
    margin-left: 64px;
}

/* Tarjetas de estadísticas */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 32px;
}

.stat-card {
    background: var(--color-card);
    border-radius: 12px;
    padding: 20px;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-card);
    transition: box-shadow 0.2s;
}

.stat-card:hover {
    box-shadow: var(--shadow-card-hover);
}

.stat-card.blue { border-left: 4px solid var(--color-primary); }
.stat-card.green { border-left: 4px solid var(--color-success); }
.stat-card.yellow { border-left: 4px solid var(--color-warning); }
.stat-card.red { border-left: 4px solid var(--color-danger); }

.stat-card-value {
    font-size: 28px;
    font-weight: 700;
    color: var(--color-text);
}

.stat-card-label {
    font-size: 13px;
    color: var(--color-text-muted);
    margin-top: 4px;
}

/* Tarjetas de contenido */
.content-card {
    background: var(--color-card);
    border-radius: 12px;
    padding: 24px;
    border: 1px solid #e5e7eb;
    box-shadow: var(--shadow-card);
    margin-bottom: 24px;
}

.content-card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.content-card-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Botones */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background: var(--color-primary);
    color: white;
}

.btn-success {
    background: var(--color-success);
    color: white;
}

.btn-success:hover {
    background: #16a34a;
}

/* Formulario de subida */
.upload-zone {
    border: 2px dashed #d1d5db;
    border-radius: 12px;
    padding: 48px;
    text-align: center;
    background: #f9fafb;
    transition: all 0.2s;
}

.upload-zone:hover,
.upload-zone.dragover {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.upload-zone input[type="file"] {
    display: none;
}

.upload-icon {
    font-size: 48px;
    color: var(--color-text-muted);
    margin-bottom: 16px;
}

.upload-text {
    color: var(--color-text);
    font-weight: 500;
    margin-bottom: 8px;
}

.upload-hint {
    color: var(--color-text-muted);
    font-size: 13px;
}

/* Resultado JSON */
.json-output {
    background: #1e293b;
    color: #e2e8f0;
    padding: 20px;
    border-radius: 8px;
    font-family: 'Monaco', 'Menlo', monospace;
    font-size: 13px;
    max-height: 400px;
    overflow: auto;
    white-space: pre-wrap;
    word-break: break-all;
}

/* Alertas */
.alert {
    padding: 12px 16px;
    border-radius: 8px;
    margin-bottom: 16px;
}

.alert-error {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.alert-success {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* Responsive */
@media (max-width: 768px) {
    .sidebar {
        width: 100%;
        max-height: auto;
    }
    
    .layout {
        flex-direction: column;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
}
