:root{
    --bg: #f4f7fb;
    --panel: #ffffff;
    --sidebar: #0f172a;
    --sidebar-2: #111c35;
    --primary: #d72638;
    --primary-dark: #b91f2f;
    --text: #0f172a;
    --muted: #6b7280;
    --border: #e5e7eb;
    --success: #16a34a;
    --danger: #dc2626;
    --info: #2563eb;
    --shadow: 0 10px 30px rgba(2, 6, 23, .08);
    --radius: 18px;
}

*{
    box-sizing:border-box;
}

html,body{
    margin:0;
    padding:0;
    font-family:Arial,Helvetica,sans-serif;
    background:var(--bg);
    color:var(--text);
}

a{
    text-decoration:none;
}

/* =========================
   LOGIN
========================= */

.login-body{
    min-height:100vh;
    background:linear-gradient(135deg, #0f172a 0%, #172554 50%, #d72638 100%);
    display:flex;
    align-items:center;
    justify-content:center;
    padding:24px;
}

.login-shell{
    width:100%;
    max-width:460px;
}

.login-card{
    background:rgba(255,255,255,.98);
    border-radius:24px;
    padding:32px;
    box-shadow:0 20px 50px rgba(0,0,0,.25);
}

.login-brand{
    display:inline-block;
    background:#0f172a;
    color:#fff;
    padding:8px 14px;
    border-radius:999px;
    font-weight:700;
    margin-bottom:14px;
}

.login-card h1{
    margin:0 0 8px;
    font-size:30px;
}

.login-card p{
    margin:0 0 22px;
    color:var(--muted);
}

.login-form{
    display:flex;
    flex-direction:column;
    gap:10px;
}

.login-form label{
    font-size:14px;
    font-weight:700;
}

.login-form input{
    height:46px;
    border:1px solid var(--border);
    border-radius:12px;
    padding:0 14px;
    font-size:15px;
    outline:none;
}

.login-form input:focus{
    border-color:#93c5fd;
    box-shadow:0 0 0 4px rgba(37,99,235,.10);
}

.login-note{
    margin-top:16px;
    color:var(--muted);
    font-size:14px;
}

/* =========================
   BOTONES Y ALERTAS
========================= */

.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    border:none;
    border-radius:12px;
    height:46px;
    padding:0 18px;
    font-weight:700;
    cursor:pointer;
}

.btn-primary{
    background:var(--primary);
    color:#fff;
}

.btn-primary:hover{
    background:var(--primary-dark);
}

.btn-secondary{
    background:#e5e7eb;
    color:#111827;
}

.btn-secondary:hover{
    background:#d1d5db;
}

.btn-full{
    width:100%;
    margin-top:8px;
}

.btn-sm{
    height:38px;
    padding:0 14px;
    font-size:14px;
    border-radius:10px;
}

.alert{
    padding:14px 16px;
    border-radius:14px;
    margin-bottom:18px;
    font-size:14px;
}

.alert-danger{
    background:#fee2e2;
    color:#991b1b;
}

.alert-success{
    background:#dcfce7;
    color:#166534;
}

.alert-info{
    background:#dbeafe;
    color:#1d4ed8;
}

/* =========================
   LAYOUT GENERAL
========================= */

.app-body{
    min-height:100vh;
    background:var(--bg);
}

.app-shell{
    display:flex;
    min-height:100vh;
}

.sidebar{
    width:270px;
    background:linear-gradient(180deg, var(--sidebar) 0%, var(--sidebar-2) 100%);
    color:#fff;
    padding:22px 18px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
}

.sidebar-brand{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:24px;
}

.brand-mark{
    width:46px;
    height:46px;
    border-radius:14px;
    background:var(--primary);
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:800;
    color:#fff;
}

.sidebar-brand strong{
    display:block;
    font-size:18px;
}

.sidebar-brand small{
    color:#cbd5e1;
}

.sidebar-nav{
    display:flex;
    flex-direction:column;
    gap:8px;
    margin-bottom:auto;
}

.nav-link{
    color:#dbe4f0;
    padding:12px 14px;
    border-radius:12px;
    transition:.2s ease;
}

.nav-link:hover,
.nav-link.active{
    background:rgba(255,255,255,.08);
    color:#fff;
}

.nav-link-logout{
    margin-top:8px;
    color:#fecaca;
}

.sidebar-user{
    border-top:1px solid rgba(255,255,255,.10);
    padding-top:16px;
    margin-top:18px;
}

.sidebar-user strong{
    display:block;
    margin-bottom:6px;
}

