/* ============================================================
   BELUX INV � MAIN CSS
   Variables, Reset, Layout, Tipograf�a, Utilidades
   ============================================================ */

/* --- Variables --- */
:root {
    --color-primary: #ffb2e6;
    --color-primary-dark: #e980cc;
    --color-primary-light: #ffe4f6;
    --color-success: #16a34a;
    --color-success-light: #dcfce7;
    --color-warning: #d97706;
    --color-warning-light: #fef3c7;
    --color-danger: #dc2626;
    --color-danger-light: #fee2e2;
    --color-info: #0284c7;
    --color-info-light: #e0f2fe;
    --color-purple: #7c3aed;
    --color-purple-light: #ede9fe;
    --sidebar-width: 260px;
    --topbar-height: 60px;
    --bg-body: #f1f5f9;
    --bg-card: #ffffff;
    --bg-sidebar: #35082a;
    --bg-sidebar-hover: rgba(255,255,255,.08);
    --bg-sidebar-active: rgba(255,255,255,.15);
    --text-primary: #1e293b;
    --text-secondary: #64748b;
    --text-muted: #94a3b8;
    --text-sidebar: rgba(255,255,255,.85);
    --text-sidebar-muted: rgba(255,255,255,.45);
    --border-color: #e2e8f0;
    --border-radius: 8px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.08);
    --shadow-md: 0 4px 12px rgba(0,0,0,.1);
    --shadow-lg: 0 8px 24px rgba(0,0,0,.12);
    --font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    --font-size-xs: .75rem;
    --font-size-sm: .875rem;
    --font-size-base: 1rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;
    --font-size-2xl: 1.5rem;
    --transition: all .2s ease;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
    font-family: var(--font-family);
    font-size: var(--font-size-base);
    color: var(--text-primary);
    background: var(--bg-body);
    line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }
img, svg { display: block; }

/* --- Scroll --- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-muted); }

/* ============================================================
   LAYOUT APP
   ============================================================ */
.app-body { display: flex; height: 100vh; overflow: hidden; }

