:root {
    --bg: #d7dbe2;
    --navy: #12284a;
    --navy-strong: #0b1832;
    --blue: #2b7bc0;
    --blue-soft: #dfeaf6;
    --border: #8b8f99;
    --panel: #ffffff;
    --panel-soft: #f2f4f7;
    --text: #2f3f58;
    --muted: #667487;
    --success: #1d9b5d;
    --danger: #b91f2f;
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    width: 100%;
    height: 100%;
}

body {
    font-family: Tahoma, Arial, sans-serif;
    color: var(--text);
    background: #cfd3da;
    overflow: auto;
}

img {
    display: block;
    max-width: 100%;
}

a {
    color: inherit;
    text-decoration: none;
}

input,
button {
    font: inherit;
}

.fixed-body {
    min-width: 1310px;
    min-height: 710px;
}

.fixed-app {
    width: 1300px;
    height: 700px;
    margin: 5px auto 0;
    border: 1px solid #3a4862;
    background: var(--panel-soft);
    overflow: hidden;
}

.login-body {
    background: #dfe3ea;
}

.login-app {
    display: grid;
    grid-template-columns: 620px 680px;
}

.login-left {
    padding: 42px 46px;
    background: linear-gradient(180deg, #f9fbfd 0%, #eef2f7 100%);
}

.login-logo-box {
    width: 420px;
    height: 210px;
    margin: 0 auto 28px;
    border: 1px solid #c7d0db;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-box img {
    width: 340px;
}

.login-form-card {
    width: 100%;
    border: 1px solid #bcc5d0;
    background: #fff;
    padding: 28px 30px 32px;
}

.login-links {
    margin-top: 16px;
    font-size: 14px;
}

.login-links a {
    color: #1a62a4;
    text-decoration: underline;
    font-weight: 700;
}

.login-heading h1,
.hero-copy-wrap h2,
.module-stage-header h3 {
    margin: 0;
    font-size: 34px;
    line-height: 1.05;
    color: #15253d;
}

.login-heading p,
.hero-copy-wrap p,
.topbar-meta span,
.empty-state p,
.crud-note,
.permission-help {
    color: var(--muted);
}

.login-kicker,
.section-kicker,
.topbar-label {
    display: inline-block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--blue);
}

.login-form {
    margin-top: 24px;
    display: grid;
    gap: 16px;
}

.login-form label {
    display: grid;
    gap: 7px;
    font-weight: 700;
}

.login-form input {
    height: 46px;
    border: 1px solid #a7b0bb;
    padding: 0 14px;
    background: #fff;
}

