/* ============================================================
   LogMetal v1.0 — Estilos personalizados
   @AgenteUI — Paleta industrial premium
   ============================================================ */

:root {
    --lm-sidebar-bg:     #0f172a;
    --lm-sidebar-hover:  #1e293b;
    --lm-sidebar-active: #1d4ed8;
    --lm-sidebar-text:   #94a3b8;
    --lm-sidebar-width:  260px;

    --lm-header-bg:      #ffffff;
    --lm-header-shadow:  0 1px 3px rgba(0,0,0,.08);

    --lm-body-bg:        #f1f5f9;
    --lm-primary:        #1d4ed8;
    --lm-primary-dark:   #1e3a8a;
    --lm-accent:         #f59e0b;
    --lm-danger:         #ef4444;
    --lm-success:        #10b981;
    --lm-info:           #0ea5e9;

    --lm-card-shadow:    0 1px 3px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
    --lm-card-radius:    0.75rem;

    --lm-transition:     all .2s ease;
}

/* ---- GLOBAL ---- */
body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--lm-body-bg);
    color: #1e293b;
    overflow-x: hidden;
}

a { text-decoration: none; }

/* ---- SCROLLBAR ---- */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #94a3b8; }

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

.lm-sidebar-brand {
    padding: 1.25rem 1.5rem;
    display: flex;
    align-items: center;
    gap: .75rem;
    border-bottom: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.lm-sidebar-brand .brand-icon {
    width: 38px;
    height: 38px;
    background: linear-gradient(135deg, var(--lm-primary), var(--lm-accent));
    border-radius: .6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.1rem;
    flex-shrink: 0;
}

.lm-sidebar-brand .brand-text {
    color: #f8fafc;
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: -.02em;
}

.lm-sidebar-brand .brand-version {
    color: var(--lm-sidebar-text);
    font-size: .7rem;
    display: block;
    margin-top: -2px;
}

/* Nav Items */
.lm-sidebar-nav {
    flex: 1;
    overflow-y: auto;
    padding: .75rem 0;
}

.lm-sidebar-nav .nav-label {
    padding: .75rem 1.5rem .35rem;
    font-size: .65rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .08em;
    color: #475569;
}

.lm-sidebar-nav .nav-item {
    padding: 0 .75rem;
    margin-bottom: 2px;
}

.lm-sidebar-nav .nav-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: .6rem .75rem;
    color: var(--lm-sidebar-text);
    border-radius: .5rem;
    transition: var(--lm-transition);
    font-size: .875rem;
    font-weight: 500;
}

.lm-sidebar-nav .nav-link i {
    width: 20px;
    text-align: center;
    font-size: .95rem;
}

.lm-sidebar-nav .nav-link:hover {
    background: var(--lm-sidebar-hover);
    color: #e2e8f0;
}

.lm-sidebar-nav .nav-link.active {
    background: var(--lm-sidebar-active);
    color: #ffffff;
    font-weight: 600;
}

.lm-sidebar-nav .nav-link .badge {
    margin-left: auto;
    font-size: .7rem;
}

/* Sidebar footer */
.lm-sidebar-footer {
    padding: 1rem 1.5rem;
    border-top: 1px solid rgba(255,255,255,.06);
    flex-shrink: 0;
}

.lm-sidebar-footer .user-info {
    display: flex;
    align-items: center;
    gap: .65rem;
}

.lm-sidebar-footer .user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--lm-sidebar-hover);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--lm-accent);
    font-weight: 700;
    font-size: .85rem;
    flex-shrink: 0;
}

.lm-sidebar-footer .user-name {
    color: #e2e8f0;
    font-size: .85rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.lm-sidebar-footer .user-role {
    color: var(--lm-sidebar-text);
    font-size: .7rem;
}

/* ============================================================
   MAIN CONTENT
   ============================================================ */
.lm-main {
    margin-left: var(--lm-sidebar-width);
    min-height: 100vh;
    transition: margin-left .3s ease;
}

/* ---- HEADER ---- */
.lm-header {
    background: var(--lm-header-bg);
    box-shadow: var(--lm-header-shadow);
    padding: 0 1.5rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    position: sticky;
    top: 0;
    z-index: 1030;
}

.lm-header .page-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #0f172a;
    margin: 0;
}

.lm-header .breadcrumb {
    margin: 0;
    font-size: .8rem;
}

.lm-header .header-actions {
    display: flex;
    align-items: center;
    gap: .5rem;
}

.lm-header .btn-icon {
    width: 38px;
    height: 38px;
    border-radius: .5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background: transparent;
    color: #64748b;
    transition: var(--lm-transition);
    position: relative;
}

.lm-header .btn-icon:hover {
    background: #f1f5f9;
    color: var(--lm-primary);
}

.lm-header .btn-icon .notification-dot {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 8px;
    height: 8px;
    background: var(--lm-danger);
    border-radius: 50%;
    border: 2px solid #fff;
}

#sidebarToggle {
    display: none;
}

/* ---- PAGE CONTENT ---- */
.lm-content {
    padding: 1.5rem;
}

/* ============================================================
   CARDS
   ============================================================ */
.lm-card {
    background: #ffffff;
    border-radius: var(--lm-card-radius);
    box-shadow: var(--lm-card-shadow);
    border: 1px solid #e2e8f0;
    transition: var(--lm-transition);
}

.lm-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,.08);
}

