:root {
    --primary: #172968;
    --secondary: #117bb8;
    --white: #ffffff;
    --menu: #191919;
    --text: #1d2433;
    --muted: #667085;
    --line: rgba(23, 41, 104, 0.14);
    --glass: rgba(255, 255, 255, 0.78);
    --shadow: 0 24px 70px rgba(23, 41, 104, 0.18);
    --radius: 8px;
}

* {
    box-sizing: border-box;
}

body {
    min-height: 100vh;
    margin: 0;
    font-family: 'Exo', sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(17, 123, 184, 0.14), transparent 34rem),
        linear-gradient(135deg, #f7fbff 0%, #ffffff 46%, #eef6fb 100%);
}

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

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

code {
    padding: 0.18rem 0.35rem;
    border-radius: 6px;
    background: rgba(23, 41, 104, 0.08);
    color: var(--primary);
}

.glass-panel {
    border: 1px solid rgba(255, 255, 255, 0.65);
    background: var(--glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    box-shadow: var(--shadow);
}

.auth-page {
    display: grid;
    place-items: center;
    padding: 2rem;
}

.login-layout {
    width: min(1120px, 100%);
    display: grid;
    grid-template-columns: minmax(0, 1.15fr) minmax(340px, 0.85fr);
    gap: 1.5rem;
    align-items: stretch;
}

.login-hero,
.login-card,
.install-shell {
    border-radius: var(--radius);
}

.login-hero {
    min-height: 570px;
    padding: clamp(2rem, 5vw, 4rem);
    color: var(--white);
    background:
        linear-gradient(135deg, rgba(23, 41, 104, 0.96), rgba(17, 123, 184, 0.9)),
        url('../../img/logo-prosoporte.png') right 2rem bottom 2rem / 260px auto no-repeat;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: hidden;
}

.login-hero h1 {
    max-width: 680px;
    margin: 1.2rem 0 1rem;
    font-size: clamp(2.25rem, 5vw, 4.5rem);
    line-height: 1.02;
    letter-spacing: 0;
}

.login-hero p {
    max-width: 590px;
    margin: 0;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1.05rem;
}

.brand-logo {
    width: min(230px, 70vw);
    height: auto;
}

.brand-logo-white {
    width: min(280px, 78vw);
}

.login-card {
    align-self: center;
    padding: clamp(1.5rem, 4vw, 2.4rem);
}

.login-card h2,
.install-shell h1,
.module-panel h2,
.topbar h1 {
    margin: 0;
    color: var(--primary);
    letter-spacing: 0;
}

.muted {
    color: var(--muted);
}

.eyebrow {
    display: inline-flex;
    width: fit-content;
    margin-top: 1rem;
    color: var(--secondary);
    font-size: 0.78rem;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: uppercase;
}

.login-hero .eyebrow {
    color: rgba(255, 255, 255, 0.86);
}

.product-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 2rem;
}

.product-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.55rem;
    border: 1px solid rgba(255, 255, 255, 0.32);
    border-radius: 999px;
    padding: 0.6rem 0.9rem;
    background: rgba(255, 255, 255, 0.14);
    backdrop-filter: blur(10px);
    color: var(--white);
    font-weight: 600;
}

.product-pill img {
    width: 1.25rem;
    height: 1.25rem;
    object-fit: contain;
}

.windows-mark,
.office-mark,
.m365-mark {
    display: inline-block;
    width: 1.15rem;
    height: 1.15rem;
    flex: 0 0 auto;
}

.windows-mark {
    background:
        linear-gradient(var(--white), var(--white)) left top / calc(50% - 0.06rem) calc(50% - 0.06rem) no-repeat,
        linear-gradient(var(--white), var(--white)) right top / calc(50% - 0.06rem) calc(50% - 0.06rem) no-repeat,
        linear-gradient(var(--white), var(--white)) left bottom / calc(50% - 0.06rem) calc(50% - 0.06rem) no-repeat,
        linear-gradient(var(--white), var(--white)) right bottom / calc(50% - 0.06rem) calc(50% - 0.06rem) no-repeat;
}

.office-mark {
    border: 0.25rem solid var(--white);
    border-left-width: 0.38rem;
    transform: skewY(-10deg);
}

.m365-mark {
    border-radius: 50%;
    border: 0.2rem solid var(--white);
    border-top-color: rgba(255, 255, 255, 0.45);
}

.stack-form {
    display: grid;
    gap: 1rem;
    margin-top: 1.4rem;
}

