:root {
    --horus-navy: #173f4d;
    --horus-navy-2: #0f5360;
    --horus-blue: #2d7480;

    --horus-green: #67bf5b;
    --horus-green-2: #8ad36e;
    --horus-green-soft: #eaf6e7;

    --horus-mint: #dff3ec;
    --horus-cream: #f8f7f1;

    --horus-white: #ffffff;
    --horus-text: #26424a;
    --horus-muted: #788f94;
    --horus-border: #dbe7e4;

    --shadow-sm: 0 8px 24px rgba(34, 75, 82, .08);
    --shadow-md: 0 18px 50px rgba(34, 75, 82, .12);

    --radius-sm: 12px;
    --radius-md: 20px;
    --radius-lg: 30px;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
    font-family: "Open Sans", sans-serif;
    color: var(--horus-text);
}

body {
    min-height: 100vh;
    background:
        linear-gradient(
            180deg,
            #f9fbf9 0%,
            #f3f8f5 100%
        );
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: "Poppins", sans-serif;
    color: var(--horus-navy);
}

a {
    color: inherit;
}

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

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

.horus-login-page {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 1.08fr .92fr;
    background: var(--horus-white);
}

.horus-login-visual {
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    padding: 68px 70px;
    color: white;

    background:
        radial-gradient(
            circle at 18% 17%,
            rgba(138, 211, 110, .32),
            transparent 24%
        ),
        radial-gradient(
            circle at 84% 72%,
            rgba(103, 191, 91, .20),
            transparent 30%
        ),
        linear-gradient(
            140deg,
            #173f4d 0%,
            #145762 50%,
            #226a70 100%
        );
}

.horus-login-visual::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .15;
    background-image:
        radial-gradient(circle at 10px 10px, white 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image:
        linear-gradient(to bottom right, #000 0%, transparent 72%);
}

.horus-login-visual::after {
    content: "";
    position: absolute;
    width: 520px;
    height: 520px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 50%;
    right: -210px;
    top: -180px;
}

.horus-brand-content {
    position: relative;
    z-index: 5;
    max-width: 610px;
}

.horus-brand-logo {
    width: 290px;
    max-width: 80%;
    margin-bottom: 55px;
}

.horus-brand-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    padding: 9px 16px;
    margin-bottom: 24px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 999px;
    background: rgba(255, 255, 255, .08);
    backdrop-filter: blur(6px);
    font-size: 13px;
    font-weight: 600;
}

.horus-brand-title {
    margin: 0;
    color: white;
    font-size: clamp(40px, 4.4vw, 64px);
    line-height: 1.04;
    font-weight: 650;
    letter-spacing: -.03em;
}

.horus-brand-title span {
    color: var(--horus-green-2);
}

.horus-brand-copy {
    margin: 26px 0 0;
    max-width: 540px;
    color: rgba(255, 255, 255, .85);
    line-height: 1.8;
    font-size: 17px;
}

.horus-brand-line {
    width: 90px;
    height: 5px;
    margin-top: 36px;
    background: var(--horus-green-2);
    border-radius: 999px;
}

.horus-leaf {
    position: absolute;
    background: rgba(138, 211, 110, .14);
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 100% 0 100% 0;
    transform: rotate(38deg);
}

.horus-leaf.one {
    width: 170px;
    height: 110px;
    bottom: -35px;
    left: -28px;
}

.horus-leaf.two {
    width: 95px;
    height: 60px;
    bottom: 45px;
    left: 82px;
    transform: rotate(71deg);
}

.horus-login-panel {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 52px;
    background:
        radial-gradient(
            circle at 95% 10%,
            rgba(103, 191, 91, .10),
            transparent 28%
        ),
        #ffffff;
}

.horus-login-card {
    width: min(440px, 100%);
}

.horus-login-mobile-logo {
    display: none;
}

.horus-login-heading {
    margin: 0 0 10px;
    font-size: 35px;
    font-weight: 650;
    letter-spacing: -.02em;
}

.horus-login-subheading {
    margin: 0 0 36px;
    color: var(--horus-muted);
    line-height: 1.7;
    font-size: 15px;
}

.horus-field {
    margin-bottom: 21px;
}

.horus-label {
    display: block;
    margin-bottom: 9px;
    color: var(--horus-navy);
    font-size: 13px;
    font-weight: 700;
}

.horus-input-wrap {
    position: relative;
}

.horus-input {
    width: 100%;
    height: 56px;
    padding: 0 17px;
    border: 1px solid var(--horus-border);
    border-radius: 15px;
    outline: none;
    background: #fbfdfc;
    color: var(--horus-text);
    font-size: 15px;
    transition: .2s ease;
}

