:root {
    --nexode-bg: #f4f7f2;
    --nexode-panel: #dfe8dc;
    --nexode-line: #c9d7c5;
    --nexode-primary: #25733d;
    --nexode-primary-dark: #18562c;
    --nexode-soft: #e8f3e8;
    --nexode-ink: #0f172a;
}

body.nexode-admin {
    min-height: 100vh;
    background: var(--nexode-bg) !important;
    color: var(--nexode-ink);
    font-family: "Instrument Sans", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: .9375rem;
    line-height: 1.55;
}

.nexode-admin .app-wrapper {
    display: grid !important;
    grid-template-areas: "nexode-sidebar nexode-main" !important;
    grid-template-columns: 280px minmax(0, 1fr) !important;
    grid-template-rows: minmax(100vh, auto) !important;
    min-height: 100vh;
}

.nexode-admin .app-sidebar {
    position: sticky;
    top: 0;
    grid-area: nexode-sidebar !important;
    display: block !important;
    width: auto !important;
    height: 100vh;
    border-right: 1px solid var(--nexode-line);
    background: var(--nexode-panel) !important;
    box-shadow: none !important;
}

.nexode-admin .sidebar-brand {
    height: auto;
    border: 0;
    padding: 2rem 1.5rem 1rem;
}

.nexode-admin .brand-link {
    display: flex;
    align-items: center;
    gap: .75rem;
    width: auto;
    height: auto;
    padding: 0;
    color: var(--nexode-ink) !important;
    text-decoration: none;
}

.nexode-admin .brand-link::before {
    display: grid;
    width: 2.5rem;
    height: 2.5rem;
    place-items: center;
    border-radius: .8rem;
    background: var(--nexode-primary);
    color: #fff;
    content: "FN";
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: -.04em;
}

