/*
Theme Name: Jevvin Finanzas
Theme URI: https://jevvin.com
Author: Jevvin
Author URI: https://jevvin.com
Description: Tema moderno tipo fintech para el plugin de finanzas Jevvin. Diseño minimalista, profesional y compatible con sesiones de WordPress.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jevvin-finanzas
Tags: finance, dashboard, minimal, responsive, custom-menu, post-thumbnails
*/

/* ============================================================
   RESET & BASE
============================================================ */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --color-bg:         #F0F2F5;
    --color-surface:    #FFFFFF;
    --color-primary:    #1A73E8;
    --color-primary-dk: #1558B0;
    --color-accent:     #00C6A7;
    --color-dark:       #1C2333;
    --color-muted:      #6B7280;
    --color-border:     #E2E8F0;
    --color-danger:     #EF4444;

    --radius-sm:  6px;
    --radius-md:  10px;
    --radius-lg:  16px;
    --radius-xl:  24px;

    --shadow-sm:  0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:  0 4px 16px rgba(0,0,0,.10);
    --shadow-lg:  0 8px 32px rgba(0,0,0,.12);

    --font-sans:  'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
    --max-w:      1200px;
    --header-h:   70px;
    --transition: .2s ease;
}

html { scroll-behavior: smooth; }

body {
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-dark);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition);
}
a:hover { color: var(--color-primary-dk); }

img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   LAYOUT
============================================================ */
.site-wrapper {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.container {
    width: 100%;
    max-width: var(--max-w);
    margin: 0 auto;
    padding: 0 24px;
}

.site-main {
    flex: 1;
    padding: 40px 0 60px;
}

/* ============================================================
   HEADER
============================================================ */
.site-header {
    position: sticky;
    top: 0;
    z-index: 100;
    height: var(--header-h);
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

/* Logo */
.site-logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-dark);
    letter-spacing: -.3px;
}
.site-logo:hover { color: var(--color-primary); }

.site-logo .logo-icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: var(--radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: .85rem;
    font-weight: 800;
}

/* Nav principal */
.main-navigation {
    display: flex;
    align-items: center;
}

.main-navigation ul {
    list-style: none;
    display: flex;
    gap: 4px;
    align-items: center;
}

.main-navigation ul li a {
    display: block;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-muted);
    transition: background var(--transition), color var(--transition);
}

.main-navigation ul li a:hover,
.main-navigation ul li.current-menu-item a,
.main-navigation ul li.current_page_item a {
    background: rgba(26,115,232,.08);
    color: var(--color-primary);
}

/* Header actions */
.header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.user-greeting {
    font-size: .875rem;
    color: var(--color-muted);
    font-weight: 500;
}

.user-greeting strong {
    color: var(--color-dark);
}

/* ============================================================
   BOTONES
============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 20px;
    border-radius: var(--radius-xl);
    font-size: .875rem;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
    box-shadow: 0 2px 8px rgba(26,115,232,.30);
}
.btn-primary:hover {
    background: var(--color-primary-dk);
    color: #fff;
    box-shadow: 0 4px 16px rgba(26,115,232,.40);
    transform: translateY(-1px);
}

.btn-ghost {
    background: transparent;
    color: var(--color-muted);
    border: 1px solid var(--color-border);
}
.btn-ghost:hover {
    background: var(--color-bg);
    color: var(--color-dark);
    border-color: #cbd5e0;
}

.btn-danger {
    background: transparent;
    color: var(--color-danger);
    border: 1px solid rgba(239,68,68,.25);
}
.btn-danger:hover {
    background: rgba(239,68,68,.06);
    border-color: var(--color-danger);
}

/* ============================================================
   CARDS
============================================================ */
.card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: box-shadow var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); }

.card-body { padding: 28px; }
.card-header {
    padding: 20px 28px;
    border-bottom: 1px solid var(--color-border);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.card-title {
    font-size: 1rem;
    font-weight: 600;
    color: var(--color-dark);
}

/* ============================================================
   ESTADO: NO LOGUEADO
============================================================ */
.login-gate {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    min-height: 60vh;
    gap: 16px;
}

.login-gate .gate-icon {
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    margin-bottom: 8px;
}

.login-gate h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--color-dark);
}