.primary-button {
    width: 180px;
    height: 44px;
    border: 1px solid #0f4d7e;
    background: linear-gradient(180deg, #2f84cd 0%, #1963a2 100%);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.alert-error {
    padding: 10px 12px;
    border: 1px solid #d8a8af;
    background: #fcedf0;
    color: var(--danger);
}

.alert-ok {
    padding: 10px 12px;
    border: 1px solid #a8c9b6;
    background: #e8f6ef;
    color: #0f6a3b;
    font-weight: 700;
}

.login-right {
    /* Ajustes manuales (login lado derecho) */
    --ek-login-hero-top: 10px;          /* separacion desde arriba */
    --ek-login-title-size: 54px;        /* "Detecta hoy..." */
    --ek-login-title-line: 1.02;        /* interlineado del titulo */
    --ek-login-title-letter: -0.4px;    /* tracking del titulo */
    --ek-login-body-top: 16px;          /* separacion titulo -> cuerpo */
    --ek-login-body-size: 18px;         /* texto descriptivo */
    --ek-login-body-line: 1.35;
    --ek-login-body-width: 520px;       /* ancho maximo del texto */
    --ek-login-logo-width: 310px;       /* logosistemamain.png */
    --ek-login-logo-bottom: 0px;        /* empuje extra hacia arriba/abajo */

    background: linear-gradient(160deg, #112849 0%, #193a68 100%);
    color: #fff;
    padding: 52px 54px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.login-right .login-kicker {
    color: #c5dbf5;
}

.login-right h2 {
    margin: 0;
    font-size: 42px;
    line-height: 1.05;
}

.login-right p {
    max-width: 460px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 18px;
}

.ek-login-hero {
    margin-top: var(--ek-login-hero-top);
}

.ek-login-hero-title {
    font-size: var(--ek-login-title-size);
    line-height: var(--ek-login-title-line);
    letter-spacing: var(--ek-login-title-letter);
}

.ek-login-hero-body {
    margin-top: var(--ek-login-body-top);
    max-width: var(--ek-login-body-width);
    font-size: var(--ek-login-body-size);
    line-height: var(--ek-login-body-line);
    color: rgba(255, 255, 255, 0.78);
}

.ek-login-hero-brand {
    margin-bottom: 40px;
    margin-left: 180px;
}

.ek-login-hero-logo {
    width: var(--ek-login-logo-width);
}

.login-side-brand {
    align-self: flex-end;
}

.login-side-brand img {
    width: 235px;
}

.app-shell {
    display: grid;
    grid-template-columns: 205px 1095px;
}

.sidebar {
    background: var(--navy);
    color: #fff;
    padding: 8px 8px 0;
}

.sidebar-brand {
    height: 72px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-left: 2px;
}

.sidebar-brand img {
    width: 185px;
}

.sidebar-nav {
    display: grid;
    gap: 4px;
}

.nav-item {
    min-height: 50px;
    border: 1px solid #7e8590;
    background: #f1f2f4;
    color: #27364f;
    text-align: left;
    font-size: 16px;
    font-weight: 700;
    padding: 10px 12px;
    cursor: pointer;
}

.nav-item.is-active {
    background: #82848b;
    color: #fff;
}

.app-main {
    background: #eceff3;
    display: flex;
    flex-direction: column;
}

.topbar {
    height: 66px;
    background: var(--navy);
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 14px 0 18px;
}

.topbar-title-wrap h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 700;
}

.topbar-label {
    margin-bottom: 2px;
    color: rgba(255, 255, 255, 0.72);
}

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

.topbar-meta {
    text-align: right;
    margin-right: 10px;
}

.topbar-meta strong,
.topbar-meta span {
    display: block;
    font-size: 12px;
}

.topbar-action {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
}

.topbar-logout {
    height: 30px;
    padding: 0 12px;
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.34);
    background: rgba(255, 255, 255, 0.06);
    color: #fff;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    user-select: none;
}

.topbar-logout:hover {
    background: rgba(255, 255, 255, 0.12);
}

.topbar-logout:active {
    transform: translateY(1px);
}

.topbar-logout-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
}

.topbar-logout-text {
    position: relative;
    top: 1px; /* microajuste visual */
}

.workspace {
    height: calc(700px - 66px);
    padding: 4px;
    display: flex;
    flex-direction: column;
}

.hero-banner,
.module-stage {
    border: 1px solid #8f96a2;
    background: #fff;
}

.module-stage {
    height: 100%;
}

#module-content {
    height: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.hero-banner {
    display: grid;
    grid-template-columns: 1fr 330px;
    overflow: hidden;
}

.hero-copy-wrap {
    padding: 18px 20px;
}

.hero-copy-wrap h2 {
    font-size: 28px;
}

