:root {
    --ledm-navy: #061d38;
    --ledm-navy-2: #082747;
    --ledm-blue: #2f66e9;
    --ledm-blue-hover: #2759d3;

    --bg: #f4f7fb;
    --card: #ffffff;

    --text: #101828;
    --text-soft: #667085;
    --text-light: #98a2b3;

    --border: #dfe7f1;
    --border-soft: #edf1f6;

    --green: #039855;
    --green-bg: #ecfdf3;

    --orange: #dc6803;
    --orange-bg: #fff6ed;

    --red: #d92d20;
    --red-bg: #fef3f2;

    --blue-bg: #eff4ff;

    --sidebar-width: 216px;
    --topbar-height: 72px;

    --radius: 14px;
    --shadow: 0 1px 3px rgba(16,24,40,.06);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
}

body {
    font-family:
        Inter,
        "Segoe UI",
        Arial,
        Helvetica,
        sans-serif;

    background: var(--bg);
    color: var(--text);
    font-size: 14px;
}

button,
input,
select,
textarea {
    font: inherit;
}

a {
    color: inherit;
}

.ledm-app {
    min-height: 100vh;
}

/* =====================================================
   SIDEBAR
===================================================== */

.ledm-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;

    width: var(--sidebar-width);

    background: var(--ledm-navy);
    color: #fff;

    display: flex;
    flex-direction: column;

    z-index: 1000;

    overflow-y: auto;
    overflow-x: hidden;
}

.sidebar-brand {
    min-height: 96px;

    padding: 18px 14px;

    display: flex;
    align-items: center;
    gap: 10px;

    border-bottom:
        1px solid rgba(255,255,255,.08);
}

.sidebar-brand-logo {
    width: 38px;
    height: 38px;

    background: #fff;

    border-radius: 9px;

    display: flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 38px;

    overflow: hidden;
}

.sidebar-brand-logo img {
    width: 34px;
    height: 34px;
    object-fit: contain;
}

.sidebar-brand-text {
    min-width: 0;
}

.sidebar-brand-title {
    font-size: 13px;
    font-weight: 800;
    line-height: 1.2;
}

.sidebar-brand-subtitle {
    margin-top: 4px;

    color: rgba(255,255,255,.58);

    font-size: 9px;
    line-height: 1.35;
}

.sidebar-navigation {
    padding: 15px 10px 20px;
}

.sidebar-section {
    margin: 14px 8px 7px;

    color: rgba(255,255,255,.36);

    font-size: 9px;
    font-weight: 800;

    letter-spacing: 1.4px;

    text-transform: uppercase;
}

.sidebar-link,
.sidebar-toggle {
    width: 100%;

    border: 0;
    background: transparent;

    color: rgba(255,255,255,.82);

    text-decoration: none;

    display: flex;
    align-items: center;
    gap: 10px;

    padding: 10px 11px;

    border-radius: 8px;

    margin: 2px 0;

    font-size: 12px;
    font-weight: 600;

    cursor: pointer;

    text-align: left;

    transition: .16s ease;
}

.sidebar-link:hover,
.sidebar-toggle:hover {
    background: rgba(255,255,255,.08);
    color: #fff;
}

.sidebar-link.active,
.sidebar-toggle.active {
    background: var(--ledm-blue);
    color: #fff;
}

.sidebar-link.disabled {
    opacity: .40;
    cursor: default;
}

.sidebar-link.disabled:hover {
    background: transparent;
}

.sidebar-icon {
    width: 18px;

    flex: 0 0 18px;

    text-align: center;

    font-size: 15px;
}

.sidebar-label {
    flex: 1;
}

.sidebar-chevron {
    font-size: 11px;
    opacity: .65;

    transition: transform .2s ease;
}

.sidebar-toggle.open .sidebar-chevron {
    transform: rotate(180deg);
}

.sidebar-submenu {
    display: none;

    padding-left: 20px;

    margin-bottom: 5px;
}

.sidebar-submenu.open {
    display: block;
}

.sidebar-submenu .sidebar-link {
    font-size: 11px;
    padding: 8px 10px;
}

.sidebar-user {
    margin-top: auto;

    border-top:
        1px solid rgba(255,255,255,.08);

    padding: 14px 12px;
}

