:root{
    --bg: #f5f7fb;
    --panel: #ffffff;
    --panel-2: #f9fafb;
    --text: #111827;
    --muted: #6b7280;
    --line: #e5e7eb;
    --dark: #0f172a;
    --dark-2: #111827;
    --green: #c3ec1b;
    --green-dark: #a8cf12;
    --danger: #ef4444;
    --warning: #f59e0b;
    --success: #16a34a;
    --radius: 18px;
    --shadow: 0 12px 30px rgba(15, 23, 42, .08);
}

*{
    box-sizing:border-box;
}

html, body{
    margin:0;
    padding:0;
    font-family: Arial, sans-serif;
    background:var(--bg);
    color:var(--text);
}

body{
    background:var(--bg);
    color:var(--text);
}

a{
    color:inherit;
    text-decoration:none;
}

img{
    max-width:100%;
    height:auto;
    display:block;
}

body.app-body{
    min-height:100vh;
}

.app-shell{
    display:flex;
    min-height:100vh;
}

/* =========================
   SIDEBAR
========================= */
.sidebar{
    width:270px;
    background:linear-gradient(180deg, #0f172a 0%, #111827 100%);
    color:#fff;
    padding:24px 18px;
    position:sticky;
    top:0;
    height:100vh;
    display:flex;
    flex-direction:column;
    gap:24px;
    border-right:1px solid rgba(255,255,255,.06);
}

.brand{
    display:flex;
    align-items:center;
    gap:12px;
    padding:8px 8px 18px 8px;
    border-bottom:1px solid rgba(255,255,255,.08);
}

.brand-mark{
    width:42px;
    height:42px;
    border-radius:14px;
    background:var(--green);
    color:#111827;
    display:flex;
    align-items:center;
    justify-content:center;
    font-weight:bold;
    font-size:20px;
    flex:none;
}

.brand-text{
    display:flex;
    flex-direction:column;
    line-height:1.1;
    min-width:0;
}

.brand-text strong{
    font-size:18px;
}

.brand-text span{
    font-size:12px;
    color:#cbd5e1;
}

.sidebar-logo{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:4px 8px 18px;
    border-bottom:1px solid rgba(255,255,255,.08);
}

.sidebar-logo img{
    width:150px;
    max-width:100%;
    filter:drop-shadow(0 0 10px rgba(195, 236, 27, 0.22));
    transition:.25s ease;
}

.sidebar-logo img:hover{
    transform:scale(1.03);
    filter:drop-shadow(0 0 14px rgba(195, 236, 27, 0.34));
}

.nav-section{
    display:flex;
    flex-direction:column;
    gap:8px;
}

.nav-title{
    font-size:12px;
    text-transform:uppercase;
    letter-spacing:.08em;
    color:#94a3b8;
    padding:0 10px;
}

.nav-menu{
    display:flex;
    flex-direction:column;
    gap:6px;
}

.nav-link{
    display:flex;
    align-items:center;
    gap:10px;
    padding:12px 14px;
    border-radius:14px;
    color:#e5e7eb;
    transition:.2s ease;
    font-size:15px;
    word-break:break-word;
}

.nav-link:hover,
.nav-link.active{
    background:rgba(195,236,27,.14);
    color:#fff;
}

.nav-link .dot{
    width:8px;
    height:8px;
    border-radius:999px;
    background:var(--green);
    flex:none;
}

.sidebar-footer{
    margin-top:auto;
    padding-top:18px;
    border-top:1px solid rgba(255,255,255,.08);
}

.sidebar-footer .logout-btn{
    display:block;
    width:100%;
    text-align:center;
    background:rgba(255,255,255,.08);
    color:#fff;
    padding:12px 14px;
    border-radius:14px;
    font-weight:bold;
    transition:.2s ease;
}

.sidebar-footer .logout-btn:hover{
    background:rgba(255,255,255,.14);
}

/* =========================
   MAIN
========================= */
.main{
    flex:1;
    min-width:0;
    padding:24px;
}

.main-content{
    padding:0;
}

/* =========================
   TOPBAR / HERO
========================= */
.topbar{
    background:rgba(255,255,255,.82);
    backdrop-filter: blur(14px);
    border:1px solid rgba(229,231,235,.8);
    box-shadow:var(--shadow);
    border-radius:20px;
    padding:16px 18px;
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:14px;
    margin-bottom:22px;
}

.topbar h1{
    margin:0;
    font-size:28px;
}

.topbar p{
    margin:4px 0 0;
    color:var(--muted);
    font-size:14px;
    line-height:1.5;
}

.topbar-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
}