.hero-visual {
    background: linear-gradient(180deg, #edf3fb 0%, #dae8f7 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.hero-visual img {
    width: 360px;
    max-width: none;
    opacity: 0.92;
}

.module-stage {
    padding: 4px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

.module-view {
    height: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.overview-grid {
    height: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.overview-card,
.catalog-card,
.help-card {
    border: 1px solid #a9b0bc;
    background: #f8fafc;
    padding: 16px;
}

.overview-card h4,
.catalog-card h4,
.help-card h4 {
    margin: 0 0 8px;
    font-size: 20px;
    color: #17385d;
}

.overview-card ul,
.help-card ul {
    margin: 12px 0 0 18px;
    padding: 0;
    line-height: 1.7;
}

.catalog-card {
    display: flex;
    flex-direction: column;
    padding: 0;
}

.catalogos-grid-shell {
    margin-top: 0;
    height: 100%;
    flex: 1;
    min-height: 0;
}

.ekad-shell {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ekad-topbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #a9b0bc;
    background: #f2f4f7;
    padding: 6px 10px;
    margin-bottom: 6px;
}

.ekad-company {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 800;
    color: #17385d;
}

.ekad-select {
    height: 26px;
    border: 1px solid #a7b0bb;
    background: #fff;
    padding: 0 8px;
    font-weight: 700;
}

.ekad-upload {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ekad-file-input {
    display: none;
}

.ekad-file-btn {
    width: 170px;
    height: 44px;
    font-size: 14px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.02em;   
}

.ekad-file-name {
    max-width: 320px;
    font-size: 12px;
    color: #2f3f58;
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ekad-summary {
    border: 1px solid #a9b0bc;
    background: #ffffff;
    padding: 6px 10px;
    position: relative;
}

.ekad-summary-row {
    display: grid;
    grid-template-columns: 1.4fr 1fr 1fr 0.8fr;
    gap: 10px;
    padding: 2px 0;
    font-size: 12px;
}

.ekad-review-btn {
    position: absolute;
    right: 10px;
    top: 10px;
    width: 130px;
    height: 44px;
    font-size: 14px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.02em; 
}

.ekad-upload-btn {
    font-size: 14px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.02em;  
}

.ekad-summary {
    /* Reserve space for the "Revisar Datos" button, but keep the 4th column wide enough */
    padding-right: 170px;
}

.ekad-summary-row {
    grid-template-columns: 1.15fr 0.85fr 0.85fr 1fr;
    gap: 6px;
}

.ekad-summary-row > div {
    min-width: 0;
}

.ekad-summary-row > div:nth-child(3),
.ekad-summary-row > div:nth-child(4) {
    white-space: nowrap;
}

.ekad-msg {
    margin-top: 6px;
    font-size: 12px;
    color: #2f3f58;
}

.ekad-table-wrap {
    flex: 1;
    min-height: 0;
    margin-top: 6px;
    border: 1px solid #a9b0bc;
    background: #ffffff;
    overflow: hidden;
}

.ekad-pdf-shell {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.ekad-pdf-toolbar {
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 10px;
    border-bottom: 1px solid #a9b0bc;
    background: #f2f4f7;
    color: #17385d;
    font-weight: 800;
}

.ekad-pdf-download {
    width: 130px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    font-size: 14px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: 0.02em; 
}

.ekad-pdf-download[aria-disabled="true"] {
    opacity: 0.55;
    pointer-events: none;
}

.ekad-pdf-view {
    flex: 1;
    min-height: 0;
    position: relative;
    background: #fff;
}

.ekad-pdf-frame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.ekad-pdf-empty {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    padding: 10px;
    background: transparent;
}

.ek-review-title {
    font-weight: 900;
    margin: 4px 0 6px;
    color: #17385d;
}

.ek-review-modal {
    width: 1288px;
}

.ek-review-body {
    max-height: 600px;
    overflow: auto;
    background: #fff;
}

.ek-review .empresa-table th,
.ek-review .empresa-table td {
    white-space: nowrap;
}

.ek-review .empresa-table {
    font-size: 11px;
}

.ek-review .empresa-table th,
.ek-review .empresa-table td {
    padding-left: 8px;
    padding-right: 8px;
}

.ek-loading {
    width: 260px;
    border: 1px solid #6a7485;
    background: #f3f5f8;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
    padding: 18px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.ek-spinner {
    width: 18px;
    height: 18px;
    border: 3px solid #c9d2de;
    border-top-color: #2b7bc0;
    border-radius: 50%;
    animation: ekspin 0.9s linear infinite;
}

@keyframes ekspin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

.ek-loading-text {
    font-weight: 800;
    color: #2f3f58;
}

.empresa-grid {
    border: 1px solid #a9b0bc;
    background: #fff;
    box-shadow: inset 0 0 0 1px #f1f3f6;
}

.empresa-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 3px 10px;
    border-bottom: 1px solid #a9b0bc;
    background: #f2f4f7;
}

.empresa-toolbar strong {
    display: inline-block;
    margin-right: 10px;
    color: #17385d;
    font-size: 15px;
}

.empresa-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 11px;
}

.empresa-table th,
.empresa-table td {
    border-bottom: 1px solid #d1d6de;
    padding: 4.5px 10px;
    text-align: left;
    line-height: 1.05;
}

.empresa-table th {
    background: #f7f9fb;
    color: #2f3f58;
    font-weight: 700;
    padding-top: 5px;
    padding-bottom: 5px;
}

.empresa-table tbody tr:nth-child(even) td {
    background: #f8fafc;
}

.empresa-table tr:hover td {
    background: #f4f7fb;
}

.empresa-table td:last-child,
.empresa-table th:last-child {
    text-align: center;
}

.empresa-table td:last-child .secondary-button {
    width: 68px;
    height: 18px;
    font-size: 10px;
}

.ek-modal-backdrop {
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999;
}

.ek-modal-backdrop.is-hidden {
    display: none;
}

.ek-modal {
    width: 520px;
    border: 1px solid #6a7485;
    background: #f3f5f8;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35);
}

/* Must be after `.ek-modal` so it wins in the cascade */
.ek-modal.ek-review-modal {
    width: 1288px;
    max-width: 1288px;
    height: 670px;
    display: flex;
    flex-direction: column;
}

.ek-modal-body.ek-review-body {
    /* Slightly tighter padding to gain visible area */
    padding: 12px 14px 10px;
    flex: 1;
    max-height: none;
    overflow: auto;
}

.ek-modal-header {
    height: 44px;
    padding: 0 12px;
    background: var(--navy);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ek-modal-close {
    width: 28px;
    height: 28px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.ek-modal-body {
    padding: 16px 16px 10px;
    background: #fff;
    border-top: 1px solid #6a7485;
    border-bottom: 1px solid #c8ced9;
}

.ek-modal-label {
    display: block;
    margin-bottom: 8px;
    font-weight: 700;
    color: #2f3f58;
}

.ek-modal-input {
    width: 100%;
    height: 34px;
    border: 1px solid #a7b0bb;
    padding: 0 10px;
    font-size: 14px;
    background: #fff;
}

.ek-modal-error {
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid #d8a8af;
    background: #fcedf0;
    color: var(--danger);
    font-weight: 700;
}

.ek-modal-error.is-hidden {
    display: none;
}

.ek-modal-footer {
    padding: 10px 12px;
    background: #f3f5f8;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.ek-user-modal {
    width: 760px;
}

.ek-user-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px 14px;
}

.ek-pass-row {
    display: grid;
    grid-template-columns: 1fr 102px;
    gap: 10px;
    align-items: center;
}

.ek-check {
    display: inline-flex;
    gap: 8px;
    align-items: center;
    margin-top: 12px;
    font-weight: 700;
    color: #2f3f58;
}

.user-table td:last-child .secondary-button {
    width: 72px;
    height: 18px;
    font-size: 10px;
    margin: 0 4px;
}

.user-table td:last-child .user-send {
    width: 132px;
}

.icon-mail::before {
    content: "@";
    display: inline-block;
    width: 14px;
    text-align: center;
    margin-right: 6px;
    font-weight: 900;
    color: #2b7bc0;
}

.user-inactive {
    display: inline-block;
    width: 14px;
    height: 14px;
    line-height: 14px;
    border-radius: 50%;
    background: #fcedf0;
    border: 1px solid #d8a8af;
    color: #b91f2f;
    font-weight: 900;
    font-size: 11px;
}

.user-inactive--spacer {
    background: transparent;
    border-color: transparent;
    color: transparent;
}

.user-table td:first-child {
    white-space: nowrap;
}

/* Zebra explícito para Usuarios (pinta el row completo). */
.user-table tbody tr:nth-child(odd) {
    background: #ffffff;
}

.user-table tbody tr:nth-child(even) {
    background: #f8fafc;
}

.user-table tbody tr td {
    background: transparent;
}

.ek-send-modal {
    width: 520px;
}

.ek-send-body {
    text-align: center;
    padding: 26px 16px 18px;
}

.ek-send-name {
    font-size: 22px;
    font-weight: 800;
    color: #2f3f58;
    margin-top: 6px;
}

.ek-send-email {
    font-size: 18px;
    color: #667487;
    margin-top: 4px;
}

.ek-result-modal {
    width: 520px;
}

.ek-result-body {
    text-align: center;
    padding: 26px 16px 18px;
}

.ek-result-msg {
    font-size: 28px;
    font-weight: 900;
    color: #2f3f58;
}

.catalog-card img {
    width: 250px;
    justify-self: end;
}

.users-crud {
    height: 100%;
    display: grid;
    grid-template-rows: 226px 208px 56px;
    gap: 10px;
}

.users-top {
    display: grid;
    grid-template-columns: 1fr 325px;
    gap: 10px;
}

.users-main-fields,
.users-account-box,
.users-permissions-box {
    border: 1px solid #8a9099;
    background: #fff;
}

.users-main-fields {
    padding: 12px 14px;
}

.field-grid {
    display: grid;
    grid-template-columns: 108px 1fr;
    row-gap: 8px;
    column-gap: 12px;
    align-items: center;
}

.field-grid label {
    text-align: right;
    font-size: 15px;
    color: #42506a;
}

.field-grid input {
    height: 27px;
    border: 1px solid #b6bcc6;
    padding: 0 8px;
    font-size: 14px;
    background: #fff;
}

.field-grid input.highlight {
    border: 2px solid #b52025;
}

.inline-note {
    margin-left: 8px;
    font-size: 12px;
    color: #58677d;
}

.short-input {
    width: 100px;
}

.medium-input {
    width: 430px;
}

.users-account-box {
    display: grid;
    grid-template-rows: 46px 1fr;
}

.check-header {
    background: #6f6f72;
    color: #fff;
    padding: 10px 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 700;
}

.check-header label,
.permission-columns label,
.permission-item {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.account-inner {
    padding: 14px;
}

.account-grid {
    display: grid;
    grid-template-columns: 102px 1fr;
    row-gap: 10px;
    column-gap: 10px;
    align-items: center;
}

.account-grid label {
    text-align: right;
    font-size: 16px;
}

.account-grid input {
    height: 28px;
    border: 2px solid #b52025;
    padding: 0 8px;
}

.generate-row {
    margin-top: 14px;
    display: grid;
    grid-template-columns: 102px 1fr;
    gap: 10px;
    align-items: start;
}

.secondary-button {
    width: 102px;
    height: 28px;
    border: 1px solid #9da4ad;
    background: linear-gradient(180deg, #f8fafc 0%, #dfe3e9 100%);
    color: #39475b;
    font-weight: 700;
    cursor: pointer;
}

.permission-help {
    margin: 0;
    font-size: 12px;
    line-height: 1.35;
}

.users-permissions-box {
    overflow: hidden;
}

.box-title {
    height: 36px;
    background: #6f6f72;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.permission-columns {
    height: calc(100% - 36px);
    padding: 12px 10px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
}

.permission-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
    font-size: 15px;
}

.permission-item.sub-item {
    margin-left: 22px;
}

.users-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.save-button,
.cancel-button {
    min-width: 110px;
    height: 32px;
    border: 1px solid #9ba2ab;
    font-weight: 400;
    cursor: pointer;
}

.save-button {
    background: linear-gradient(180deg, #3790d8 0%, #206ea9 100%);
    color: #fff;
}

.cancel-button {
    background: linear-gradient(180deg, #fbfbfc 0%, #e4e7eb 100%);
    color: #5a6573;
}

.empty-state {
    height: 100%;
    border: 1px dashed #98a0ac;
    background: #f7f9fb;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}