.sidebar-user-box {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sidebar-avatar {
    width: 34px;
    height: 34px;

    border-radius: 9px;

    background: rgba(255,255,255,.10);

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 12px;
    font-weight: 800;

    flex: 0 0 34px;
}

.sidebar-user-info {
    min-width: 0;
}

.sidebar-user-name {
    color: #fff;

    font-size: 10px;
    font-weight: 800;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.sidebar-user-role {
    margin-top: 3px;

    font-size: 8px;
    color: rgba(255,255,255,.55);
}

/* =====================================================
   MAIN
===================================================== */

.ledm-main {
    margin-left: var(--sidebar-width);

    min-height: 100vh;
}

.ledm-topbar {
    height: var(--topbar-height);

    background: #fff;

    border-bottom: 1px solid var(--border);

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0 24px;

    position: sticky;
    top: 0;

    z-index: 900;
}

.topbar-left {
    display: flex;
    align-items: center;
    gap: 12px;
}

.mobile-menu-button {
    display: none;

    width: 38px;
    height: 38px;

    border-radius: 9px;

    border: 1px solid var(--border);

    background: #fff;

    align-items: center;
    justify-content: center;

    cursor: pointer;
}

.topbar-back {
    width: 32px;
    height: 32px;

    border: 1px solid var(--border);

    border-radius: 8px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #475467;

    background: #fff;

    text-decoration: none;
}

.topbar-module-title {
    font-size: 12px;
    font-weight: 800;
}

.topbar-module-subtitle {
    margin-top: 2px;

    font-size: 9px;

    color: var(--text-soft);
}

.topbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.system-status {
    display: flex;
    align-items: center;
    gap: 6px;

    color: var(--text-soft);

    font-size: 9px;
}

.system-status-dot {
    width: 7px;
    height: 7px;

    background: #12b76a;

    border-radius: 50%;
}

.topbar-user {
    display: flex;
    align-items: center;
    gap: 9px;
}

.topbar-avatar {
    width: 32px;
    height: 32px;

    border-radius: 9px;

    background: var(--ledm-blue);

    color: #fff;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 11px;
    font-weight: 800;
}

.topbar-user-name {
    max-width: 190px;

    font-size: 10px;
    font-weight: 800;

    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.topbar-user-role {
    margin-top: 2px;

    color: var(--text-soft);

    font-size: 8px;
}

.logout-button {
    border: 0;

    background: transparent;

    color: #667085;

    cursor: pointer;

    font-size: 11px;

    padding: 5px;
}

/* =====================================================
   CONTENIDO
===================================================== */

.ledm-content {
    padding: 0;
}

.page-heading {
    background: #fff;

    padding: 20px 24px 18px;

    border-bottom: 1px solid var(--border);
}

.page-title {
    margin: 0;

    font-size: 21px;
    font-weight: 800;

    letter-spacing: -.4px;

    color: #101828;
}

.page-subtitle {
    margin-top: 5px;

    color: var(--text-soft);

    font-size: 11px;
}

.page-body {
    padding: 20px 24px 32px;
}

/* =====================================================
   CARDS
===================================================== */

.panel {
    background: var(--card);

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    overflow: hidden;
}

.panel + .panel {
    margin-top: 18px;
}

.panel-header {
    min-height: 42px;

    padding: 12px 16px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-bottom: 1px solid var(--border);
}

.panel-title {
    font-size: 10px;
    font-weight: 800;

    color: #475467;

    text-transform: uppercase;

    letter-spacing: .25px;
}

.panel-subtitle {
    margin-top: 4px;

    font-size: 10px;

    color: var(--text-soft);
}

.panel-body {
    padding: 18px;
}

/* =====================================================
   RESUMEN / ESTADISTICAS
===================================================== */

.summary-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0,1fr));
}

.summary-item {
    padding: 18px 15px;

    text-align: center;

    border-right: 1px solid var(--border-soft);
}

.summary-item:last-child {
    border-right: 0;
}

.summary-label {
    color: #475467;

    font-size: 9px;

    text-transform: uppercase;

    font-weight: 800;
}

.summary-number {
    margin-top: 8px;

    font-size: 22px;

    font-weight: 800;

    color: var(--ledm-blue);
}

.summary-number.green {
    color: var(--green);
}

.summary-number.orange {
    color: var(--orange);
}

.summary-number.red {
    color: var(--red);
}

.stats-grid {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0,1fr));

    gap: 14px;
}

.stat-card {
    background: #fff;

    border: 1px solid var(--border);

    border-radius: 13px;

    padding: 16px;

    box-shadow: var(--shadow);
}

.stat-card-label {
    color: #667085;

    font-size: 9px;

    font-weight: 800;

    text-transform: uppercase;
}

.stat-card-value {
    margin-top: 8px;

    color: var(--ledm-blue);

    font-size: 27px;

    font-weight: 800;
}

.stat-card-help {
    margin-top: 4px;

    color: #98a2b3;

    font-size: 9px;
}

/* =====================================================
   TOOLBAR
===================================================== */

.toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 14px;
}