.login-gate p {
    color: var(--color-muted);
    max-width: 380px;
    font-size: .9375rem;
}

/* ============================================================
   CONTENT AREA
============================================================ */
.entry-header {
    margin-bottom: 28px;
}

.entry-title {
    font-size: 1.875rem;
    font-weight: 700;
    color: var(--color-dark);
    line-height: 1.25;
    margin-bottom: 8px;
}

.entry-meta {
    font-size: .8125rem;
    color: var(--color-muted);
}

.entry-content {
    font-size: .9375rem;
    line-height: 1.7;
}

.entry-content h2,
.entry-content h3,
.entry-content h4 {
    margin-top: 1.75em;
    margin-bottom: .5em;
    color: var(--color-dark);
    font-weight: 600;
}

.entry-content p { margin-bottom: 1em; }

.entry-content ul,
.entry-content ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

.entry-content table {
    width: 100%;
    border-collapse: collapse;
    font-size: .875rem;
    margin-bottom: 1.5em;
}

.entry-content th,
.entry-content td {
    padding: 10px 14px;
    text-align: left;
    border-bottom: 1px solid var(--color-border);
}

.entry-content th {
    font-weight: 600;
    background: var(--color-bg);
    color: var(--color-dark);
}

/* ============================================================
   DASHBOARD TEMPLATE
============================================================ */
.dashboard-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 24px;
    align-items: start;
}

.dashboard-sidebar {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    position: sticky;
    top: calc(var(--header-h) + 24px);
}

.dashboard-sidebar-header {
    padding: 20px;
    background: linear-gradient(135deg, var(--color-primary), #0052CC);
    color: #fff;
}

.dashboard-sidebar-header .user-avatar {
    width: 48px;
    height: 48px;
    background: rgba(255,255,255,.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.dashboard-sidebar-header .user-name {
    font-weight: 600;
    font-size: .9375rem;
}

.dashboard-sidebar-header .user-role {
    font-size: .75rem;
    opacity: .75;
    margin-top: 2px;
}

.sidebar-nav { padding: 12px; }

.sidebar-nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-muted);
    transition: all var(--transition);
    margin-bottom: 2px;
}

.sidebar-nav-link:hover,
.sidebar-nav-link.active {
    background: rgba(26,115,232,.08);
    color: var(--color-primary);
}

.sidebar-nav-link .nav-icon {
    width: 20px;
    text-align: center;
    font-size: .9375rem;
}

.dashboard-content { min-width: 0; }

/* ============================================================
   STATS GRID
============================================================ */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    padding: 22px;
    border: 1px solid var(--color-border);
    box-shadow: var(--shadow-sm);
}

.stat-card .stat-label {
    font-size: .75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .6px;
    color: var(--color-muted);
    margin-bottom: 8px;
}

.stat-card .stat-value {
    font-size: 1.625rem;
    font-weight: 700;
    color: var(--color-dark);
    line-height: 1;
}

.stat-card .stat-change {
    font-size: .75rem;
    margin-top: 6px;
    color: #22C55E;
}
.stat-card .stat-change.negative { color: var(--color-danger); }

/* ============================================================
   POSTS GRID (index)
============================================================ */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 24px;
}

.post-card {
    background: var(--color-surface);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--color-border);
    overflow: hidden;
    transition: box-shadow var(--transition), transform var(--transition);
}

.post-card:hover {
    box-shadow: var(--shadow-md);
    transform: translateY(-2px);
}

.post-card-thumb img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.post-card-body { padding: 20px; }

.post-card-category {
    display: inline-block;
    font-size: .6875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.post-card-title {
    font-size: 1.0625rem;
    font-weight: 600;
    color: var(--color-dark);
    line-height: 1.35;
    margin-bottom: 8px;
}

.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--color-primary); }