.horus-input::placeholder {
    color: #a8b8bb;
}

.horus-input:focus {
    background: white;
    border-color: var(--horus-green);
    box-shadow:
        0 0 0 4px rgba(103, 191, 91, .12);
}

.horus-login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 3px 0 28px;
    gap: 15px;
    font-size: 13px;
}

.horus-check {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--horus-muted);
}

.horus-check input {
    width: 16px;
    height: 16px;
    accent-color: var(--horus-green);
}

.horus-link {
    color: var(--horus-navy-2);
    font-weight: 700;
    text-decoration: none;
}

.horus-link:hover {
    text-decoration: underline;
}

.horus-btn-primary {
    width: 100%;
    height: 56px;
    border: none;
    border-radius: 15px;
    cursor: pointer;
    color: white;
    font-weight: 700;
    font-size: 15px;
    background:
        linear-gradient(
            135deg,
            #72c95f 0%,
            #54b54f 100%
        );
    box-shadow:
        0 12px 28px rgba(83, 179, 78, .22);
    transition: .2s ease;
}

.horus-btn-primary:hover {
    transform: translateY(-1px);
    box-shadow:
        0 16px 30px rgba(83, 179, 78, .28);
}

.horus-alert-error {
    padding: 13px 15px;
    margin-bottom: 22px;
    border-radius: 13px;
    background: #fff5f5;
    border: 1px solid #f1cece;
    color: #ad3f3f;
    font-size: 13px;
    line-height: 1.6;
}

.horus-login-footer {
    margin-top: 38px;
    color: #9aacaf;
    font-size: 11px;
    text-align: center;
}

/* =========================================================
   APP BASE
   ========================================================= */

.horus-app {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 270px 1fr;
}

.horus-sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 26px 18px;
    overflow-y: auto;
    color: white;
    background:
        linear-gradient(
            180deg,
            var(--horus-navy) 0%,
            #124d57 100%
        );
}

.horus-sidebar-logo {
    width: 205px;
    max-width: 100%;
    margin: 8px 10px 34px;
}

.horus-nav-title {
    padding: 0 14px 8px;
    color: rgba(255, 255, 255, .42);
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: .11em;
    font-weight: 700;
}

.horus-nav-link {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 46px;
    margin-bottom: 5px;
    padding: 0 14px;
    border-radius: 13px;
    color: rgba(255,255,255,.80);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: .2s ease;
}

.horus-nav-link:hover,
.horus-nav-link.active {
    color: white;
    background: rgba(255,255,255,.10);
}

.horus-nav-dot {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--horus-green-2);
}

.horus-main {
    min-width: 0;
}

.horus-topbar {
    height: 78px;
    padding: 0 32px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(255,255,255,.92);
    border-bottom: 1px solid #e5ecea;
    backdrop-filter: blur(8px);
}

.horus-company-pill {
    padding: 10px 15px;
    border-radius: 12px;
    background: var(--horus-green-soft);
    color: var(--horus-navy);
    font-size: 13px;
    font-weight: 700;
}

.horus-top-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.horus-btn-soft {
    border: 1px solid var(--horus-border);
    border-radius: 11px;
    padding: 9px 14px;
    background: white;
    color: var(--horus-navy);
    cursor: pointer;
    font-weight: 600;
}

.horus-page {
    padding: 30px 32px 42px;
}

.horus-page-title {
    margin: 0;
    font-size: 30px;
    font-weight: 650;
}

.horus-page-subtitle {
    margin: 8px 0 0;
    color: var(--horus-muted);
}

/* =========================================================
   DASHBOARD
   ========================================================= */

.horus-kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 18px;
    margin-top: 28px;
}

.horus-card {
    background: white;
    border: 1px solid var(--horus-border);
    border-radius: 20px;
    box-shadow: var(--shadow-sm);
}

.horus-kpi-card {
    padding: 22px;
}

.horus-kpi-label {
    margin-bottom: 12px;
    color: var(--horus-muted);
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.horus-kpi-value {
    color: var(--horus-navy);
    font-family: "Poppins", sans-serif;
    font-size: 30px;
    font-weight: 650;
}

.horus-kpi-foot {
    margin-top: 7px;
    color: var(--horus-green);
    font-size: 12px;
    font-weight: 700;
}

.horus-dashboard-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: 20px;
    margin-top: 20px;
}

.horus-panel-card {
    padding: 24px;
}

.horus-card-title {
    margin: 0;
    font-size: 17px;
    font-weight: 650;
}

.horus-card-subtitle {
    margin: 5px 0 0;
    color: var(--horus-muted);
    font-size: 13px;
}