.page-hero{
    position:relative;
    overflow:hidden;
}

.page-hero::before{
    content:"";
    position:absolute;
    inset:auto -80px -80px auto;
    width:240px;
    height:240px;
    background:radial-gradient(circle, rgba(195,236,27,.18), transparent 70%);
    pointer-events:none;
}

.kpi-inline{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:14px;
}

.kpi-pill{
    background:#f3f4f6;
    border:1px solid var(--line);
    padding:10px 12px;
    border-radius:999px;
    font-size:13px;
    color:#374151;
}

/* =========================
   CARDS / PANELES
========================= */
.page-card{
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:22px;
    box-shadow:var(--shadow);
    padding:22px;
}

.panel{
    background:var(--panel);
    border:1px solid var(--line);
    border-radius:20px;
    box-shadow:var(--shadow);
    padding:20px;
}

.panel-head{
    display:flex;
    justify-content:space-between;
    align-items:flex-start;
    gap:12px;
    margin-bottom:16px;
}

.panel-head h2,
.panel-head h3{
    margin:0;
}

.panel-head p{
    margin:4px 0 0;
    color:var(--muted);
    font-size:14px;
    line-height:1.5;
}

/* =========================
   STATS
========================= */
.stats-grid{
    display:grid;
    grid-template-columns:repeat(4, minmax(0, 1fr));
    gap:16px;
    margin-bottom:22px;
}