.sidebar-user span{
    color:#cbd5e1;
    font-size:14px;
    word-break:break-word;
}

.main-content{
    flex:1;
    display:flex;
    flex-direction:column;
    min-width:0;
}

.topbar{
    background:#fff;
    border-bottom:1px solid var(--border);
    padding:22px 28px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}

.topbar h2{
    margin:0;
    font-size:24px;
}

.topbar p{
    margin:6px 0 0;
    color:var(--muted);
    font-size:14px;
}

.topbar-user{
    background:#f8fafc;
    border:1px solid var(--border);
    padding:10px 14px;
    border-radius:12px;
    font-weight:700;
}

.page-content{
    padding:28px;
}

.footer{
    margin-top:auto;
    padding:18px 28px;
    color:var(--muted);
    font-size:14px;
}

/* =========================
   DASHBOARD
========================= */

.welcome-box{
    background:linear-gradient(135deg, #0f172a 0%, #1d4ed8 55%, #d72638 100%);
    color:#fff;
    border-radius:24px;
    padding:26px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:16px;
    box-shadow:var(--shadow);
    margin-bottom:24px;
}

.welcome-box h1{
    margin:0 0 8px;
    font-size:28px;
}

.welcome-box p{
    margin:0;
    color:rgba(255,255,255,.88);
}

.welcome-badge{
    background:rgba(255,255,255,.15);
    border:1px solid rgba(255,255,255,.20);
    padding:10px 14px;
    border-radius:999px;
    font-weight:800;
    letter-spacing:.6px;
}

.stats-grid{
    display:grid;
    grid-template-columns:repeat(6, minmax(0, 1fr));
    gap:18px;
    margin-bottom:24px;
}

.stat-card{
    background:var(--panel);
    border-radius:20px;
    padding:20px;
    box-shadow:var(--shadow);
    border:1px solid #eef2f7;
}

.stat-label{
    display:block;
    color:var(--muted);
    font-size:14px;
    margin-bottom:10px;
}

.stat-value{
    font-size:30px;
    line-height:1;
}

.content-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:20px;
    margin-bottom:20px;
}

.panel-card{
    background:var(--panel);
    border-radius:20px;
    border:1px solid #eef2f7;
    box-shadow:var(--shadow);
    overflow:hidden;
}

.panel-card-header{
    padding:18px 20px;
    border-bottom:1px solid var(--border);
}

.panel-card-header h2{
    margin:0;
    font-size:18px;
}

.panel-card-header-flex{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px;
}

.table-wrap{
    overflow:auto;
}

.table{
    width:100%;
    border-collapse:collapse;
}

.table th,
.table td{
    text-align:left;
    padding:14px 16px;
    border-bottom:1px solid #f1f5f9;
    font-size:14px;
}

.table th{
    background:#f8fafc;
    color:#334155;
    font-size:13px;
    text-transform:uppercase;
    letter-spacing:.4px;
}

.badge{
    display:inline-flex;
    align-items:center;
    padding:6px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:700;
}

.badge-active{
    background:#dcfce7;
    color:#166534;
}

.badge-danger{
    background:#fee2e2;
    color:#991b1b;
}

.badge-info{
    background:#dbeafe;
    color:#1d4ed8;
}

.system-list{
    padding:10px 20px 20px;
}

.system-item{
    display:flex;
    justify-content:space-between;
    gap:16px;
    padding:14px 0;
    border-bottom:1px solid #f1f5f9;
}

.system-item:last-child{
    border-bottom:none;
}

.ok{
    color:var(--success);
}

.feature-list{
    margin:0;
    padding:18px 22px 22px 40px;
    color:#334155;
}

.feature-list li{
    margin-bottom:12px;
}

/* =========================
   FORMULARIOS BASE
========================= */

.form-card{
    overflow:visible;
}

.form-wrap{
    padding:24px;
}

.erp-form label{
    display:block;
    font-size:14px;
    font-weight:700;
    margin-bottom:8px;
}

.erp-form input:not([type="checkbox"]),
.erp-form select{
    width:100%;
    height:52px;
    border:1px solid #dbe2ea;
    border-radius:10px;
    padding:0 14px;
    font-size:16px;
    color:#0f172a;
    background:#fff;
    outline:none;
    transition:.2s ease;
}

.erp-form input:not([type="checkbox"]):focus,
.erp-form select:focus{
    border-color:#2563eb;
    box-shadow:0 0 0 4px rgba(37, 99, 235, 0.08);
}

.form-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:18px;
}

