/* ==================================================
   Theory of Nodes · Dashboard
   ================================================== */

:root {
    --sidebar-width: 260px;
    --header-height: 60px;
    --sidebar-bg: #1a1d29;
    --sidebar-bg-hover: #252938;
    --sidebar-text: #c8cbd6;
    --sidebar-text-active: #ffffff;
    --accent: #6366f1;
    --accent-light: #818cf8;
    --bg-main: #f5f6fa;
    --border-color: #e4e6ef;
}

* { box-sizing: border-box; }

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: var(--bg-main);
    color: #1f2937;
    margin: 0;
}

/* ============ LOGIN ============ */
.login-body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    background: linear-gradient(135deg, #1a1d29 0%, #2d3142 50%, #4a4e69 100%);
}
.login-wrapper {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 1rem;
}
.login-card {
    background: #fff;
    border-radius: 14px;
    padding: 2.25rem 2rem;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
}
.login-brand { text-align: center; }
.login-logo {
    width: 64px; height: 64px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 28px;
    margin: 0 auto 1rem;
    box-shadow: 0 8px 20px rgba(99,102,241,0.35);
}

/* ============ APP SHELL ============ */
.app-shell {
    display: flex;
    min-height: 100vh;
}

/* ============ SIDEBAR ============ */
.app-sidebar {
    width: var(--sidebar-width);
    background: var(--sidebar-bg);
    color: var(--sidebar-text);
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0 auto 0 0;
    overflow-y: auto;
    z-index: 1030;
    transition: transform 0.25s ease;
}

.sidebar-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 1.1rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,0.06);
}
.brand-logo {
    width: 40px; height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
    flex-shrink: 0;
}
.brand-text strong { color: #fff; font-size: 0.95rem; }
.brand-text .small { font-size: 0.7rem; }

.sidebar-nav {
    flex: 1;
    padding: 1rem 0.75rem;
}
.nav-section-title {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: rgba(255,255,255,0.35);
    padding: 0.5rem 0.75rem;
    margin-top: 0.25rem;
}
.sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.55rem 0.85rem;
    color: var(--sidebar-text);
    border-radius: 8px;
    font-size: 0.88rem;
    text-decoration: none;
    margin-bottom: 2px;
    transition: background 0.15s, color 0.15s;
}
.sidebar-nav .nav-link i { font-size: 1rem; width: 18px; text-align: center; }
.sidebar-nav .nav-link:hover {
    background: var(--sidebar-bg-hover);
    color: #fff;
}
.sidebar-nav .nav-link.active {
    background: linear-gradient(135deg, var(--accent), var(--accent-light));
    color: #fff;
    box-shadow: 0 4px 12px rgba(99,102,241,0.3);
}

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,0.06);
}

/* ============ MAIN ============ */
.app-main {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

.app-header {
    height: var(--header-height);
    background: #fff;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    position: sticky;
    top: 0;
    z-index: 100;
}
.header-title { flex: 1; }
.header-actions { display: flex; align-items: center; gap: 0.5rem; }

.app-content {
    flex: 1;
    padding: 1.75rem;
}

.app-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid var(--border-color);
    background: #fff;
    text-align: center;
}

/* ============ CARDS / WIDGETS ============ */
.stat-card {
    background: #fff;
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 1rem;
}
.stat-icon {
    width: 50px; height: 50px;
    border-radius: 12px;
    display: flex; align-items: center; justify-content: center;
    font-size: 22px;
    color: #fff;
    flex-shrink: 0;
}
.stat-card .stat-label { font-size: 0.78rem; color: #6b7280; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-card .stat-value { font-size: 1.5rem; font-weight: 700; color: #1f2937; }

.panel {
    background: #fff;
    border-radius: 12px;
    border: 1px solid var(--border-color);
    overflow: hidden;
}
.panel-header {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.panel-header h2 { font-size: 0.95rem; font-weight: 600; margin: 0; }
.panel-body { padding: 1.25rem; }

/* ============ ENTRADAS ============ */
.entrada-item {
    padding: 0.9rem 1.25rem;
    border-bottom: 1px solid var(--border-color);
}
.entrada-item:last-child { border-bottom: none; }
.entrada-item .badge-cat {
    font-size: 0.68rem;
    padding: 0.25rem 0.55rem;
    border-radius: 4px;
    color: #fff;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
    .app-sidebar { transform: translateX(-100%); }
    .app-sidebar.open { transform: translateX(0); }
    .app-main { margin-left: 0; }
}