/* --- Sidebar --- */
.sidebar {
    width: var(--sidebar-width);
    background: var(--bg-sidebar);
    display: flex;
    flex-direction: column;
    height: 100vh;
    position: fixed;
    top: 0; left: 0;
    z-index: 200;
    transition: transform .3s ease;
    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-header {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .75rem;
    padding: .75rem 1.25rem;
    border-bottom: 1px solid rgba(255,255,255,.08);
    min-height: var(--topbar-height);
}
.sidebar-logo {
    width: auto;
    height: 36px;
    object-fit: contain;
    object-position: center;
    display: block;
}
.btn-close-sidebar {
    display: none;
    background: none;
    border: none;
    color: var(--text-sidebar-muted);
    font-size: 1.1rem;
    padding: .25rem;
    border-radius: 4px;
    transition: var(--transition);
}
.btn-close-sidebar:hover { color: #fff; background: var(--bg-sidebar-hover); }

.sidebar-nav { flex: 1; padding: .75rem 0; }
.sidebar-nav ul { display: flex; flex-direction: column; gap: 2px; }

.nav-section-title {
    color: var(--text-sidebar-muted);
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
    padding: .75rem 1.25rem .25rem;
    margin-top: .25rem;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .625rem 1.25rem;
    color: var(--text-sidebar);
    border-radius: 0;
    transition: var(--transition);
    font-size: var(--font-size-sm);
    font-weight: 500;
    margin: 0 .5rem;
    border-radius: var(--border-radius);
}
.nav-link:hover { background: var(--bg-sidebar-hover); color: #fff; }
.nav-link.active { background: var(--bg-sidebar-active); color: #fff; }
.nav-icon { width: 18px; height: 18px; flex-shrink: 0; }

.sidebar-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.user-info { display: flex; align-items: center; gap: .625rem; flex: 1; min-width: 0; }
.user-avatar {
    width: 32px; height: 32px;
    background: var(--color-primary-dark);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: 700;
    flex-shrink: 0;
}
.user-details { display: flex; flex-direction: column; min-width: 0; }
.user-name {
    color: #fff;
    font-size: var(--font-size-sm);
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.user-email {
    color: var(--text-sidebar-muted);
    font-size: var(--font-size-xs);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.btn-logout {
    background: none;
    border: none;
    color: var(--text-sidebar-muted);
    padding: .375rem;
    border-radius: var(--border-radius);
    transition: var(--transition);
    flex-shrink: 0;
}
.btn-logout svg { width: 18px; height: 18px; }
.btn-logout:hover { background: var(--bg-sidebar-hover); color: #fff; }

/* --- Overlay m�vil --- */
.sidebar-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.5);
    z-index: 199;
}

/* --- Main Wrapper --- */
.main-wrapper {
    flex: 1;
    margin-left: var(--sidebar-width);
    display: flex;
    flex-direction: column;
    height: 100vh;
    overflow: hidden;
    transition: margin-left .3s ease;
}

/* --- Topbar --- */
.topbar {
    height: var(--topbar-height);
    background: var(--bg-card);
    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;
    box-shadow: var(--shadow-sm);
}
.btn-menu-toggle {
    display: none;
    background: none;
    border: none;
    padding: .375rem;
    border-radius: var(--border-radius);
    color: var(--text-secondary);
    transition: var(--transition);
}
.btn-menu-toggle svg { width: 22px; height: 22px; }
.btn-menu-toggle:hover { background: var(--bg-body); color: var(--text-primary); }
.topbar-title {
    font-size: var(--font-size-lg);
    font-weight: 600;
    color: var(--text-primary);
}

/* --- Main Content --- */
.main-content { flex: 1; padding: 1.5rem; overflow-y: auto; min-height: 0; }

/* ============================================================
   UTILIDADES
   ============================================================ */
.hidden { display: none !important; }
.text-center { text-align: center; }
.text-right  { text-align: right; }
.text-muted  { color: var(--text-muted); font-size: var(--font-size-sm); }
.mt-1 { margin-top: .25rem; }
.mt-2 { margin-top: .5rem; }
.mt-3 { margin-top: .75rem; }
.mt-4 { margin-top: 1rem; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-3 { margin-bottom: .75rem; }
.mb-4 { margin-bottom: 1rem; }
.p-0  { padding: 0 !important; }
.gap-2{ gap: .5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }

/* ============================================================
   BUTTONS
   ============================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .375rem;
    padding: .5rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    font-weight: 500;
    transition: var(--transition);
    white-space: nowrap;
    line-height: 1.4;
}
.btn svg { width: 16px; height: 16px; }
.btn:disabled { opacity: .6; cursor: not-allowed; }

.btn-primary   { background: var(--color-primary); color: #3d1a35; border-color: var(--color-primary); }
.btn-primary:hover { background: var(--color-primary-dark); color: #fff; border-color: var(--color-primary-dark); }
.btn-success   { background: var(--color-success); color: #fff; border-color: var(--color-success); }
.btn-success:hover { filter: brightness(.9); }
.btn-danger    { background: var(--color-danger);  color: #fff; border-color: var(--color-danger); }
.btn-danger:hover  { filter: brightness(.9); }
.btn-warning   { background: var(--color-warning); color: #fff; border-color: var(--color-warning); }
.btn-outline   { background: transparent; color: var(--color-primary-dark); border-color: var(--color-primary); }
.btn-outline:hover { background: var(--color-primary-light); }
.btn-ghost     { background: transparent; color: var(--text-secondary); border-color: var(--border-color); }
.btn-ghost:hover { background: var(--bg-body); }
.btn-block     { width: 100%; }
.btn-sm        { padding: .3rem .7rem; font-size: var(--font-size-xs); }
.btn-lg        { padding: .75rem 1.5rem; font-size: var(--font-size-base); }
.btn-icon      { padding: .4rem; width: 32px; height: 32px; }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: .75rem 1rem;
    border-radius: var(--border-radius);
    font-size: var(--font-size-sm);
    border: 1px solid transparent;
    margin-bottom: 1rem;
}
.alert-success { background: var(--color-success-light); color: var(--color-success); border-color: #bbf7d0; }
.alert-danger  { background: var(--color-danger-light);  color: var(--color-danger);  border-color: #fecaca; }
.alert-warning { background: var(--color-warning-light); color: var(--color-warning); border-color: #fde68a; }
.alert-info    { background: var(--color-info-light);    color: var(--color-info);    border-color: #bae6fd; }

/* ============================================================
   BADGES / STATUS
   ============================================================ */
.badge {
    display: inline-flex;
    align-items: center;
    padding: .2rem .6rem;
    border-radius: 99px;
    font-size: var(--font-size-xs);
    font-weight: 600;
    text-transform: capitalize;
}
.badge-success  { background: var(--color-success-light); color: var(--color-success); }
.badge-danger   { background: var(--color-danger-light);  color: var(--color-danger); }
.badge-warning  { background: var(--color-warning-light); color: var(--color-warning); }
.badge-xs       { font-size: .65rem; padding: .15rem .45rem; }
.badge-info     { background: var(--color-info-light);    color: var(--color-info); }
.badge-default  { background: var(--border-color);        color: var(--text-secondary); }
.badge-purple   { background: var(--color-purple-light);  color: var(--color-purple); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 768px) {
    .sidebar {
        transform: translateX(-100%);
    }
    .sidebar.open {
        transform: translateX(0);
    }
    .sidebar-overlay.open {
        display: block;
    }
    .btn-close-sidebar { display: flex; }
    .btn-menu-toggle   { display: flex; }
    .main-wrapper      { margin-left: 0; }
}