.toolbar-left,
.toolbar-right {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* =====================================================
   BOTONES
===================================================== */

.btn {
    border: 0;

    border-radius: 8px;

    padding: 9px 13px;

    font-size: 10px;
    font-weight: 800;

    cursor: pointer;

    text-decoration: none;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    gap: 6px;

    transition: .15s ease;
}

.btn-primary {
    background: var(--ledm-blue);
    color: #fff;
}

.btn-primary:hover {
    background: var(--ledm-blue-hover);
}

.btn-secondary {
    background: #fff;

    border: 1px solid var(--border);

    color: #344054;
}

.btn-success {
    background: var(--green);
    color: #fff;
}

.btn-warning {
    background: #f79009;
    color: #fff;
}

.btn-danger {
    background: var(--red);
    color: #fff;
}

.btn-light-blue {
    background: var(--blue-bg);
    color: #2f5ec4;
}

/* =====================================================
   TABLE
===================================================== */

.table-container {
    width: 100%;

    overflow-x: auto;
}

.ledm-table {
    width: 100%;

    border-collapse: collapse;

    min-width: 950px;
}

.ledm-table th {
    padding: 10px 12px;

    border-bottom: 1px solid var(--border);

    background: #f8fafc;

    color: #667085;

    font-size: 8px;

    text-align: left;

    text-transform: uppercase;

    letter-spacing: .25px;

    font-weight: 800;

    white-space: nowrap;
}

.ledm-table td {
    padding: 11px 12px;

    border-bottom: 1px solid var(--border-soft);

    color: #344054;

    font-size: 10px;

    vertical-align: middle;
}

.ledm-table tr:last-child td {
    border-bottom: 0;
}

.ledm-table tbody tr:hover {
    background: #fafcff;
}

.cell-primary {
    color: #101828;
    font-weight: 800;
}

.cell-secondary {
    margin-top: 2px;

    color: #98a2b3;

    font-size: 8px;
}

/* =====================================================
   BADGES
===================================================== */

.badge {
    display: inline-flex;
    align-items: center;

    border-radius: 20px;

    padding: 4px 8px;

    font-size: 8px;

    font-weight: 800;
}

.badge-blue {
    background: var(--blue-bg);
    color: #3157b7;
}

.badge-green {
    background: var(--green-bg);
    color: var(--green);
}

.badge-orange {
    background: var(--orange-bg);
    color: var(--orange);
}

.badge-red {
    background: var(--red-bg);
    color: var(--red);
}

.badge-gray {
    background: #f2f4f7;
    color: #475467;
}

/* =====================================================
   FORMULARIOS
===================================================== */

.form-card {
    background: #fff;

    border: 1px solid var(--border);

    border-radius: var(--radius);

    box-shadow: var(--shadow);

    max-width: 940px;
}

.form-card-header {
    padding: 16px 18px;

    border-bottom: 1px solid var(--border);
}

.form-card-title {
    margin: 0;

    font-size: 13px;

    font-weight: 800;
}

.form-card-subtitle {
    margin-top: 4px;

    color: var(--text-soft);

    font-size: 10px;
}

.form-card-body {
    padding: 18px;
}

.form-grid {
    display: grid;

    grid-template-columns:
        repeat(2,minmax(0,1fr));

    gap: 15px 18px;
}

.form-group label {
    display: block;

    margin-bottom: 6px;

    color: #344054;

    font-size: 10px;

    font-weight: 800;
}

.form-control {
    width: 100%;

    height: 38px;

    border: 1px solid #d0d5dd;

    border-radius: 8px;

    padding: 0 11px;

    color: #101828;

    background: #fff;

    outline: none;

    font-size: 11px;
}

textarea.form-control {
    min-height: 90px;

    height: auto;

    padding-top: 10px;

    resize: vertical;
}

.form-control:focus {
    border-color: #84adff;

    box-shadow:
        0 0 0 3px rgba(47,102,233,.08);
}

.form-actions {
    margin-top: 20px;

    padding-top: 16px;

    border-top: 1px solid var(--border-soft);

    display: flex;
    gap: 8px;
}

.form-note {
    margin-top: 16px;

    background: #f5f8ff;

    border: 1px solid #dce7ff;

    border-radius: 8px;

    padding: 10px 12px;

    color: #475467;

    font-size: 9px;

    line-height: 1.5;
}

/* =====================================================
   ALERTAS
===================================================== */

.alert {
    margin-bottom: 14px;

    border-radius: 9px;

    padding: 11px 13px;

    font-size: 10px;

    border: 1px solid;
}

.alert-success {
    background: var(--green-bg);
    border-color: #abefc6;
    color: #05603a;
}

.alert-warning {
    background: var(--orange-bg);
    border-color: #fedf89;
    color: #93370d;
}

.alert-danger {
    background: var(--red-bg);
    border-color: #fecdca;
    color: #912018;
}

.password-box {
    border: 1px solid #fedf89;

    background: #fffaeb;

    border-radius: 10px;

    padding: 14px;

    margin-bottom: 16px;
}

.password-box-title {
    font-size: 10px;
    font-weight: 800;
    color: #93370d;
}

.password-value {
    margin-top: 9px;

    font-size: 20px;

    font-weight: 800;

    color: #101828;

    letter-spacing: 1px;
}

/* =====================================================
   EMPTY
===================================================== */

.empty-state {
    padding: 42px 20px;

    text-align: center;

    color: #98a2b3;

    font-size: 11px;
}

/* =====================================================
   PAGINACION
===================================================== */

.pagination-wrap {
    padding: 13px 15px;

    border-top: 1px solid var(--border);
}

/* =====================================================
   LOGIN
===================================================== */

.auth-page {
    min-height: 100vh;

    display: grid;

    grid-template-columns: 1.2fr .8fr;

    background: #fff;
}

.auth-brand {
    background:
        linear-gradient(
            145deg,
            #061d38,
            #0b3158
        );

    color: #fff;

    padding: 65px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    position: relative;

    overflow: hidden;
}

.auth-brand::after {
    content: "";

    position: absolute;

    width: 440px;
    height: 440px;

    border-radius: 50%;

    border:
        70px solid rgba(255,255,255,.025);

    right: -190px;
    bottom: -200px;
}

.auth-brand-logo {
    width: 72px;
    height: 72px;

    background: #fff;

    border-radius: 14px;

    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-brand-logo img {
    width: 64px;
    height: 64px;
    object-fit: contain;
}

.auth-brand h1 {
    margin:
        28px 0 8px;

    font-size: 34px;

    font-weight: 800;
}

.auth-brand p {
    max-width: 470px;

    color: rgba(255,255,255,.62);

    font-size: 13px;

    line-height: 1.7;
}

.auth-form-side {
    display: flex;
    align-items: center;
    justify-content: center;

    padding: 35px;
}

.auth-form-card {
    width: 100%;

    max-width: 390px;
}

.auth-form-card h2 {
    margin: 0;

    font-size: 23px;

    font-weight: 800;
}

.auth-form-help {
    margin: 7px 0 25px;

    color: var(--text-soft);

    font-size: 11px;

    line-height: 1.5;
}

.auth-field {
    margin-bottom: 15px;
}

.auth-field label {
    display: block;

    margin-bottom: 6px;

    color: #344054;

    font-size: 10px;

    font-weight: 800;
}

.auth-field input {
    width: 100%;

    height: 42px;

    border:
        1px solid #d0d5dd;

    border-radius: 8px;

    padding: 0 12px;

    outline: none;
}

.auth-field input:focus {
    border-color: #84adff;

    box-shadow:
        0 0 0 3px rgba(47,102,233,.08);
}

.auth-submit {
    width: 100%;

    height: 42px;

    border: 0;

    border-radius: 8px;

    background: var(--ledm-blue);

    color: #fff;

    font-weight: 800;

    cursor: pointer;
}

.auth-footer {
    margin-top: 25px;

    color: #98a2b3;

    font-size: 9px;

    text-align: center;
}

/* =====================================================
   RESPONSIVE
===================================================== */

.mobile-overlay {
    display: none;
}

@media(max-width:1000px) {

    .stats-grid {
        grid-template-columns:
            repeat(2,minmax(0,1fr));
    }

}

@media(max-width:800px) {

    .ledm-sidebar {
        transform: translateX(-100%);
        transition: transform .2s ease;
    }

    .ledm-sidebar.open {
        transform: translateX(0);
    }

    .mobile-overlay {
        display: none;

        position: fixed;

        inset: 0;

        background: rgba(15,23,42,.45);

        z-index: 990;
    }

    .mobile-overlay.open {
        display: block;
    }

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

    .mobile-menu-button {
        display: flex;
    }

    .system-status {
        display: none;
    }

    .topbar-user-info {
        display: none;
    }

    .page-heading {
        padding: 18px;
    }

    .page-body {
        padding: 16px;
    }

    .form-grid {
        grid-template-columns: 1fr;
    }

    .summary-grid {
        grid-template-columns: 1fr;
    }

    .summary-item {
        border-right: 0;
        border-bottom: 1px solid var(--border-soft);
    }

    .summary-item:last-child {
        border-bottom: 0;
    }

    .auth-page {
        grid-template-columns: 1fr;
    }

    .auth-brand {
        display: none;
    }

}

@media(max-width:580px) {

    .stats-grid {
        grid-template-columns: 1fr;
    }

    .toolbar {
        align-items: stretch;
        flex-direction: column;
    }

    .toolbar-right {
        justify-content: flex-start;
    }

}