.nexode-admin .brand-text { font-size: 1.25rem; font-weight: 600 !important; letter-spacing: -.045em; }
.nexode-admin .sidebar-wrapper { padding: .75rem 1rem 1.5rem; overflow: auto; }
.nexode-admin .nav-header { padding: 1.25rem .75rem .45rem; color: #687568; font-size: .68rem; font-weight: 700; letter-spacing: .18em; }
.nexode-admin .sidebar-menu .nav-item > .nav-link {
    margin: .16rem 0;
    border-radius: 1rem;
    padding: .78rem .9rem;
    color: #334155;
    font-size: .9rem;
    font-weight: 500;
}
.nexode-admin .sidebar-menu .nav-link:hover { background: rgba(255,255,255,.75); color: var(--nexode-primary-dark); }
.nexode-admin .sidebar-menu .nav-link.active { background: var(--nexode-primary); color: #fff; box-shadow: none; }
.nexode-admin .sidebar-menu .nav-icon { width: 1.25rem; margin-right: .45rem; font-size: .88rem; text-align: center; }
.nexode-admin .app-sidebar .nav-treeview > .nav-item > .nav-link { padding-left: 2.25rem; font-size: .84rem; }

.nexode-admin .app-main {
    grid-area: nexode-main !important;
    min-width: 0;
    min-height: 100vh;
    overflow: visible;
    background: transparent;
}
.nexode-admin .app-content-header { margin: 2rem 2.5rem 0; padding: 0; }
.nexode-admin .app-content-header .container-fluid,
.nexode-admin .app-content .container-fluid { max-width: none; padding: 0; }
.nexode-admin .app-content-header .row { align-items: center; min-height: 6.3rem; margin: 0; border: 1px solid var(--nexode-line); border-radius: 2rem; background: #fff; padding: 1.25rem 1.6rem; }
.nexode-admin .app-content-header .col-sm-6 { width: 100%; padding: 0; }
.nexode-admin .app-content-header .col-sm-6:last-child { display: none; }
.nexode-admin .app-content-header h3 { margin: 0; color: var(--nexode-ink); font-size: 1.5rem; font-weight: 600; letter-spacing: -.045em; line-height: 1.15; }
.nexode-admin .app-content-header h3::before { display: block; margin-bottom: .45rem; color: #64748b; content: "PANEL DE OPERACIONES"; font-size: .64rem; font-weight: 600; letter-spacing: .16em; }
.nexode-admin .app-content { padding: 1.5rem 2.5rem 2.5rem; }

.nexode-admin .card, .nexode-admin .small-box {
    overflow: hidden;
    border: 1px solid var(--nexode-line) !important;
    border-radius: 1.65rem !important;
    background: #fff !important;
    box-shadow: 0 18px 50px rgba(15, 23, 42, .055) !important;
}
.nexode-admin .card { margin-bottom: 1.5rem; }
.nexode-admin .card-header, .nexode-admin .card-footer { border-color: #e6ece3; background: transparent; padding: 1.2rem 1.4rem; }
.nexode-admin .card-title { color: var(--nexode-ink); font-size: .98rem; font-weight: 600; letter-spacing: -.02em; }
.nexode-admin .card-body { padding: 1.4rem; }
.nexode-admin .small-box { min-height: 140px; margin-bottom: 1.5rem; color: var(--nexode-ink) !important; }
.nexode-admin .small-box .inner { padding: 1.45rem; }
.nexode-admin .small-box h3 { color: var(--nexode-ink); font-size: 2.15rem; font-weight: 600; letter-spacing: -.055em; }
.nexode-admin .small-box p { color: #64748b; font-size: .85rem; font-weight: 500; }
.nexode-admin .small-box .small-box-icon { color: var(--nexode-panel); font-size: 4.7rem; }

.nexode-admin .btn { border-radius: .9rem; padding: .55rem .9rem; font-size: .84rem; font-weight: 600; letter-spacing: -.01em; }
.nexode-admin .btn-primary { border-color: var(--nexode-primary); background: var(--nexode-primary); }
.nexode-admin .btn-primary, .nexode-admin .btn-primary:hover, .nexode-admin .btn-primary:focus, .nexode-admin .btn-primary:active,
.nexode-admin .btn-success, .nexode-admin .btn-success:hover, .nexode-admin .btn-success:focus, .nexode-admin .btn-success:active,
.nexode-admin .btn-outline-primary:hover, .nexode-admin .btn-outline-primary:focus, .nexode-admin .btn-outline-primary:active {
    color: #fff !important;
}
.nexode-admin .btn-primary:hover, .nexode-admin .btn-primary:focus { border-color: var(--nexode-primary-dark); background: var(--nexode-primary-dark); }
.nexode-admin .btn-outline-primary { border-color: var(--nexode-primary); color: var(--nexode-primary); }
.nexode-admin .btn-outline-primary:hover { background: var(--nexode-primary); }
.nexode-admin .btn-xs { border-radius: .7rem; }
.nexode-admin a { color: var(--nexode-primary-dark); }
.nexode-admin .form-control, .nexode-admin .form-select { border-color: var(--nexode-line); border-radius: .85rem; padding: .62rem .82rem; color: var(--nexode-ink); }
.nexode-admin .form-control:focus, .nexode-admin .form-select:focus { border-color: var(--nexode-primary); box-shadow: 0 0 0 .2rem rgba(37,115,61,.13); }
.nexode-admin .form-label { color: #475569; font-size: .76rem; font-weight: 600; letter-spacing: .01em; }
.nexode-admin .table { --bs-table-bg: transparent; --bs-table-striped-bg: #f7faf6; --bs-table-hover-bg: #f1f7ef; margin-bottom: 0; color: #334155; }
.nexode-admin .table > :not(caption) > * > * { border-bottom-color: #e6ece3; padding: .9rem 1rem; }
.nexode-admin .table thead th { color: #64748b; font-size: .67rem; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; }
.nexode-admin .badge { border-radius: .65rem; padding: .4rem .55rem; font-size: .72rem; font-weight: 600; letter-spacing: .01em; }
.nexode-admin .text-bg-primary { background-color: var(--nexode-primary) !important; }
.nexode-admin .text-bg-success { background-color: #3f7d50 !important; }
.nexode-admin .text-bg-warning { background-color: #bf7c18 !important; color: #fff !important; }
.nexode-admin .text-bg-danger { background-color: #b94b4b !important; }
.nexode-admin .text-bg-info { background-color: #397a8b !important; }
.nexode-admin .border { border-color: var(--nexode-line) !important; }
.nexode-admin .list-group-item { border-color: #e6ece3; padding: 1rem 1.4rem; }
.nexode-admin .alert { border-radius: 1rem; border-width: 1px; }
.nexode-admin .factunexode-token { font-size: .8rem; }
.nexode-admin .text-body-secondary { color: #64748b !important; }
.nexode-admin .small { font-size: .78rem; line-height: 1.5; }
.nexode-admin h1, .nexode-admin h2, .nexode-admin h3, .nexode-admin h4, .nexode-admin h5, .nexode-admin h6 { font-weight: 600; letter-spacing: -.03em; }
.nexode-admin p { text-wrap: pretty; }
.nexode-admin .integration-markdown { max-width: 860px; color: #334155; font-size: .96rem; line-height: 1.75; }
.nexode-admin .integration-markdown h1 { margin: 0 0 1.5rem; font-size: 2rem; }
.nexode-admin .integration-markdown h2 { margin: 2rem 0 .75rem; font-size: 1.25rem; }
.nexode-admin .integration-markdown blockquote { margin: 1.5rem 0; border-left: 3px solid var(--nexode-primary); padding: .8rem 1rem; background: var(--nexode-soft); color: #475569; }

@media (max-width: 991.98px) {
    .nexode-admin .app-wrapper { display: block !important; }
    .nexode-admin .app-sidebar { position: sticky; top: 0; z-index: 1030; height: auto; border-right: 0; border-bottom: 1px solid var(--nexode-line); }
    .nexode-admin .sidebar-brand { display: flex; align-items: center; justify-content: space-between; padding: .7rem 1rem; }
    .nexode-admin .brand-link::before { width: 2rem; height: 2rem; border-radius: .65rem; font-size: .62rem; }
    .nexode-admin .brand-text { font-size: 1.08rem; }
    .nexode-admin .mobile-admin-menu { display: inline-flex; align-items: center; gap: .45rem; border-color: var(--nexode-line); background: #fff; color: var(--nexode-ink); }
    .nexode-admin .sidebar-wrapper { max-height: calc(100vh - 4rem); padding: .35rem .8rem .9rem; overflow-y: auto; background: var(--nexode-panel); }
    .nexode-admin .sidebar-menu { display: block; white-space: normal; }
    .nexode-admin .sidebar-menu .nav-header { display: block; padding-top: .8rem; }
    .nexode-admin .sidebar-menu .nav-treeview { display: block; }
    .nexode-admin .sidebar-menu .nav-item { display: block; }
    .nexode-admin .app-content-header { margin: .75rem .75rem 0; }
    .nexode-admin .app-content { padding: .9rem .75rem 1.5rem; }
}

.mobile-admin-menu { display: none; }

@media (max-width: 575.98px) {
    .nexode-admin .app-content-header .row { min-height: 0; border-radius: 1rem; padding: .8rem 1rem; }
    .nexode-admin .app-content-header h3 { font-size: 1.12rem; }
    .nexode-admin .app-content-header h3::before { display: none; }
    .nexode-admin .card, .nexode-admin .small-box { border-radius: 1.25rem !important; }
}
