:root {
    color-scheme: dark;
    --bg: #05080e;
    --panel: rgba(13, 19, 31, .74);
    --panel-solid: #0d131f;
    --line: rgba(255, 255, 255, .10);
    --text: #f7f9fc;
    --muted: #9da9ba;
    --blue: #27a7ff;
    --cyan: #55ddff;
    --yellow: #f6b414;
    --danger: #ff5a6b;
    --success: #38d996;
    --radius: 24px;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background:
        radial-gradient(circle at 15% 10%, rgba(39, 167, 255, .18), transparent 35%),
        radial-gradient(circle at 85% 85%, rgba(246, 180, 20, .10), transparent 32%),
        var(--bg);
    color: var(--text);
}

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

a {
    color: inherit;
}

.internal-login-page {
    display: grid;
    place-items: center;
    padding: 30px;
    overflow: hidden;
}

.internal-login-page::before {
    content: "";
    position: fixed;
    inset: 0;
    opacity: .18;
    background-image:
        linear-gradient(rgba(255,255,255,.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,.04) 1px, transparent 1px);
    background-size: 50px 50px;
    pointer-events: none;
}

.login-shell {
    width: min(440px, 100%);
    position: relative;
    z-index: 1;
}

.login-brand {
    display: flex;
    justify-content: center;
    margin-bottom: 26px;
}

.login-brand img {
    width: 132px;
    height: 132px;
    object-fit: contain;
    filter: drop-shadow(0 20px 35px rgba(0,0,0,.45));
}

.login-card {
    padding: 38px;
    border: 1px solid var(--line);
    border-radius: 30px;
    background: rgba(8, 13, 22, .82);
    backdrop-filter: blur(24px);
    box-shadow: 0 35px 90px rgba(0,0,0,.45);
}

.eyebrow {
    display: inline-block;
    color: var(--yellow);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .18em;
}

.login-card h1,
.dashboard-title h1 {
    margin: 12px 0 8px;
    font-size: clamp(2rem, 5vw, 3.4rem);
    line-height: 1;
}

.login-card p,
.dashboard-title p {
    color: var(--muted);
}

.login-card form {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.login-card label {
    display: grid;
    gap: 9px;
    color: #dce4ef;
    font-size: .9rem;
}

.login-card input,
.dashboard-tools input,
.dashboard-tools select,
.record-card select,
.record-card textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: rgba(255,255,255,.055);
    color: var(--text);
    outline: none;
    transition: .25s ease;
}

.login-card input {
    min-height: 52px;
    padding: 0 16px;
}

.login-card input:focus,
.dashboard-tools input:focus,
.dashboard-tools select:focus,
.record-card select:focus,
.record-card textarea:focus {
    border-color: rgba(39, 167, 255, .8);
    box-shadow: 0 0 0 4px rgba(39, 167, 255, .12);
}

.primary-button,
.ghost-button,
.small-button,
.download-button {
    border: 0;
    cursor: pointer;
    transition: transform .2s ease, filter .2s ease, background .2s ease;
}

.primary-button {
    min-height: 54px;
    border-radius: 16px;
    background: linear-gradient(135deg, var(--blue), var(--cyan));
    color: #03111a;
    font-weight: 900;
}

.primary-button:hover,
.small-button:hover,
.download-button:hover {
    transform: translateY(-2px);
    filter: brightness(1.08);
}

.form-message {
    min-height: 22px;
    margin: 0 !important;
    color: var(--danger) !important;
    text-align: center;
}

.return-link {
    display: block;
    margin-top: 20px;
    color: var(--muted);
    text-align: center;
    text-decoration: none;
}

.dashboard-header {
    min-height: 82px;
    padding: 14px clamp(18px, 4vw, 60px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    border-bottom: 1px solid var(--line);
    background: rgba(5, 8, 14, .78);
    backdrop-filter: blur(24px);
    position: sticky;
    top: 0;
    z-index: 10;
}

.dashboard-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    text-decoration: none;
    font-weight: 800;
}

.dashboard-brand img {
    width: 54px;
    height: 54px;
    object-fit: contain;
}

.dashboard-brand span {
    display: grid;
}

.dashboard-brand small {
    color: var(--yellow);
    font-size: .65rem;
    letter-spacing: .18em;
}

.dashboard-actions {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--muted);
}

.ghost-button {
    padding: 11px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: rgba(255,255,255,.05);
    color: var(--text);
}

.dashboard-main {
    width: min(1500px, calc(100% - 36px));
    margin: 0 auto;
    padding: 54px 0 80px;
}

.dashboard-title {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 30px;
    margin-bottom: 30px;
}

.dashboard-tools {
    width: min(570px, 100%);
    display: grid;
    grid-template-columns: 1fr 190px;
    gap: 12px;
}