.post-card-excerpt {
    font-size: .8125rem;
    color: var(--color-muted);
    line-height: 1.55;
    margin-bottom: 14px;
}

.post-card-meta {
    font-size: .75rem;
    color: var(--color-muted);
    display: flex;
    align-items: center;
    gap: 12px;
}

/* ============================================================
   PAGINATION
============================================================ */
.pagination {
    display: flex;
    justify-content: center;
    gap: 6px;
    margin-top: 40px;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: var(--radius-sm);
    font-size: .875rem;
    font-weight: 500;
    color: var(--color-muted);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    transition: all var(--transition);
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--color-primary);
    color: #fff;
    border-color: var(--color-primary);
}

/* ============================================================
   COMMENTS
============================================================ */
.comments-area {
    margin-top: 48px;
}

.comment-list { list-style: none; }

.comment-body {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 18px;
    margin-bottom: 12px;
}

.comment-meta { font-size: .8125rem; color: var(--color-muted); margin-bottom: 8px; }
.comment-author b { color: var(--color-dark); font-weight: 600; }

/* ============================================================
   FOOTER
============================================================ */
.site-footer {
    background: var(--color-dark);
    color: rgba(255,255,255,.6);
    padding: 32px 0;
    font-size: .8125rem;
}

.footer-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
}

.footer-brand {
    font-weight: 700;
    font-size: .9375rem;
    color: #fff;
}

.footer-links {
    display: flex;
    gap: 20px;
}

.footer-links a {
    color: rgba(255,255,255,.5);
    font-size: .8125rem;
    transition: color var(--transition);
}
.footer-links a:hover { color: #fff; }

/* ============================================================
   MOBILE MENU TOGGLE
============================================================ */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: var(--radius-sm);
    color: var(--color-muted);
}

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

/* ============================================================
   UTILITIES
============================================================ */
.text-center { text-align: center; }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }

/* ============================================================
   RESPONSIVE
============================================================ */
@media (max-width: 1024px) {
    .dashboard-layout {
        grid-template-columns: 1fr;
    }
    .dashboard-sidebar {
        position: static;
        display: flex;
        flex-direction: row;
        overflow-x: auto;
    }
    .dashboard-sidebar-header { min-width: 200px; }
    .sidebar-nav { display: flex; padding: 12px; gap: 4px; }
    .sidebar-nav-link { white-space: nowrap; }
}

@media (max-width: 768px) {
    :root { --header-h: 60px; }

    .main-navigation { display: none; position: absolute; top: var(--header-h); left: 0; right: 0; background: var(--color-surface); border-bottom: 1px solid var(--color-border); box-shadow: var(--shadow-md); padding: 12px; z-index: 99; }
    .main-navigation.is-open { display: block; }
    .main-navigation ul { flex-direction: column; gap: 2px; }

    .menu-toggle { display: flex; align-items: center; }

    .user-greeting { display: none; }

    .entry-title { font-size: 1.5rem; }

    .posts-grid { grid-template-columns: 1fr; }

    .stats-grid { grid-template-columns: 1fr 1fr; }

    .footer-inner { flex-direction: column; text-align: center; }
}

@media (max-width: 480px) {
    .container { padding: 0 16px; }
    .stats-grid { grid-template-columns: 1fr; }
    .header-actions .btn span { display: none; }
}

/* ============================================================
   WORDPRESS CORE CLASSES
============================================================ */
.aligncenter { display: block; margin: 0 auto; }
.alignleft   { float: left; margin-right: 1.5em; margin-bottom: 1em; }
.alignright  { float: right; margin-left: 1.5em; margin-bottom: 1em; }
.wp-caption  { max-width: 100%; background: var(--color-bg); border: 1px solid var(--color-border); border-radius: var(--radius-sm); padding: 6px; }
.wp-caption-text { font-size: .8125rem; color: var(--color-muted); text-align: center; padding: 6px 0 2px; }
.screen-reader-text { position: absolute; left: -9999px; }