label {
    display: grid;
    gap: 0.45rem;
    color: var(--primary);
    font-weight: 700;
}

input,
textarea {
    width: 100%;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 0.85rem 0.95rem;
    font: inherit;
    color: var(--text);
    background: rgba(255, 255, 255, 0.88);
    outline: none;
    transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

textarea {
    resize: vertical;
}

input:focus,
textarea:focus {
    border-color: rgba(17, 123, 184, 0.72);
    box-shadow: 0 0 0 4px rgba(17, 123, 184, 0.12);
    background: var(--white);
}

.btn {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border: 1px solid transparent;
    border-radius: var(--radius);
    padding: 0.72rem 1rem;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
    transform: translateY(-1px);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    box-shadow: 0 12px 28px rgba(23, 41, 104, 0.24);
}

.btn-secondary {
    border-color: rgba(17, 123, 184, 0.28);
    background: rgba(17, 123, 184, 0.12);
    color: var(--primary);
}

.btn-ghost {
    border-color: rgba(23, 41, 104, 0.14);
    background: rgba(255, 255, 255, 0.5);
    color: var(--primary);
}

.alert {
    margin: 1rem 0;
    border-radius: var(--radius);
    padding: 0.9rem 1rem;
    font-weight: 700;
}

.alert-error {
    border: 1px solid rgba(185, 28, 28, 0.2);
    background: rgba(254, 226, 226, 0.84);
    color: #991b1b;
}

.alert-success {
    border: 1px solid rgba(21, 128, 61, 0.2);
    background: rgba(220, 252, 231, 0.84);
    color: #166534;
}

.install-shell {
    width: min(760px, 100%);
    padding: clamp(1.5rem, 4vw, 3rem);
}

.credential-card {
    margin: 1.2rem 0;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.56);
}

.credential-card p {
    margin: 0.55rem 0 0;
}

.app-page {
    background:
        radial-gradient(circle at top right, rgba(17, 123, 184, 0.16), transparent 28rem),
        linear-gradient(135deg, #f8fbff 0%, #ffffff 50%, #edf5fb 100%);
}

.app-shell {
    min-height: 100vh;
    display: grid;
    grid-template-columns: 280px minmax(0, 1fr);
}

.sidebar {
    position: sticky;
    top: 0;
    height: 100vh;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    padding: 1.4rem;
    background: var(--menu);
    color: var(--white);
    box-shadow: 14px 0 34px rgba(25, 25, 25, 0.16);
    z-index: 20;
}

.sidebar-brand {
    display: block;
    border-radius: var(--radius);
    padding: 0.8rem;
    background: var(--white);
}

.nav-menu {
    display: grid;
    gap: 0.55rem;
}

.nav-menu a {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    min-height: 46px;
    border-radius: var(--radius);
    padding: 0.75rem 0.85rem;
    color: rgba(255, 255, 255, 0.78);
    transition: background 0.2s ease, color 0.2s ease;
}

.nav-menu a:hover,
.nav-menu a.active {
    background: rgba(17, 123, 184, 0.28);
    color: var(--white);
}

.nav-icon {
    width: 1.35rem;
    text-align: center;
    color: #83d4ff;
    font-weight: 700;
}

.sidebar-footer {
    margin-top: auto;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 1rem;
    color: rgba(255, 255, 255, 0.7);
}

.mini-logos {
    display: flex;
    gap: 0.55rem;
    margin-bottom: 0.75rem;
}

.mini-logos img {
    width: 1.55rem;
    height: 1.55rem;
    object-fit: contain;
}

.sidebar-footer strong {
    display: block;
    margin-top: 0.25rem;
    color: var(--white);
}

.content {
    min-width: 0;
    padding: clamp(1rem, 3vw, 2rem);
}

.topbar {
    min-height: 92px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-radius: var(--radius);
    padding: 1rem 1.25rem;
}

.topbar .eyebrow {
    margin: 0 0 0.2rem;
}

.icon-button {
    display: none;
    width: 44px;
    height: 44px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.7);
    color: var(--primary);
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

.user-chip {
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0.62rem 0.9rem;
    background: rgba(255, 255, 255, 0.58);
    color: var(--primary);
    font-weight: 700;
}

.user-chip a {
    display: block;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.stat-card,
.detail-grid article {
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.76);
    box-shadow: 0 12px 30px rgba(23, 41, 104, 0.08);
}

.stat-card span,
.detail-grid span,
.comments-box span {
    display: block;
    margin-bottom: 0.35rem;
    color: var(--muted);
    font-size: 0.85rem;
    font-weight: 700;
}

.stat-card strong {
    color: var(--primary);
    font-size: clamp(1.3rem, 3vw, 2rem);
}

.stat-card.accent strong,
.detail-grid .accent strong,
.profit-cell {
    color: #15803d;
}

.module-panel {
    border-radius: var(--radius);
    padding: clamp(1rem, 3vw, 1.5rem);
}

.module-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.2rem;
}