.dashboard-tools input,
.dashboard-tools select {
    min-height: 48px;
    padding: 0 15px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 15px;
    margin-bottom: 24px;
}

.summary-card {
    padding: 20px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: var(--panel);
    backdrop-filter: blur(18px);
}

.summary-card strong {
    display: block;
    margin-top: 8px;
    font-size: 2rem;
}

.summary-card span {
    color: var(--muted);
    font-size: .83rem;
}

.records-grid {
    display: grid;
    gap: 16px;
}

.record-card {
    padding: 24px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--panel);
    backdrop-filter: blur(22px);
    box-shadow: 0 22px 55px rgba(0,0,0,.20);
}

.record-head {
    display: flex;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 18px;
}

.record-head h2 {
    margin: 0 0 5px;
    font-size: 1.25rem;
}

.record-reference {
    color: var(--yellow);
    font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
    font-size: .8rem;
}

.status-badge {
    height: fit-content;
    padding: 7px 11px;
    border-radius: 100px;
    background: rgba(39,167,255,.13);
    color: #8ed4ff;
    font-size: .73rem;
    font-weight: 800;
    text-transform: uppercase;
}

.record-fields {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
}

.record-field {
    padding: 13px;
    border-radius: 14px;
    background: rgba(255,255,255,.045);
}

.record-field small {
    display: block;
    color: var(--muted);
    margin-bottom: 4px;
}

.record-controls {
    display: grid;
    grid-template-columns: 190px 1fr auto;
    gap: 10px;
    margin-top: 18px;
}

.record-card select,
.record-card textarea {
    min-height: 45px;
    padding: 11px 13px;
}

.record-card textarea {
    resize: vertical;
    min-height: 45px;
    max-height: 130px;
}

.small-button {
    padding: 0 18px;
    border-radius: 13px;
    background: var(--yellow);
    color: #161000;
    font-weight: 900;
}

.files-row {
    display: flex;
    flex-wrap: wrap;
    gap: 9px;
    margin-top: 16px;
}

.download-button {
    display: inline-flex;
    padding: 10px 13px;
    border-radius: 12px;
    background: rgba(39,167,255,.14);
    color: #a6ddff;
    text-decoration: none;
    font-size: .82rem;
}

.empty-state {
    padding: 70px 25px;
    border: 1px dashed var(--line);
    border-radius: var(--radius);
    color: var(--muted);
    text-align: center;
}

@media (max-width: 900px) {
    .dashboard-title {
        align-items: stretch;
        flex-direction: column;
    }

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

    .record-fields {
        grid-template-columns: repeat(2, 1fr);
    }

    .record-controls {
        grid-template-columns: 1fr;
    }

    .small-button {
        min-height: 46px;
    }
}

@media (max-width: 580px) {
    .dashboard-header {
        align-items: flex-start;
    }

    #session-user {
        display: none;
    }

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

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

    .login-card {
        padding: 28px 22px;
    }
}


/* =========================================================
   GRUPO SKR - PANELES INTERNOS RESPONSIVE
   Optimizado para iPhone / Android / Safari / Chrome / Firefox
   Desktop permanece intacto
   ========================================================= */