.form-actions{
    display:flex;
    justify-content:flex-end;
    gap:12px;
    margin-top:24px;
}

/* =========================
   ONBOARDING / FORMULARIOS
========================= */

.onboarding-page{
    padding-top:30px;
    padding-bottom:40px;
}

.onboarding-shell{
    max-width:1100px;
    margin:0 auto;
}

.onboarding-card{
    background:#ffffff;
    border:1px solid #e5e7eb;
    border-radius:28px;
    padding:34px;
    box-shadow:0 20px 45px rgba(15, 23, 42, 0.08);
}

.onboarding-head{
    margin-bottom:24px;
}

.onboarding-brand{
    text-align:center;
    font-size:16px;
    font-weight:800;
    color:#cbd5e1;
    margin-bottom:8px;
}

.onboarding-head h1{
    margin:0 0 10px;
    text-align:center;
    font-size:28px;
    line-height:1.15;
    color:#334155;
}

.onboarding-head p{
    margin:0 auto 18px;
    text-align:center;
    color:#475569;
    font-size:15px;
    max-width:640px;
}

.onboarding-alert{
    background:#fff7e6;
    border:1px solid #f5c56b;
    color:#9a6700;
    padding:14px 16px;
    border-radius:12px;
    font-size:14px;
    text-align:center;
    margin-bottom:22px;
}

.onboarding-steps{
    display:flex;
    flex-wrap:wrap;
    gap:10px;
    margin:0 0 24px;
}

.step-chip{
    background:#eff6ff;
    color:#1d4ed8;
    border:1px solid #bfdbfe;
    padding:10px 14px;
    border-radius:999px;
    font-size:13px;
    font-weight:800;
}

.step-chip.active{
    background:#dbeafe;
    color:#1e40af;
}

.section-title{
    margin:0 0 18px;
    font-size:18px;
    color:#0f172a;
}

.section-title + .form-grid{
    margin-bottom:26px;
}

.onboarding-form .form-grid{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:18px 22px;
}

.field{
    display:flex;
    flex-direction:column;
}

.field-full{
    grid-column:1 / -1;
}

.field label{
    display:block;
    font-size:13px;
    font-weight:800;
    color:#334155;
    margin-bottom:8px;
    text-transform:uppercase;
    letter-spacing:.2px;
}

.onboarding-actions{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    margin-top:28px;
}

.btn-onboarding{
    min-width:220px;
    height:52px;
    font-size:17px;
    border-radius:12px;
}

/* =========================
   MODULOS TIPO ODOO PREMIUM
========================= */

.odoo-modules-grid{
    display:grid;
    grid-template-columns:repeat(5, minmax(140px, 1fr));
    gap:32px 22px;
    max-width:980px;
    margin:32px auto;
    justify-items:center;
    align-items:start;
}

.odoo-module-item{
    position:relative;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:flex-start;
    text-align:center;
    cursor:pointer;
    user-select:none;
    width:140px;
    min-height:170px;
    padding-top:6px;
}

.odoo-module-item input[type="checkbox"]{
    position:absolute;
    opacity:0;
    pointer-events:none;
}

.odoo-module-icon-box{
    width:108px;
    height:108px;
    border-radius:14px;
    background:#ffffff;
    border:1px solid #e5e7eb;
    box-shadow:0 10px 22px rgba(15, 23, 42, 0.07);
    display:flex;
    align-items:center;
    justify-content:center;
    transition:.25s ease;
    margin-bottom:12px;
}