.module-heading .eyebrow {
    margin: 0 0 0.25rem;
}

.search-bar {
    display: grid;
    grid-template-columns: minmax(240px, 1fr) auto auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 1rem;
}

.table-wrap {
    width: 100%;
    overflow-x: auto;
}

.data-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 920px;
}

.data-table th,
.data-table td {
    border-bottom: 1px solid var(--line);
    padding: 0.85rem 0.7rem;
    text-align: left;
    vertical-align: middle;
}

.data-table th {
    color: var(--primary);
    font-size: 0.84rem;
    text-transform: uppercase;
    letter-spacing: 0;
}

.data-table tbody tr:hover {
    background: rgba(17, 123, 184, 0.06);
}

.empty-state {
    padding: 2rem !important;
    color: var(--muted);
    text-align: center !important;
}

.serial-toggle {
    border: 1px solid rgba(17, 123, 184, 0.22);
    border-radius: 999px;
    padding: 0.35rem 0.6rem;
    background: rgba(17, 123, 184, 0.08);
    color: var(--primary);
    font: inherit;
    cursor: pointer;
}

.row-actions,
.form-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    align-items: center;
}

.inline-form {
    display: inline;
}

.icon-link {
    display: inline-flex;
    width: 36px;
    height: 36px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: rgba(255, 255, 255, 0.64);
    color: var(--primary);
    font: inherit;
    font-weight: 800;
    cursor: pointer;
}

.icon-link.danger {
    color: #b91c1c;
}

.license-form {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.span-2 {
    grid-column: span 2;
}

.detail-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1rem;
}

.detail-grid strong {
    display: block;
    overflow-wrap: anywhere;
    color: var(--primary);
}

.serial-full {
    font-family: Consolas, Monaco, monospace;
}

.comments-box {
    margin-top: 1rem;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 1rem;
    background: rgba(255, 255, 255, 0.68);
}

.comments-box p {
    margin: 0;
    line-height: 1.6;
}

.security-note {
    border: 1px solid rgba(17, 123, 184, 0.18);
    border-radius: var(--radius);
    padding: 0.85rem 1rem;
    background: rgba(17, 123, 184, 0.08);
    color: var(--primary);
    font-weight: 600;
}

@media (max-width: 1080px) {
    .app-shell {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: fixed;
        inset: 0 auto 0 0;
        width: min(300px, 86vw);
        transform: translateX(-102%);
        transition: transform 0.24s ease;
    }

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

    .icon-button {
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }

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

@media (max-width: 820px) {
    .auth-page {
        padding: 1rem;
    }

    .login-layout {
        grid-template-columns: 1fr;
    }

    .login-hero {
        min-height: auto;
        padding: 2rem;
    }

    .search-bar,
    .license-form {
        grid-template-columns: 1fr;
    }

    .span-2 {
        grid-column: span 1;
    }

    .module-heading,
    .topbar {
        align-items: flex-start;
        flex-direction: column;
    }

    .user-chip {
        max-width: 100%;
    }
}

@media (max-width: 640px) {
    .content {
        padding: 0.75rem;
    }

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

    .table-wrap {
        overflow: visible;
    }

    .data-table {
        min-width: 0;
    }

    .data-table thead {
        display: none;
    }

    .data-table,
    .data-table tbody,
    .data-table tr,
    .data-table td {
        display: block;
        width: 100%;
    }

    .data-table tr {
        border: 1px solid var(--line);
        border-radius: var(--radius);
        margin-bottom: 0.8rem;
        padding: 0.4rem;
        background: rgba(255, 255, 255, 0.68);
    }

    .data-table td {
        display: flex;
        justify-content: space-between;
        gap: 1rem;
        border-bottom: 0;
        padding: 0.55rem;
    }

    .data-table td::before {
        content: attr(data-label);
        flex: 0 0 42%;
        color: var(--muted);
        font-weight: 700;
    }

    .row-actions {
        justify-content: flex-end;
    }
}