@media (max-width: 768px) {

    html {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
        overflow-x: hidden;
    }

    body {
        overflow-x: hidden;
        font-size: 16px;
    }

    /* ---------- LOGIN ---------- */

    .internal-login-page {
        min-height: 100svh;
        padding: 22px 16px;
        overflow-y: auto;
    }

    .login-shell {
        width: min(100%, 460px);
    }

    .login-brand {
        margin-bottom: 18px;
    }

    .login-brand img {
        width: 104px;
        height: 104px;
    }

    .login-card {
        padding: 30px 24px;
        border-radius: 24px;
    }

    .login-card h1 {
        font-size: clamp(2rem, 9vw, 2.8rem);
        line-height: 1.05;
    }

    .login-card p {
        font-size: 1rem;
        line-height: 1.55;
    }

    .login-card label {
        font-size: .95rem;
    }

    .login-card input {
        min-height: 54px;
        font-size: 16px;
    }

    .primary-button {
        min-height: 54px;
        font-size: 1rem;
    }

    /* ---------- HEADER PANEL ---------- */

    .dashboard-header {
        min-height: auto;
        padding: 12px 16px;
        gap: 12px;
    }

    .dashboard-brand {
        gap: 10px;
        min-width: 0;
    }

    .dashboard-brand img {
        width: 46px;
        height: 46px;
        flex: 0 0 auto;
    }

    .dashboard-brand span {
        min-width: 0;
        font-size: .95rem;
    }

    .dashboard-brand small {
        font-size: .6rem;
    }

    .dashboard-actions {
        gap: 8px;
        flex: 0 0 auto;
    }

    .ghost-button {
        min-height: 44px;
        padding: 10px 13px;
        white-space: nowrap;
        font-size: .88rem;
    }

    /* ---------- CONTENIDO ---------- */

    .dashboard-main {
        width: calc(100% - 24px);
        padding: 32px 0 60px;
    }

    .dashboard-title {
        margin-bottom: 22px;
        gap: 20px;
    }

    .dashboard-title h1 {
        font-size: clamp(2rem, 9vw, 3rem);
        line-height: 1.02;
        overflow-wrap: anywhere;
    }

    .dashboard-title p {
        font-size: 1rem;
        line-height: 1.55;
    }

    .eyebrow {
        font-size: .72rem;
        line-height: 1.4;
    }

    /* ---------- BUSCADOR / FILTROS ---------- */

    .dashboard-tools {
        width: 100%;
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .dashboard-tools input,
    .dashboard-tools select {
        width: 100%;
        min-height: 50px;
        padding: 0 14px;
        font-size: 16px;
    }

    /* ---------- RESUMEN ---------- */

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
        margin-bottom: 18px;
    }

    .summary-card {
        padding: 16px;
        border-radius: 17px;
    }

    .summary-card strong {
        font-size: 1.7rem;
    }

    .summary-card span {
        font-size: .82rem;
        line-height: 1.35;
    }

    /* ---------- TARJETAS DE CANDIDATOS ---------- */

    .records-grid {
        gap: 14px;
    }

    .record-card {
        padding: 18px;
        border-radius: 20px;
    }

    .record-head {
        gap: 12px;
        margin-bottom: 15px;
        align-items: flex-start;
    }

    .record-head h2 {
        font-size: 1.2rem;
        line-height: 1.2;
        overflow-wrap: anywhere;
    }

    .record-reference {
        font-size: .74rem;
        overflow-wrap: anywhere;
    }

    .status-badge {
        flex: 0 0 auto;
        font-size: .69rem;
        padding: 7px 9px;
    }

    .record-fields {
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .record-field {
        padding: 13px;
        min-width: 0;
    }

    .record-field,
    .record-field * {
        overflow-wrap: anywhere;
        word-break: break-word;
    }

    .record-field small {
        font-size: .78rem;
    }

    /* ---------- CONTROLES ---------- */

    .record-controls {
        grid-template-columns: 1fr;
        gap: 9px;
        margin-top: 15px;
    }

    .record-card select,
    .record-card textarea {
        width: 100%;
        font-size: 16px;
        min-height: 50px;
    }

    .record-card textarea {
        min-height: 100px;
        max-height: 220px;
    }

    .small-button {
        width: 100%;
        min-height: 48px;
        padding: 0 16px;
        font-size: .95rem;
    }

    /* ---------- ARCHIVOS / CV ---------- */

    .files-row {
        display: grid;
        grid-template-columns: 1fr;
        gap: 8px;
        margin-top: 14px;
    }

    .download-button {
        width: 100%;
        min-height: 46px;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 11px 13px;
        font-size: .88rem;
        text-align: center;
        overflow-wrap: anywhere;
    }

    .empty-state {
        padding: 45px 18px;
        font-size: .95rem;
    }
}


@media (max-width: 480px) {

    .internal-login-page {
        padding: 16px 12px;
    }

    .login-brand img {
        width: 88px;
        height: 88px;
    }

    .login-card {
        padding: 25px 18px;
        border-radius: 21px;
    }

    .dashboard-header {
        align-items: center;
        padding: 10px 12px;
    }

    .dashboard-brand img {
        width: 42px;
        height: 42px;
    }

    .dashboard-brand span {
        font-size: .88rem;
    }

    .dashboard-actions {
        margin-left: auto;
    }

    #session-user {
        display: none;
    }

    .ghost-button {
        min-height: 42px;
        padding: 9px 11px;
        font-size: .8rem;
    }

    .dashboard-main {
        width: calc(100% - 18px);
        padding-top: 26px;
    }

    .dashboard-title h1 {
        font-size: clamp(1.85rem, 10vw, 2.55rem);
    }

    .summary-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 8px;
    }

    .summary-card {
        padding: 14px;
    }

    .summary-card strong {
        font-size: 1.55rem;
    }

    .record-card {
        padding: 15px;
        border-radius: 18px;
    }

    .record-head {
        flex-direction: column;
    }

    .status-badge {
        align-self: flex-start;
    }

    .record-card select,
    .record-card textarea,
    .dashboard-tools input,
    .dashboard-tools select {
        font-size: 16px;
    }
}


@media (max-width: 360px) {

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

    .dashboard-brand small {
        display: none;
    }

    .dashboard-brand span {
        font-size: .82rem;
    }
}