.lm-card .card-header {
    background: transparent;
    border-bottom: 1px solid #f1f5f9;
    padding: 1rem 1.25rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.lm-card .card-body {
    padding: 1.25rem;
}

/* ---- STAT CARDS (Dashboard) ---- */
.stat-card {
    padding: 1.25rem;
    border-radius: var(--lm-card-radius);
    background: #ffffff;
    border: 1px solid #e2e8f0;
    box-shadow: var(--lm-card-shadow);
    display: flex;
    align-items: center;
    gap: 1rem;
    transition: var(--lm-transition);
}

.stat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0,0,0,.1);
}

.stat-card .stat-icon {
    width: 52px;
    height: 52px;
    border-radius: .75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.stat-card .stat-icon.blue   { background: #dbeafe; color: var(--lm-primary); }
.stat-card .stat-icon.amber  { background: #fef3c7; color: #d97706; }
.stat-card .stat-icon.green  { background: #d1fae5; color: #059669; }
.stat-card .stat-icon.red    { background: #fee2e2; color: #dc2626; }
.stat-card .stat-icon.purple { background: #ede9fe; color: #7c3aed; }
.stat-card .stat-icon.cyan   { background: #cffafe; color: #0891b2; }

.stat-card .stat-info .stat-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.stat-card .stat-info .stat-label {
    font-size: .78rem;
    color: #64748b;
    font-weight: 500;
}

/* ============================================================
   TABLES
   ============================================================ */
.lm-table {
    width: 100%;
    font-size: .875rem;
}

.lm-table thead th {
    background: #f8fafc;
    color: #475569;
    font-weight: 600;
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .04em;
    padding: .75rem 1rem;
    border-bottom: 2px solid #e2e8f0;
    white-space: nowrap;
}

.lm-table tbody td {
    padding: .7rem 1rem;
    border-bottom: 1px solid #f1f5f9;
    vertical-align: middle;
}

.lm-table tbody tr:hover {
    background: #f8fafc;
}

/* ============================================================
   BUTTONS
   ============================================================ */
.btn-lm-primary {
    background: var(--lm-primary);
    color: #fff;
    border: none;
    padding: .5rem 1.25rem;
    border-radius: .5rem;
    font-weight: 600;
    font-size: .875rem;
    transition: var(--lm-transition);
}

.btn-lm-primary:hover {
    background: var(--lm-primary-dark);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(29,78,216,.35);
}

.btn-action {
    width: 32px;
    height: 32px;
    border-radius: .4rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    transition: var(--lm-transition);
    font-size: .8rem;
}

.btn-action:hover         { background: #f1f5f9; }
.btn-action.edit:hover    { color: var(--lm-primary); border-color: var(--lm-primary); }
.btn-action.delete:hover  { color: var(--lm-danger); border-color: var(--lm-danger); }
.btn-action.view:hover    { color: var(--lm-success); border-color: var(--lm-success); }

/* ============================================================
   LOGIN PAGE
   ============================================================ */
.login-wrapper {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 50%, #1e40af 100%);
    position: relative;
    overflow: hidden;
}

.login-wrapper::before {
    content: '';
    position: absolute;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(245,158,11,.12) 0%, transparent 70%);
    top: -200px;
    right: -100px;
}

.login-wrapper::after {
    content: '';
    position: absolute;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(29,78,216,.15) 0%, transparent 70%);
    bottom: -100px;
    left: -100px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 25px 60px rgba(0,0,0,.3);
    padding: 2.5rem;
    position: relative;
    z-index: 1;
}

.login-card .login-logo {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--lm-primary), var(--lm-accent));
    border-radius: .85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.5rem;
    margin: 0 auto 1.25rem;
}

.login-card h1 {
    font-size: 1.5rem;
    font-weight: 800;
    color: #0f172a;
    text-align: center;
    margin-bottom: .25rem;
}

.login-card .login-subtitle {
    text-align: center;
    color: #64748b;
    font-size: .9rem;
    margin-bottom: 2rem;
}

.login-card .form-floating label {
    color: #64748b;
}

.login-card .form-control {
    border-radius: .5rem;
    border: 1.5px solid #e2e8f0;
    padding: .75rem 1rem;
    font-size: .9rem;
    transition: var(--lm-transition);
}

.login-card .form-control:focus {
    border-color: var(--lm-primary);
    box-shadow: 0 0 0 3px rgba(29,78,216,.12);
}

.login-card .btn-login {
    width: 100%;
    padding: .75rem;
    background: linear-gradient(135deg, var(--lm-primary), #2563eb);
    border: none;
    color: #fff;
    font-weight: 700;
    font-size: 1rem;
    border-radius: .5rem;
    transition: var(--lm-transition);
}

.login-card .btn-login:hover {
    transform: translateY(-1px);
    box-shadow: 0 8px 25px rgba(29,78,216,.4);
}

/* ============================================================
   FLASH MESSAGES
   ============================================================ */
.lm-alert {
    border-radius: .5rem;
    border: none;
    padding: .75rem 1rem;
    font-size: .875rem;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: .5rem;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 991.98px) {
    .lm-sidebar {
        transform: translateX(-100%);
    }

    .lm-sidebar.show {
        transform: translateX(0);
    }

    .lm-main {
        margin-left: 0;
    }

    #sidebarToggle {
        display: flex;
    }

    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0,0,0,.5);
        z-index: 1035;
    }

    .sidebar-overlay.show {
        display: block;
    }
}

@media (max-width: 575.98px) {
    .lm-content { padding: 1rem; }
    .stat-card .stat-info .stat-value { font-size: 1.25rem; }
}