/* =========================================================
   SELECTOR EMPRESA
   ========================================================= */

.horus-selector-page {
    min-height: 100vh;
    padding: 42px;
    background:
        radial-gradient(
            circle at 90% 0%,
            rgba(103,191,91,.12),
            transparent 26%
        ),
        #f5f8f5;
}

.horus-selector-container {
    max-width: 1160px;
    margin: auto;
}

.horus-selector-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 42px;
}

.horus-selector-logo {
    max-width: 220px;
}

.horus-selector-heading {
    margin: 0;
    font-size: 33px;
}

.horus-selector-subheading {
    color: var(--horus-muted);
    margin-top: 8px;
}

.horus-company-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 30px;
}

.horus-company-card {
    position: relative;
    overflow: hidden;
    padding: 26px;
    border: 1px solid var(--horus-border);
    border-radius: 22px;
    background: white;
    box-shadow: var(--shadow-sm);
}

.horus-company-card::after {
    content: "";
    position: absolute;
    width: 90px;
    height: 90px;
    right: -25px;
    bottom: -28px;
    border-radius: 50%;
    background: var(--horus-green-soft);
}

.horus-company-code {
    position: relative;
    z-index: 2;
    color: var(--horus-green);
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}

.horus-company-name {
    position: relative;
    z-index: 2;
    margin: 9px 0 9px;
    font-size: 20px;
}

.horus-company-desc {
    position: relative;
    z-index: 2;
    min-height: 58px;
    color: var(--horus-muted);
    line-height: 1.6;
    font-size: 13px;
}

@media (max-width: 1050px) {
    .horus-kpi-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .horus-dashboard-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 900px) {
    .horus-login-page {
        display: block;
    }

    .horus-login-visual {
        display: none;
    }

    .horus-login-panel {
        min-height: 100vh;
        padding: 30px 22px;
    }

    .horus-login-mobile-logo {
        display: block;
        max-width: 210px;
        margin-bottom: 35px;
    }

    .horus-app {
        grid-template-columns: 1fr;
    }

    .horus-sidebar {
        display: none;
    }
}

@media (max-width: 600px) {
    .horus-kpi-grid {
        grid-template-columns: 1fr;
    }

    .horus-page {
        padding: 24px 18px;
    }

    .horus-topbar {
        padding: 0 18px;
    }
}