.stat-card{
    background:linear-gradient(180deg, #ffffff 0%, #f9fafb 100%);
    border:1px solid var(--line);
    border-radius:20px;
    padding:18px;
    box-shadow:var(--shadow);
}

.stat-card .label{
    color:var(--muted);
    font-size:13px;
    margin-bottom:10px;
    line-height:1.4;
}

.stat-card .value{
    font-size:30px;
    font-weight:bold;
    line-height:1.1;
    word-break:break-word;
}

.stat-card .mini{
    margin-top:10px;
    font-size:13px;
    color:var(--muted);
    line-height:1.5;
}

/* =========================
   CONTENT GRID
========================= */
.content-grid{
    display:grid;
    grid-template-columns:2fr 1fr;
    gap:18px;
}

/* =========================
   BUTTONS
========================= */
.btn{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:8px;
    border:none;
    border-radius:14px;
    padding:12px 16px;
    font-weight:bold;
    cursor:pointer;
    transition:.2s ease;
    text-align:center;
    white-space:nowrap;
}

.btn:hover{
    transform:translateY(-1px);
}

.btn-primary{
    background:var(--green);
    color:#111827;
}

.btn-primary:hover{
    background:var(--green-dark);
}

.btn-dark{
    background:#111827;
    color:#fff;
}

.btn-dark:hover{
    background:#1f2937;
}

.btn-light{
    background:#f3f4f6;
    color:#111827;
    border:1px solid var(--line);
}

.btn-danger{
    background:var(--danger);
    color:#fff;
}

/* =========================
   TABLES
========================= */
.table-wrap{
    width:100%;
    overflow:auto;
}

.table{
    width:100%;
    border-collapse:collapse;
}

.table th,
.table td{
    padding:13px 14px;
    border-bottom:1px solid var(--line);
    text-align:left;
    vertical-align:middle;
}

.table th{
    font-size:13px;
    color:#6b7280;
    background:#f9fafb;
    font-weight:bold;
}

.table td.monto,
.table th.monto{
    text-align:right;
    white-space:nowrap;
}

/* =========================
   BADGES
========================= */
.badge{
    display:inline-flex;
    align-items:center;
    justify-content:center;
    padding:7px 10px;
    border-radius:999px;
    font-size:12px;
    font-weight:bold;
    background:#f3f4f6;
    color:#111827;
    text-transform:capitalize;
}

.badge.green{
    background:rgba(22,163,74,.12);
    color:#166534;
}

.badge.red{
    background:rgba(239,68,68,.12);
    color:#991b1b;
}

.badge.yellow{
    background:rgba(245,158,11,.14);
    color:#92400e;
}

/* =========================
   FORMS
========================= */
.form-grid{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:16px;
}

.form-group{
    display:flex;
    flex-direction:column;
    gap:7px;
}

.form-group.full{
    grid-column:1 / -1;
}

.form-group label{
    font-size:14px;
    font-weight:bold;
}

.input,
.select,
.textarea{
    width:100%;
    padding:12px 14px;
    border:1px solid #d1d5db;
    border-radius:14px;
    background:#fff;
    color:#111827;
    outline:none;
    transition:border .2s ease, box-shadow .2s ease;
    font:inherit;
}

.input:focus,
.select:focus,
.textarea:focus{
    border-color:#b7dc1f;
    box-shadow:0 0 0 4px rgba(195,236,27,.18);
}

.textarea{
    min-height:110px;
    resize:vertical;
}

.form-actions{
    display:flex;
    gap:10px;
    flex-wrap:wrap;
    margin-top:18px;
}

/* =========================
   ALERTS
========================= */
.alert{
    border-radius:16px;
    padding:14px 16px;
    font-weight:600;
    margin-bottom:16px;
    line-height:1.5;
}

.alert.success{
    background:#dcfce7;
    color:#166534;
    border:1px solid #86efac;
}

.alert.error{
    background:#fee2e2;
    color:#991b1b;
    border:1px solid #fca5a5;
}

.alert.warn{
    background:#fff7ed;
    color:#9a3412;
    border:1px solid #fdba74;
}

/* =========================
   QUICK LINKS
========================= */
.quick-links{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:12px;
}

.quick-link{
    border:1px solid var(--line);
    border-radius:18px;
    padding:16px;
    background:linear-gradient(180deg, #fff 0%, #f9fafb 100%);
    transition:.2s ease;
    min-height:110px;
}

.quick-link:hover{
    transform:translateY(-2px);
    box-shadow:0 10px 24px rgba(15,23,42,.06);
    border-color:#d8dee8;
}

.quick-link strong{
    display:block;
    margin-bottom:6px;
}

.quick-link span{
    color:var(--muted);
    font-size:14px;
    line-height:1.5;
}

/* =========================
   LOGIN BASE
========================= */
.login-wrap{
    min-height:100vh;
    display:flex;
    align-items:center;
    justify-content:center;
    padding:30px;
    background:
        radial-gradient(circle at top left, rgba(195,236,27,.22), transparent 28%),
        linear-gradient(180deg, #eef3f8 0%, #f5f7fb 100%);
}

.login-card{
    width:100%;
    max-width:460px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:26px;
    box-shadow:var(--shadow);
    padding:28px;
}

.login-logo{
    display:flex;
    align-items:center;
    gap:12px;
    margin-bottom:22px;
}

.login-logo .brand-mark{
    width:48px;
    height:48px;
}

.login-card h1{
    margin:0 0 8px;
}

.login-card p{
    margin:0 0 22px;
    color:var(--muted);
}

.login-subtext{
    margin:0 0 24px;
    color:var(--muted);
}

.login-sep{
    height:1px;
    background:var(--line);
    margin:18px 0;
}

.footer-note{
    margin-top:18px;
    font-size:13px;
    color:var(--muted);
    text-align:center;
}

/* =========================
   LOGIN PRO
========================= */
.login-wrap.pro{
    min-height:100vh;
    display:grid;
    grid-template-columns:1.1fr .9fr;
    background:
        radial-gradient(circle at top left, rgba(195,236,27,.18), transparent 28%),
        radial-gradient(circle at bottom right, rgba(17,24,39,.08), transparent 24%),
        linear-gradient(180deg, #eef3f8 0%, #f5f7fb 100%);
}

.login-showcase{
    padding:48px;
    display:flex;
    flex-direction:column;
    justify-content:space-between;
    background:
        linear-gradient(135deg, rgba(15,23,42,.96), rgba(17,24,39,.92)),
        #111827;
    color:#fff;
    position:relative;
    overflow:hidden;
}

.login-showcase::after{
    content:"";
    position:absolute;
    right:-80px;
    top:-80px;
    width:260px;
    height:260px;
    background:radial-gradient(circle, rgba(195,236,27,.24), transparent 70%);
}

.showcase-top{
    position:relative;
    z-index:2;
}

.showcase-tag{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:10px 14px;
    border-radius:999px;
    background:rgba(255,255,255,.08);
    border:1px solid rgba(255,255,255,.08);
    font-size:13px;
    color:#e5e7eb;
    margin-bottom:24px;
}

.showcase-title{
    font-size:54px;
    line-height:.96;
    margin:0 0 16px;
    letter-spacing:-.04em;
    max-width:620px;
}

.showcase-text{
    max-width:540px;
    color:#cbd5e1;
    font-size:16px;
    line-height:1.6;
}

.showcase-cards{
    display:grid;
    grid-template-columns:repeat(2, minmax(0, 1fr));
    gap:14px;
    margin-top:34px;
    max-width:620px;
}

.showcase-card{
    background:rgba(255,255,255,.06);
    border:1px solid rgba(255,255,255,.08);
    border-radius:20px;
    padding:18px;
    backdrop-filter:blur(12px);
}

.showcase-card .mini{
    color:#cbd5e1;
    font-size:13px;
    margin-bottom:8px;
}

.showcase-card .big{
    font-size:28px;
    font-weight:bold;
}

.showcase-bottom{
    position:relative;
    z-index:2;
    display:flex;
    gap:12px;
    flex-wrap:wrap;
}

.login-side{
    display:flex;
    align-items:center;
    justify-content:center;
    padding:32px;
}

.login-card.pro{
    width:100%;
    max-width:460px;
    background:rgba(255,255,255,.88);
    backdrop-filter:blur(16px);
    border:1px solid rgba(229,231,235,.9);
    border-radius:28px;
    box-shadow:0 18px 60px rgba(15,23,42,.12);
    padding:30px;
}

/* =========================
   ASIENTOS PRO
========================= */
.table-editor{
    width:100%;
    border-collapse:separate;
    border-spacing:0;
    overflow:hidden;
    border:1px solid var(--line);
    border-radius:20px;
    background:#fff;
}

.table-editor th,
.table-editor td{
    padding:12px;
    border-bottom:1px solid var(--line);
    vertical-align:middle;
}

.table-editor th{
    background:#f9fafb;
    font-size:13px;
    color:var(--muted);
    text-align:left;
}

.table-editor tr:last-child td{
    border-bottom:none;
}

.table-editor .cell-input,
.table-editor .cell-select{
    width:100%;
    border:1px solid #d1d5db;
    border-radius:12px;
    padding:11px 12px;
    background:#fff;
    outline:none;
    font:inherit;
}

.table-editor .cell-input:focus,
.table-editor .cell-select:focus{
    border-color:#b7dc1f;
    box-shadow:0 0 0 4px rgba(195,236,27,.18);
}

.editor-toolbar{
    display:flex;
    justify-content:space-between;
    align-items:center;
    gap:12px;
    flex-wrap:wrap;
    margin-bottom:16px;
}

.editor-summary{
    display:grid;
    grid-template-columns:repeat(3, minmax(0, 1fr));
    gap:14px;
    margin-top:18px;
}

.editor-summary-card{
    background:linear-gradient(180deg, #fff 0%, #f9fafb 100%);
    border:1px solid var(--line);
    border-radius:18px;
    padding:16px;
}

.editor-summary-card .label{
    font-size:13px;
    color:var(--muted);
    margin-bottom:8px;
}

.editor-summary-card .value{
    font-size:26px;
    font-weight:bold;
}

.editor-status{
    border-radius:16px;
    padding:14px 16px;
    font-weight:bold;
    margin-top:16px;
}

.editor-status.ok{
    background:#dcfce7;
    color:#166534;
    border:1px solid #86efac;
}

.editor-status.bad{
    background:#fee2e2;
    color:#991b1b;
    border:1px solid #fca5a5;
}

.row-actions{
    display:flex;
    gap:8px;
    flex-wrap:wrap;
}

.btn-icon{
    width:40px;
    height:40px;
    border:none;
    border-radius:12px;
    display:inline-flex;
    align-items:center;
    justify-content:center;
    cursor:pointer;
    font-weight:bold;
}

.btn-icon.delete{
    background:rgba(239,68,68,.12);
    color:#991b1b;
}

.btn-soft{
    background:#f3f4f6;
    color:#111827;
    border:1px solid var(--line);
}

/* =========================
   PRINT
========================= */
@media print{
    .sidebar,
    .topbar-actions,
    .btn,
    form{
        display:none !important;
    }

    .main{
        padding:0;
    }

    .page-card,
    .panel,
    .stat-card{
        box-shadow:none !important;
        border:1px solid #ddd !important;
    }

    body,
    html{
        background:#fff !important;
    }
}

/* =========================
   RESPONSIVE
========================= */
@media (max-width: 1100px){
    .stats-grid{
        grid-template-columns:repeat(2, minmax(0, 1fr));
    }

    .content-grid{
        grid-template-columns:1fr;
    }
}

@media (max-width: 980px){
    .login-wrap.pro{
        grid-template-columns:1fr;
    }

    .login-showcase{
        padding:28px;
    }

    .showcase-title{
        font-size:40px;
    }

    .showcase-cards{
        grid-template-columns:1fr;
    }
}

@media (max-width: 860px){
    .app-shell{
        display:block;
    }

    .sidebar{
        position:relative;
        width:100%;
        height:auto;
        border-radius:0 0 24px 24px;
    }

    .main{
        padding:18px;
    }

    .topbar{
        flex-direction:column;
        align-items:flex-start;
    }

    .form-grid{
        grid-template-columns:1fr;
    }

    .stats-grid,
    .quick-links{
        grid-template-columns:1fr;
    }

    .editor-summary{
        grid-template-columns:1fr;
    }
}

@media (max-width: 640px){
    .main{
        padding:14px;
    }

    .topbar{
        padding:14px;
        border-radius:16px;
    }

    .topbar h1{
        font-size:24px;
    }

    .topbar-actions{
        width:100%;
    }

    .topbar-actions .btn{
        width:100%;
    }

    .panel,
    .page-card,
    .stat-card{
        padding:16px;
        border-radius:16px;
    }

    .table th,
    .table td{
        padding:10px 8px;
        font-size:13px;
    }

    .login-wrap{
        padding:16px;
    }

    .login-card,
    .login-card.pro{
        padding:22px;
        border-radius:22px;
    }

    .login-side{
        padding:16px;
    }

    .showcase-title{
        font-size:32px;
    }

    .showcase-text{
        font-size:15px;
    }

    .kpi-inline{
        gap:8px;
    }

    .kpi-pill{
        width:100%;
        justify-content:center;
        text-align:center;
    }
}