.odoo-module-icon{
    width:58px;
    height:58px;
    border-radius:18px;
    background:linear-gradient(135deg, #2563eb 0%, #d72638 100%);
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:24px;
    font-weight:800;
    box-shadow:0 10px 18px rgba(37, 99, 235, 0.18);
}

.odoo-module-name{
    font-size:15px;
    font-weight:700;
    color:#1e293b;
    line-height:1.3;
    max-width:130px;
    min-height:40px;
    display:flex;
    align-items:flex-start;
    justify-content:center;
}

.odoo-module-item:hover .odoo-module-icon-box{
    transform:translateY(-4px);
    box-shadow:0 16px 30px rgba(15, 23, 42, 0.10);
    border-color:#cbd5e1;
}

.odoo-module-item.is-active .odoo-module-icon-box{
    border:2px solid #2563eb !important;
    box-shadow:0 16px 32px rgba(37, 99, 235, 0.16) !important;
}

.odoo-module-item.is-active .odoo-module-name{
    color:#2563eb !important;
}

.odoo-module-item.is-active::after{
    content:"✓";
    position:absolute;
    top:-4px;
    right:14px;
    width:28px;
    height:28px;
    border-radius:999px;
    background:#16a34a;
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    font-weight:800;
    box-shadow:0 8px 18px rgba(22, 163, 74, 0.25);
}

@media (max-width: 1200px){
    .odoo-modules-grid{
        grid-template-columns:repeat(4, minmax(140px, 1fr));
    }
}

@media (max-width: 900px){
    .odoo-modules-grid{
        grid-template-columns:repeat(3, minmax(140px, 1fr));
    }
}

@media (max-width: 640px){
    .odoo-modules-grid{
        grid-template-columns:repeat(2, minmax(120px, 1fr));
        gap:22px 14px;
    }

    .odoo-module-item{
        width:120px;
        min-height:150px;
    }

    .odoo-module-icon-box{
        width:90px;
        height:90px;
    }

    .odoo-module-icon{
        width:48px;
        height:48px;
        font-size:20px;
    }

    .odoo-module-name{
        font-size:14px;
        max-width:110px;
    }
}

.odoo-module-item:hover .odoo-module-icon-box{
    transform:translateY(-4px);
    box-shadow:0 16px 30px rgba(15, 23, 42, 0.10);
    border-color:#cbd5e1;
}

.odoo-module-item.is-active .odoo-module-icon-box{
    border:2px solid #2563eb;
    box-shadow:0 16px 32px rgba(37, 99, 235, 0.16);
}

.odoo-module-item.is-active .odoo-module-name{
    color:#2563eb;
}

.odoo-module-item.is-active::after{
    content:"✓";
    position:absolute;
    top:-4px;
    right:14px;
    width:28px;
    height:28px;
    border-radius:999px;
    background:#16a34a;
    color:#fff;
    display:flex;
    align-items:center;
    justify-content:center;
    font-size:14px;
    font-weight:800;
    box-shadow:0 8px 18px rgba(22, 163, 74, 0.25);
}

/* =========================
   RESPONSIVE
========================= */

@media (max-width: 1200px){
    .stats-grid{
        grid-template-columns:repeat(3, minmax(0, 1fr));
    }

    .odoo-modules-grid{
        grid-template-columns:repeat(4, minmax(140px, 1fr));
    }
}

@media (max-width: 900px){
    .app-shell{
        flex-direction:column;
    }

    .sidebar{
        width:100%;
    }

    .content-grid{
        grid-template-columns:1fr;
    }

    .stats-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .welcome-box{
        flex-direction:column;
        align-items:flex-start;
    }

    .odoo-modules-grid{
        grid-template-columns:repeat(3, minmax(140px, 1fr));
    }
}

@media (max-width: 768px){
    .form-grid,
    .onboarding-form .form-grid{
        grid-template-columns:1fr;
    }

    .onboarding-card{
        padding:22px;
        border-radius:20px;
    }

    .field-full{
        grid-column:auto;
    }

    .panel-card-header-flex{
        flex-direction:column;
        align-items:flex-start;
    }

    .form-actions,
    .onboarding-actions{
        flex-direction:column;
    }

    .btn-onboarding{
        width:100%;
    }
}

@media (max-width: 640px){
    .stats-grid{
        grid-template-columns:1fr;
    }

    .odoo-modules-grid{
        grid-template-columns:repeat(2, minmax(120px, 1fr));
        gap:22px 14px;
    }

    .odoo-module-item{
        width:120px;
        min-height:150px;
    }

    .odoo-module-icon-box{
        width:90px;
        height:90px;
    }

    .odoo-module-icon{
        width:48px;
        height:48px;
        font-size:20px;
    }

    .odoo-module-name{
        font-size:14px;
        max-width:110px;
    }

    .page-content,
    .topbar{
        padding:18px;
    }

    .login-card{
        padding:24px;
    }
}

.sidebar-section-title{
    font-size:11px;
    letter-spacing:1.2px;
    font-weight:800;
    color:#94a3b8;
    margin:22px 12px 10px;
    text-transform:uppercase;
}

.sidebar-section-title-bottom{
    margin-top:26px;
}

.nav-link{
    color:#dbe4f0;
    padding:12px 14px;
    border-radius:12px;
    transition:.2s ease;
    display:flex;
    align-items:center;
    gap:10px;
}

.nav-icon{
    width:20px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    font-size:15px;
}

.nav-link:hover,
.nav-link.active{
    background:rgba(255,255,255,.08);
    color:#fff;
    transform:translateX(2px);
}