/* HORUS - Navegacion jerarquica y estilos compartidos para modulos */
.horus-nav-group{margin:8px 0}.horus-nav-group summary{list-style:none;cursor:pointer;user-select:none}.horus-nav-group summary::-webkit-details-marker{display:none}.horus-nav-toggle{justify-content:space-between}.horus-nav-chevron{margin-left:auto;font-size:20px;transition:transform .2s}.horus-nav-group[open]>.horus-nav-toggle .horus-nav-chevron{transform:rotate(180deg)}.horus-nav-group[open]>.horus-nav-toggle{background:rgba(255,255,255,.09);color:white}.horus-nav-children{margin:2px 0 12px 13px;padding-left:9px;border-left:1px solid rgba(255,255,255,.2)}.horus-nav-children .horus-nav-link{min-height:39px;padding:8px 10px;font-size:13px;line-height:1.35}.horus-nav-disabled{opacity:.55;cursor:not-allowed}
.horus-module{max-width:1200px;margin:0 auto}.horus-module h1{font-size:29px;margin:0 0 12px}.horus-module h2{font-size:21px;margin:24px 0 14px}.horus-module h3{font-size:17px;margin:18px 0 10px}.horus-module h4{font-size:15px;margin:15px 0 9px}.horus-module p,.horus-module li{line-height:1.65}.horus-module a{color:var(--horus-navy-2);font-weight:600}.horus-module>div,.horus-module>section{max-width:100%}.horus-module section,.horus-module form:not([method=GET]){border-radius:var(--radius-sm)}.horus-module section{background:white;border:1px solid var(--horus-border)!important;box-shadow:var(--shadow-sm);padding:22px!important;margin:20px 0!important}.horus-module form{display:flex;flex-wrap:wrap;align-items:end;gap:15px;margin:15px 0 24px}.horus-module form label{display:flex;flex:1 1 210px;flex-direction:column;gap:7px;color:var(--horus-navy);font-weight:700;font-size:13px}.horus-module input,.horus-module select,.horus-module textarea{width:100%;min-height:42px;border:1px solid var(--horus-border);border-radius:11px;padding:10px 12px;background:white;color:var(--horus-text);font-size:14px}.horus-module textarea{min-height:85px}.horus-module input:focus,.horus-module select:focus,.horus-module textarea:focus{outline:2px solid var(--horus-green);outline-offset:1px}.horus-module button[type=submit]{background:var(--horus-navy-2);color:white;border:0;border-radius:11px;min-height:42px;padding:10px 19px;cursor:pointer;font-weight:700}.horus-module button[type=submit]:hover{background:var(--horus-navy)}.horus-module table{width:100%;border-collapse:collapse;background:white;min-width:540px}.horus-module table th{background:var(--horus-green-soft);color:var(--horus-navy);text-align:left;font-size:13px}.horus-module table td,.horus-module table th{padding:13px 12px;border-bottom:1px solid var(--horus-border);vertical-align:top}.horus-module table tbody tr:hover{background:#f8fbf9}.horus-module .horus-table-scroll{overflow-x:auto;border:1px solid var(--horus-border);border-radius:var(--radius-sm);background:white;margin:16px 0}.horus-module .horus-module-card{background:white;border:1px solid var(--horus-border);border-radius:var(--radius-md);box-shadow:var(--shadow-sm);padding:22px;margin:20px 0}.horus-module .horus-module-card>form{margin-bottom:0}.horus-module .horus-module-card h2:first-child{margin-top:0}.horus-module .horus-module-alert{padding:13px 16px;border:1px solid #f1c4c4;background:#fff0f0;color:#8a2626;border-radius:11px;margin:16px 0}.horus-module .horus-module-alert ul{margin-bottom:0}.horus-module .horus-module-lead{color:var(--horus-muted);margin:0 0 18px}.horus-module .horus-module-header{display:flex;justify-content:space-between;align-items:center;gap:15px;flex-wrap:wrap;margin-bottom:20px}.horus-module .horus-module-header h1{margin:0}.horus-module .horus-module-header a{text-decoration:none}.horus-module .horus-module-back{display:inline-block;margin-bottom:14px}.horus-module ul{padding-left:22px}@media(max-width:700px){.horus-module h1{font-size:24px}.horus-module form{display:block}.horus-module form label{margin-bottom:13px}.horus-module form button{margin-top:8px}.horus-module section{padding:15px!important}}

/* Horus Exequial: componentes accesibles, ayudas y formularios de mantenimiento */
.horus-module.horus-exq .horus-module-card{background:#fff;border:1px solid var(--horus-border);border-radius:16px;padding:24px;margin:20px 0;box-shadow:var(--shadow-sm)}
.horus-exq .exq-form{display:grid!important;grid-template-columns:repeat(auto-fit,minmax(195px,1fr));gap:16px;align-items:end;margin:16px 0}
.horus-exq .exq-form label{display:block;min-width:0;font-weight:700;color:var(--horus-navy);font-size:13px}
.horus-exq .exq-form label input,.horus-exq .exq-form label select{display:block;width:100%;margin-top:7px;box-sizing:border-box}
.horus-exq .exq-form button[type=submit]{background:var(--horus-navy-2);color:#fff;border:0;border-radius:10px;padding:12px 15px;min-height:43px;cursor:pointer;font-weight:700}
.horus-exq .exq-record{padding:18px 0;border-bottom:1px solid var(--horus-border)}
.horus-exq .exq-record-title{display:flex;align-items:center;gap:12px;flex-wrap:wrap}
.horus-exq .exq-status{background:var(--horus-green-soft);padding:4px 10px;border-radius:20px;font-size:12px;font-weight:700}
.horus-exq .exq-add{border:1px dashed var(--horus-border);border-radius:12px;padding:15px;margin-top:20px}
.horus-exq .exq-add summary{font-weight:700;color:var(--horus-navy-2);cursor:pointer}
.horus-exq .exq-success{padding:12px 16px;background:#e5f5e9;border-radius:10px;margin:12px 0}
.exq-help-wrap{display:inline-block;position:relative;margin-left:5px;vertical-align:middle}
.exq-help-button{display:inline-flex;align-items:center;justify-content:center;width:19px;height:19px;min-height:0!important;padding:0!important;border:1px solid var(--horus-navy-2)!important;border-radius:50%!important;background:transparent!important;color:var(--horus-navy-2)!important;font-size:12px;font-weight:800;cursor:pointer}
.exq-help-pop{position:absolute;z-index:40;top:26px;left:0;width:260px;max-width:75vw;padding:12px 14px;border-radius:10px;background:#fff;color:var(--horus-text);border:1px solid var(--horus-border);box-shadow:0 6px 22px #0002;font-size:12px;line-height:1.5;font-weight:400}
.exq-help-pop[hidden]{display:none!important}
@media(max-width:700px){.horus-exq .exq-form{grid-template-columns:1fr}.horus-module.horus-exq .horus-module-card{padding:16px}}
