* {
    box-sizing: border-box;
}

body {
    margin: 0;
    min-height: 100vh;
    background: #f6f7f9;
    color: #242124;
    font-family: Arial, Helvetica, sans-serif;
}

.shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 260px 1fr;
}

.sidebar {
    padding: 24px;
    background: #b40f14;
    color: #ffffff;
    box-shadow: 8px 0 24px rgba(127, 18, 22, .14);
}

.brand,
.login-brand,
.user-menu,
.panel-header {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand {
    margin-bottom: 32px;
    align-items: flex-start;
    flex-direction: column;
}

.brand small,
.login-brand p,
.panel-header p {
    display: block;
    margin: 4px 0 0;
    color: #7d8790;
    font-size: 13px;
}

.brand small {
    color: #ffd9d9;
}

.brand img {
    display: block;
    width: 100%;
    max-width: 210px;
    height: auto;
    padding: 8px;
    border-radius: 8px;
    background: #e20d12;
}

.brand strong {
    display: block;
    margin-top: 2px;
    font-size: 18px;
}

.brand-mark {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border-radius: 8px;
    background: #0ea5e9;
    color: #ffffff;
    font-weight: 800;
}

.nav {
    display: grid;
    gap: 8px;
}

.nav a {
    padding: 11px 12px;
    border-radius: 6px;
    color: #ffe2e2;
    font-weight: 700;
    text-decoration: none;
}

.nav a:hover {
    background: rgba(255, 255, 255, .14);
    color: #ffffff;
}

.content {
    padding: 30px;
}

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 24px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e3e7ec;
}

.stack {
    display: grid;
    gap: 20px;
}

.eyebrow {
    margin: 0 0 6px;
    color: #d71920;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .04em;
    text-transform: uppercase;
}

h1 {
    margin: 0;
    font-size: 30px;
}

h2 {
    margin: 0;
    font-size: 18px;
}

.button {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    padding: 0 16px;
    border-radius: 6px;
    background: #d71920;
    color: #ffffff;
    border: 0;
    cursor: pointer;
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
}

.button.secondary {
    background: #fff2c2;
    color: #7a2e0e;
}

.button.full {
    justify-content: center;
    width: 100%;
}

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

.metric {
    min-height: 116px;
    padding: 18px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(31, 41, 55, .06);
}

.metric span {
    display: block;
    color: #6b7280;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
}

.metric strong {
    display: block;
    margin-top: 14px;
    font-size: 28px;
}

.metric.warning strong {
    color: #d71920;
}

.panel {
    overflow: hidden;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 14px 30px rgba(31, 41, 55, .06);
}

.panel-header {
    justify-content: space-between;
    padding: 18px;
    border-bottom: 1px solid #e5eaf0;
}

table {
    width: 100%;
    border-collapse: collapse;
}

th,
td {
    padding: 14px 16px;
    border-bottom: 1px solid #e5eaf0;
    text-align: left;
}

th {
    background: #fff7d6;
    color: #7a2e0e;
    font-size: 13px;
    text-transform: uppercase;
}

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

.empty {
    color: #829ab1;
    text-align: center;
}

.login-page {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 18px;
    background: #eef1f5;
}

.login-window {
    position: relative;
    overflow: hidden;
    width: min(1320px, 100%);
    min-height: min(820px, calc(100vh - 36px));
    border: 1px solid rgba(17, 24, 39, .2);
    border-radius: 14px;
    background: #ffffff;
    box-shadow: 0 26px 70px rgba(15, 23, 42, .22);
}

.window-controls {
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    z-index: 3;
    display: flex;
    justify-content: flex-end;
    gap: 28px;
    height: 50px;
    padding: 18px 28px 0;
    background: linear-gradient(90deg, rgba(172, 5, 15, .95), rgba(185, 23, 33, .96));
}

.window-controls span {
    width: 14px;
    height: 14px;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 3px;
}

.window-controls span:first-child {
    width: 16px;
    height: 2px;
    margin-top: 7px;
    border: 0;
    background: rgba(255, 255, 255, .9);
}

.window-controls span:last-child {
    position: relative;
    border: 0;
}

.window-controls span:last-child::before,
.window-controls span:last-child::after {
    position: absolute;
    top: 6px;
    left: -1px;
    width: 18px;
    height: 2px;
    background: rgba(255, 255, 255, .95);
    content: "";
}

.window-controls span:last-child::before {
    transform: rotate(45deg);
}

.window-controls span:last-child::after {
    transform: rotate(-45deg);
}

.login-split {
    display: grid;
    min-height: calc(min(820px, calc(100vh - 36px)) - 96px);
    grid-template-columns: 1.06fr 1fr;
    padding-top: 50px;
}

.login-showcase {
    position: relative;
    overflow: hidden;
    padding: 44px 44px 34px;
    background:
        linear-gradient(160deg, rgba(219, 0, 17, .98) 0%, rgba(210, 0, 14, .88) 44%, rgba(166, 8, 20, .96) 100%),
        #d71920;
    color: #ffffff;
}

.login-showcase::before {
    position: absolute;
    right: -170px;
    bottom: 22px;
    width: 760px;
    height: 300px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .08);
    content: "";
}

.showcase-logo {
    position: relative;
    z-index: 1;
    display: block;
    width: min(540px, 92%);
    margin-bottom: 66px;
}

.showcase-scene {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 30%;
    height: 430px;
    opacity: .92;
}

.market-building {
    position: absolute;
    right: 34px;
    bottom: 0;
    left: 40px;
    height: 330px;
    border-radius: 8px 8px 0 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, .13), rgba(255, 255, 255, .08)),
        linear-gradient(#b7bac3 0 34%, #d71920 34% 49%, #f1f3f6 49%);
    box-shadow: inset 0 -90px 0 rgba(30, 35, 45, .24);
}

.market-building::before {
    position: absolute;
    right: 36px;
    bottom: 46px;
    left: 36px;
    height: 118px;
    border-radius: 4px;
    background:
        repeating-linear-gradient(90deg, rgba(255, 255, 255, .4) 0 30px, rgba(0, 0, 0, .12) 30px 34px),
        rgba(35, 39, 48, .42);
    content: "";
}

.market-building strong {
    display: inline-block;
    margin: 74px 0 0 62px;
    padding: 6px 28px;
    background: #d71920;
    color: #ffffff;
    font-size: 42px;
    letter-spacing: 1px;
}

.cart-customer {
    position: absolute;
    right: 300px;
    bottom: 36px;
    width: 46px;
    height: 128px;
    border-radius: 22px 22px 6px 6px;
    background: linear-gradient(#1f2937 0 22%, #ef2332 22% 58%, #202938 58%);
}

.cart-customer::after {
    position: absolute;
    right: -74px;
    bottom: 0;
    width: 92px;
    height: 54px;
    border: 5px solid #ef2332;
    border-top-width: 12px;
    transform: skewX(-12deg);
    content: "";
}

.showcase-features {
    position: relative;
    z-index: 1;
    display: grid;
    width: min(340px, 100%);
    gap: 26px;
    margin-top: 130px;
}

.showcase-features article {
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 16px;
}

.showcase-features span {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, .92);
    color: #d71920;
    font-weight: 900;
}

.showcase-features strong {
    display: block;
    margin-bottom: 6px;
    font-size: 16px;
}

.showcase-features p {
    margin: 0;
    max-width: 240px;
    color: #ffffff;
    font-size: 13px;
    line-height: 1.45;
}

.login-panel {
    position: relative;
    padding: 88px min(76px, 8vw) 40px;
    background: #ffffff;
}

.panel-cart {
    position: absolute;
    top: 72px;
    right: 72px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: #fff0f0;
}

.panel-cart::before {
    position: absolute;
    top: 42px;
    left: 34px;
    width: 48px;
    height: 30px;
    border: 5px solid #d71920;
    border-top: 8px solid #d71920;
    border-radius: 4px;
    transform: skewX(-8deg);
    content: "";
}

.panel-cart::after {
    position: absolute;
    top: 78px;
    left: 38px;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #d71920;
    box-shadow: 38px 0 0 #d71920;
    content: "";
}

.login-heading {
    margin-bottom: 48px;
}

.login-heading h1 {
    margin: 0;
    color: #202938;
    font-size: 38px;
}

.login-heading p {
    max-width: 360px;
    margin: 16px 0 0;
    color: #6b7280;
    font-size: 20px;
    line-height: 1.55;
}

.desktop-login-form {
    display: grid;
    gap: 24px;
}

.desktop-field {
    display: grid;
    gap: 8px;
    color: #111827;
    font-size: 14px;
    font-weight: 700;
}

.desktop-field div {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    min-height: 64px;
    overflow: hidden;
    border: 1px solid #d8dde5;
    border-radius: 10px;
    background: #ffffff;
}

.desktop-field b {
    display: grid;
    align-self: stretch;
    place-items: center;
    background: #fff0f0;
    color: #d71920;
    font-size: 13px;
}

.desktop-field input {
    width: 100%;
    min-height: 62px;
    padding: 0 18px;
    border: 0;
    color: #26364f;
    font-size: 17px;
}

.desktop-field input:focus {
    box-shadow: none;
    outline: 0;
}

.desktop-field em {
    padding-right: 18px;
    color: #8b93a1;
    font-style: normal;
    font-weight: 800;
}

.desktop-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
}

.desktop-options label {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #202938;
    font-size: 15px;
    font-weight: 700;
}

.desktop-options input {
    width: 24px;
    min-height: 24px;
    accent-color: #ef2332;
}

.desktop-options a {
    color: #e20d12;
    font-weight: 800;
    text-decoration: none;
}

.desktop-login-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 160px;
    min-height: 64px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #e40016, #ff1627);
    box-shadow: 0 16px 28px rgba(226, 13, 18, .24);
    color: #ffffff;
    cursor: pointer;
    font-size: 20px;
    font-weight: 900;
}

.desktop-login-button strong {
    font-size: 30px;
}

.desktop-divider {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 18px;
    margin: 30px 0 24px;
}

.desktop-divider span {
    height: 1px;
    background: #dde3ea;
}

.desktop-divider p {
    margin: 0;
    color: #8b93a1;
}

.biometric-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    width: 100%;
    min-height: 58px;
    border: 1px solid #d8dde5;
    border-radius: 8px;
    background: #ffffff;
    color: #202938;
    cursor: pointer;
    font-size: 17px;
    font-weight: 700;
}

.biometric-button span {
    color: #ef2332;
    font-size: 28px;
}

.login-footer {
    display: grid;
    grid-template-columns: 1fr 1.2fr 1fr;
    align-items: center;
    min-height: 96px;
    padding: 0 38px;
    background: #1f252d;
    color: #ffffff;
}

.login-footer div {
    display: grid;
    gap: 6px;
}

.login-footer div:nth-child(2) {
    justify-items: center;
}

.login-footer div:last-child {
    justify-items: end;
}

.login-footer strong {
    font-size: 14px;
}

.login-footer span,
.login-footer a {
    color: #d7dde6;
    font-size: 13px;
    text-decoration: none;
}

.login-footer a {
    color: #ff2638;
    font-weight: 800;
}

label {
    display: grid;
    gap: 7px;
    color: #334e68;
    font-size: 14px;
    font-weight: 700;
}

input {
    width: 100%;
    min-height: 42px;
    padding: 9px 11px;
    border: 1px solid #cfd6df;
    border-radius: 6px;
    font: inherit;
}

input:focus {
    border-color: #d71920;
    box-shadow: 0 0 0 3px rgba(215, 25, 32, .12);
    outline: 0;
}

.alert {
    margin-bottom: 16px;
    padding: 11px 12px;
    border-radius: 6px;
    background: #fee4e2;
    color: #912018;
}

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

    .sidebar {
        position: static;
    }

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

    .login-window {
        min-height: auto;
    }

    .login-split {
        grid-template-columns: 1fr;
        min-height: auto;
    }

    .login-showcase {
        min-height: 420px;
    }

    .showcase-features {
        margin-top: 70px;
    }

    .login-panel {
        padding: 56px 32px 38px;
    }

    .panel-cart {
        top: 34px;
        right: 32px;
        width: 82px;
        height: 82px;
        font-size: 32px;
    }

    .login-footer {
        grid-template-columns: 1fr;
        gap: 18px;
        padding: 24px 32px;
    }

    .login-footer div,
    .login-footer div:nth-child(2),
    .login-footer div:last-child {
        justify-items: start;
    }
}

@media (max-width: 700px) {
    .topbar,
    .panel-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .panel {
        overflow-x: auto;
    }

    table {
        min-width: 680px;
    }

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

    .login-page {
        padding: 0;
    }

    .login-window {
        min-height: 100vh;
        border: 0;
        border-radius: 0;
    }

    .showcase-logo {
        width: 100%;
    }

    .showcase-scene {
        left: 8%;
    }

    .login-heading h1 {
        font-size: 30px;
    }

    .login-heading p {
        font-size: 17px;
    }

    .desktop-login-button {
        gap: 56px;
    }

    .desktop-options {
        align-items: flex-start;
        flex-direction: column;
    }
}

.login-reference {
    position: relative;
    width: min(1536px, calc(100vw - 28px));
    aspect-ratio: 3 / 2;
    max-height: calc(100vh - 28px);
    overflow: hidden;
    border-radius: 14px;
    background: url("assets/images/login_unicachi_desktop.png") center / contain no-repeat;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
}

.reference-form {
    position: absolute;
    inset: 0;
}

.reference-form input,
.reference-form button {
    position: absolute;
    font-family: Arial, Helvetica, sans-serif;
}

.reference-user,
.reference-password {
    left: 62.6%;
    width: 30.3%;
    height: 5.7%;
    padding: 0 18px;
    border: 0;
    background: #ffffff !important;
    color: #667085;
    font-size: clamp(12px, 1.2vw, 18px);
    outline: 0;
    box-shadow: inset 0 0 0 1000px #ffffff;
}

.reference-user {
    top: 35.45%;
}

.reference-password {
    top: 47.45%;
}

.reference-user::placeholder,
.reference-password::placeholder {
    color: #667085;
}

.reference-user:focus,
.reference-password:focus {
    border: 0;
    box-shadow: none;
    outline: 0;
}

.reference-user:focus,
.reference-password:focus,
.reference-user:-webkit-autofill,
.reference-password:-webkit-autofill {
    background: #ffffff !important;
    box-shadow: inset 0 0 0 1000px #ffffff !important;
    -webkit-text-fill-color: #667085;
}

.reference-remember {
    position: absolute;
    top: 55.4%;
    left: 57.1%;
    width: 11.5%;
    height: 3.2%;
    opacity: 0;
    cursor: pointer;
}

.reference-forgot {
    position: absolute;
    top: 55.4%;
    left: 80.8%;
    width: 12.8%;
    height: 3.2%;
    overflow: hidden;
    color: transparent;
    text-decoration: none;
}

.reference-submit,
.reference-biometric {
    left: 57.1%;
    width: 36.1%;
    border: 0;
    background: transparent;
    color: transparent;
    cursor: pointer;
}

.reference-submit {
    top: 61.2%;
    height: 7.1%;
}

.reference-biometric {
    top: 75.0%;
    height: 6.4%;
}

.reference-alert {
    position: absolute;
    top: 29%;
    left: 57.1%;
    z-index: 2;
    width: 36.1%;
    padding: 10px 14px;
    border-radius: 8px;
    background: #fee4e2;
    color: #912018;
    font-size: clamp(11px, 1vw, 14px);
    font-weight: 700;
}

@media (max-aspect-ratio: 3 / 2) {
    .login-reference {
        width: min(calc((100vh - 28px) * 1.5), calc(100vw - 28px));
    }
}

/* App dashboard */
.app-shell {
    display: grid;
    min-height: 100vh;
    grid-template-columns: 228px 1fr;
    background: #f5f7fb;
}

.app-sidebar {
    position: sticky;
    top: 0;
    display: flex;
    height: 100vh;
    flex-direction: column;
    padding: 18px 15px;
    background: linear-gradient(180deg, #d71920 0%, #b80f17 100%);
    color: #ffffff;
}

.app-logo {
    display: block;
    margin-bottom: 24px;
}

.app-logo img {
    display: block;
    width: 100%;
    border-radius: 8px;
}

.app-nav {
    display: grid;
    gap: 8px;
}

.app-nav a {
    display: grid;
    grid-template-columns: 30px 1fr auto;
    align-items: center;
    min-height: 46px;
    padding: 0 12px;
    border-radius: 7px;
    color: #ffffff;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none;
}

.app-nav a:hover,
.app-nav a.active {
    background: rgba(255, 255, 255, .16);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .08);
}

.app-nav span {
    display: inline-grid;
    width: 22px;
    height: 22px;
    place-items: center;
    border-radius: 6px;
    background: rgba(255, 255, 255, .14);
    font-size: 11px;
}

.app-nav b {
    font-size: 18px;
    font-weight: 400;
}

.secure-box {
    margin-top: auto;
    padding: 16px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    background: rgba(86, 0, 8, .18);
}

.secure-box strong {
    display: block;
    margin-bottom: 6px;
}

.secure-box p {
    margin: 0;
    color: #ffe1e1;
    font-size: 12px;
    line-height: 1.45;
}

.app-main {
    min-width: 0;
    padding-bottom: 24px;
}

.app-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 64px;
    padding: 0 30px;
    border-bottom: 1px solid #e5e9f0;
    background: #ffffff;
}

.topbar-left,
.topbar-actions,
.user-pill {
    display: flex;
    align-items: center;
}

.topbar-left {
    gap: 18px;
}

.menu-button,
.notification-button {
    display: inline-grid;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 0;
    border-radius: 8px;
    background: #ffffff;
    color: #344054;
    cursor: pointer;
    font-weight: 800;
}

.topbar-left h1 {
    font-size: 20px;
}

.topbar-actions {
    gap: 18px;
}

.notification-button {
    position: relative;
}

.notification-button span {
    position: absolute;
    top: 2px;
    right: 0;
    display: grid;
    width: 18px;
    height: 18px;
    place-items: center;
    border-radius: 50%;
    background: #d71920;
    color: #ffffff;
    font-size: 11px;
}

.user-pill {
    gap: 10px;
}

.avatar {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    background: #d71920;
    color: #ffffff;
    font-weight: 800;
}

.user-pill strong,
.user-pill small {
    display: block;
}

.user-pill strong {
    color: #111827;
    font-size: 14px;
}

.user-pill small {
    color: #667085;
    font-size: 12px;
}

.user-pill a {
    margin-left: 8px;
    color: #d71920;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.dashboard-page,
.module-page {
    padding: 24px 30px 0;
}

.dashboard-welcome {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-bottom: 22px;
}

.dashboard-welcome h2 {
    color: #101828;
    font-size: 24px;
}

.dashboard-welcome p {
    margin: 8px 0 0;
    color: #667085;
}

.date-filter {
    min-height: 42px;
    padding: 0 18px;
    border: 1px solid #d8dde5;
    border-radius: 7px;
    background: #ffffff;
    color: #344054;
    font-weight: 700;
}

.dashboard-metrics {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 14px;
    margin-bottom: 18px;
}

.dash-card,
.dash-panel {
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .06);
}

.dash-card {
    display: grid;
    grid-template-columns: 54px 1fr;
    gap: 14px;
    min-height: 112px;
    padding: 18px;
}

.dash-card i {
    display: grid;
    width: 48px;
    height: 48px;
    place-items: center;
    border-radius: 50%;
    color: #ffffff;
    font-style: normal;
    font-weight: 900;
}

.metric-red i { background: #ef2332; }
.metric-blue i { background: #2f80ed; }
.metric-orange i { background: #f79009; }
.metric-green i { background: #27ae60; }
.metric-purple i { background: #6f56d9; }
.metric-cyan i { background: #06a7bd; }

.dash-card span {
    display: block;
    color: #475467;
    font-size: 11px;
    font-weight: 800;
    text-transform: uppercase;
}

.dash-card strong {
    display: block;
    margin: 7px 0;
    color: #101828;
    font-size: 22px;
}

.dash-card small,
.dash-card a {
    color: #667085;
    font-size: 12px;
    text-decoration: none;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: 1.45fr 1fr 1.12fr;
    gap: 18px;
    margin-bottom: 18px;
}

.dashboard-bottom {
    display: grid;
    grid-template-columns: 1.18fr 1.1fr 1fr;
    gap: 18px;
}

.dash-panel {
    min-width: 0;
    padding: 16px;
}

.section-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.section-title h3 {
    margin: 0;
    color: #101828;
    font-size: 16px;
}

.section-title small {
    color: #475467;
    font-weight: 400;
}

.section-title a {
    color: #d71920;
    font-size: 12px;
    font-weight: 800;
    text-decoration: none;
}

.section-title button {
    min-height: 34px;
    padding: 0 14px;
    border: 1px solid #d8dde5;
    border-radius: 6px;
    background: #ffffff;
    color: #344054;
}

.chart-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 12px 0 8px;
}

.chart-summary span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid #e5e9f0;
    border-radius: 999px;
    background: #ffffff;
    color: #475467;
    font-size: 12px;
    font-weight: 800;
}

.chart-summary strong {
    color: #101828;
}

.line-chart {
    padding: 6px 0 0;
}

.line-chart svg {
    width: 100%;
    height: 270px;
}

.line-chart line {
    stroke: #edf1f6;
    stroke-width: 1;
}

.line-chart text {
    fill: #98a2b3;
    font-size: 12px;
    font-weight: 800;
}

.line-chart polyline {
    fill: none;
    stroke-width: 5;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.green-line { stroke: #27ae60; }
.red-line { stroke: #ef2332; }
.green-area { fill: url(#entryArea); }
.red-area { fill: url(#outputArea); }

.chart-points circle {
    stroke: #ffffff;
    stroke-width: 3;
}

.green-points circle {
    fill: #27ae60;
}

.red-points circle {
    fill: #ef2332;
}

.axis-label {
    fill: #667085;
}

.category-chart {
    display: grid;
    grid-template-columns: 145px 1fr;
    align-items: center;
    gap: 18px;
    min-height: 238px;
}

.donut {
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: conic-gradient(#2f80ed 0 35%, #27ae60 35% 55%, #ff4d5a 55% 73%, #f6bd4a 73% 85%, #c3cad5 85% 100%);
    box-shadow: inset 0 0 0 38px #ffffff;
}

.category-chart ul {
    display: grid;
    gap: 14px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.category-chart li {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    color: #344054;
    font-size: 13px;
}

.dot {
    display: inline-block;
    width: 8px;
    height: 8px;
    margin-right: 8px;
    border-radius: 50%;
}

.dot.green { background: #27ae60; }
.dot.blue { background: #2f80ed; }
.dot.red { background: #ef2332; }
.dot.purple { background: #6f56d9; }
.dot.gray { background: #98a2b3; }

.low-stock-list {
    display: grid;
    gap: 8px;
}

.low-stock-list a {
    display: grid;
    grid-template-columns: 38px 1fr auto;
    align-items: center;
    gap: 12px;
    min-height: 52px;
    padding: 8px 10px;
    border: 1px solid #edf0f4;
    border-radius: 7px;
    color: inherit;
    text-decoration: none;
}

.low-stock-list span {
    display: grid;
    width: 32px;
    height: 32px;
    place-items: center;
    border-radius: 7px;
    background: #fff1f1;
    color: #d71920;
    font-weight: 900;
}

.low-stock-list strong,
.low-stock-list small {
    display: block;
}

.low-stock-list strong {
    color: #101828;
    font-size: 13px;
}

.low-stock-list small {
    margin-top: 3px;
    color: #667085;
    font-size: 12px;
}

.low-stock-list b {
    padding: 5px 9px;
    border-radius: 999px;
    background: #ffe9e9;
    color: #d71920;
    font-size: 11px;
}

.compact-table {
    font-size: 12px;
}

.compact-table th {
    background: #ffffff;
    color: #101828;
    font-size: 11px;
}

.compact-table td,
.compact-table th {
    padding: 12px 10px;
}

.quick-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}

.quick-actions a {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 62px;
    border: 1px solid;
    border-radius: 7px;
    font-weight: 800;
    text-decoration: none;
}

.qa-red { background: #fff1f1; border-color: #ffd2d2; color: #d71920; }
.qa-green { background: #effaf4; border-color: #cdeeda; color: #159947; }
.qa-orange { background: #fff7ed; border-color: #fed7aa; color: #ea580c; }
.qa-blue { background: #eff8ff; border-color: #bfdbfe; color: #0275d8; }
.qa-purple { background: #f4f3ff; border-color: #ddd6fe; color: #5b3fd6; }
.qa-cyan { background: #ecfeff; border-color: #bae6fd; color: #0891b2; }

.module-page {
    min-height: calc(100vh - 120px);
}

.module-intro {
    margin: 0;
    color: #667085;
    line-height: 1.6;
}

.app-footer {
    display: flex;
    justify-content: space-between;
    gap: 18px;
    padding: 28px 30px 0;
    color: #667085;
    font-size: 12px;
}

@media (max-width: 1300px) {
    .dashboard-metrics {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

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

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

    .app-sidebar {
        position: static;
        height: auto;
    }

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

    .app-topbar,
    .dashboard-welcome,
    .app-footer {
        align-items: flex-start;
        flex-direction: column;
    }

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

@media (max-width: 620px) {
    .dashboard-page,
    .module-page,
    .app-topbar {
        padding-right: 16px;
        padding-left: 16px;
    }

    .app-nav,
    .dashboard-metrics,
    .quick-actions,
    .category-chart {
        grid-template-columns: 1fr;
    }
}

.products-page {
    display: grid;
    gap: 18px;
}

.product-form-panel .section-title {
    align-items: flex-start;
}

.section-title p {
    margin: 6px 0 0;
    color: #667085;
    font-size: 13px;
}

.product-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.category-form {
    display: grid;
    grid-template-columns: 280px 1fr auto;
    gap: 14px;
}

.provider-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.entry-form {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.product-form label,
.category-form label,
.provider-form label,
.entry-form label,
.product-filters {
    color: #344054;
    font-size: 13px;
    font-weight: 800;
}

.product-form input,
.product-form select,
.product-form textarea,
.category-form input,
.category-form textarea,
.provider-form input,
.entry-form input,
.entry-form select,
.entry-form textarea,
.provider-form textarea,
.product-filters input,
.product-filters select,
.category-filters input,
.category-filters select,
.provider-filters input,
.provider-filters select {
    width: 100%;
    min-height: 42px;
    margin-top: 7px;
    padding: 9px 11px;
    border: 1px solid #d8dde5;
    border-radius: 7px;
    background: #ffffff;
    color: #101828;
    font: inherit;
}

.product-form textarea {
    min-height: 78px;
    resize: vertical;
}

.category-form textarea {
    min-height: 42px;
    resize: vertical;
}

.provider-form textarea {
    min-height: 74px;
    resize: vertical;
}

.entry-form textarea {
    min-height: 74px;
    resize: vertical;
}

.full-field {
    grid-column: span 3;
}

.form-actions {
    display: flex;
    align-items: end;
    justify-content: flex-end;
}

.notice {
    margin-bottom: 12px;
    padding: 10px 12px;
    border-radius: 7px;
    font-weight: 800;
}

.notice.success {
    background: #ecfdf3;
    color: #027a48;
}

.notice.error {
    background: #fee4e2;
    color: #b42318;
}

.product-filters {
    display: grid;
    grid-template-columns: 1fr 220px 160px auto auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 16px;
}

.category-filters {
    display: grid;
    grid-template-columns: 1fr 180px auto auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 16px;
}

.provider-filters {
    display: grid;
    grid-template-columns: 1fr 180px auto auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 16px;
}

.entry-filters {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 16px;
}

.category-filters input,
.category-filters select,
.provider-filters input,
.provider-filters select,
.entry-filters input {
    margin-top: 0;
}

.product-filters input,
.product-filters select {
    margin-top: 0;
}

.clear-filter {
    display: inline-flex;
    align-items: center;
    min-height: 40px;
    color: #d71920;
    font-weight: 800;
    text-decoration: none;
}

.table-wrap {
    overflow-x: auto;
}

.products-table {
    min-width: 980px;
}

.products-table th {
    background: #f8fafc;
    color: #475467;
}

.stock-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.stock-badge.normal {
    background: #ecfdf3;
    color: #027a48;
}

.stock-badge.bajo {
    background: #fff7ed;
    color: #c2410c;
}

.stock-badge.critico {
    background: #fee4e2;
    color: #b42318;
}

.row-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
}

.action-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 30px;
    padding: 0 10px;
    border: 1px solid;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
}

.action-btn.view {
    border-color: #bfdbfe;
    background: #eff8ff;
    color: #0275d8;
}

.action-btn.edit {
    border-color: #fed7aa;
    background: #fff7ed;
    color: #c2410c;
}

.action-btn.danger {
    border-color: #fecaca;
    background: #fff1f1;
    color: #b42318;
}

.action-btn.restore {
    border-color: #bbf7d0;
    background: #ecfdf3;
    color: #027a48;
}

.action-btn:hover {
    filter: brightness(.98);
    transform: translateY(-1px);
}

.active-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.active-badge.yes {
    background: #ecfdf3;
    color: #027a48;
}

.active-badge.no {
    background: #f2f4f7;
    color: #667085;
}

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

.product-detail-grid div {
    padding: 14px;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    background: #f8fafc;
}

.product-detail-grid span,
.product-detail-grid strong {
    display: block;
}

.product-detail-grid span {
    margin-bottom: 7px;
    color: #667085;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
}

.product-detail-grid strong {
    color: #101828;
    font-size: 15px;
}

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

.module-hero {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 18px;
}

.module-hero div {
    margin-right: auto;
}

.module-hero h2 {
    margin: 0 0 6px;
    color: #101828;
    font-size: 26px;
}

.module-hero p {
    margin: 0;
    color: #667085;
}

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

.stat-card {
    display: flex;
    align-items: center;
    gap: 14px;
    min-height: 104px;
    padding: 18px;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    background: #ffffff;
    box-shadow: 0 8px 24px rgba(16, 24, 40, .06);
}

.stat-card span,
.stat-card small {
    display: block;
    color: #667085;
}

.stat-card span {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.stat-card strong {
    display: block;
    margin: 5px 0;
    color: #101828;
    font-size: 24px;
}

.stat-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    color: #ffffff;
    font-weight: 900;
}

.stat-icon.blue { background: #2f80ed; }
.stat-icon.green { background: #27ae60; }
.stat-icon.red { background: #ef2332; }
.stat-icon.purple { background: #6f56d9; }

.kardex-page {
    display: grid;
    gap: 18px;
}

.kardex-stats {
    margin-bottom: 0;
}

.kardex-product-summary {
    display: grid;
    grid-template-columns: 1fr 220px 220px;
    gap: 14px;
}

.kardex-product-summary div {
    padding: 14px;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    background: #f8fafc;
}

.kardex-product-summary span,
.kardex-product-summary small {
    display: block;
    color: #667085;
}

.kardex-product-summary span {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.kardex-product-summary strong {
    display: block;
    margin: 5px 0;
    color: #101828;
    font-size: 20px;
}

.kardex-filters {
    display: grid;
    grid-template-columns: 1.4fr 150px 150px 150px 1fr auto;
    align-items: end;
    gap: 12px;
}

.kardex-filter-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.kardex-table {
    min-width: 1180px;
}

.movement-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.movement-badge.entrada {
    background: #ecfdf3;
    color: #027a48;
}

.movement-badge.salida {
    background: #fff1f1;
    color: #b42318;
}

.movement-badge.ajuste {
    background: #eff8ff;
    color: #0275d8;
}

.quantity-in {
    color: #027a48;
    font-weight: 900;
}

.quantity-out {
    color: #b42318;
    font-weight: 900;
}

.reports-page {
    display: grid;
    gap: 18px;
}

.report-filters {
    display: grid;
    grid-template-columns: 160px 160px 1fr 180px auto;
    align-items: end;
    gap: 12px;
}

.report-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.report-stats {
    margin-bottom: 0;
}

.report-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.report-balance {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.report-balance div {
    min-height: 100px;
    padding: 16px;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    background: #f8fafc;
}

.report-balance span,
.report-balance small {
    display: block;
    color: #667085;
}

.report-balance span {
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
}

.report-balance strong {
    display: block;
    margin: 7px 0;
    color: #101828;
    font-size: 26px;
}

.movement-ranking {
    display: grid;
    gap: 14px;
}

.ranking-row {
    position: relative;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    overflow: hidden;
    padding: 13px 14px 18px;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    background: #ffffff;
}

.ranking-row strong,
.ranking-row small {
    position: relative;
    z-index: 1;
    display: block;
}

.ranking-row small {
    margin-top: 4px;
    color: #667085;
}

.ranking-row span {
    position: relative;
    z-index: 1;
    color: #101828;
    font-weight: 900;
}

.ranking-row i {
    position: absolute;
    left: 0;
    bottom: 0;
    height: 4px;
    border-radius: 0 999px 999px 0;
    background: linear-gradient(90deg, #d71920, #ff7a7a);
}

.report-table {
    min-width: 1080px;
}

.users-page {
    display: grid;
    gap: 18px;
}

.user-stats {
    margin-bottom: 0;
}

.user-form {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.user-filters {
    display: grid;
    grid-template-columns: 1fr 180px 160px auto auto;
    align-items: end;
    gap: 12px;
    margin-bottom: 16px;
}

.user-filters input,
.user-filters select {
    margin-top: 0;
}

.users-table {
    min-width: 1050px;
}

.role-badge {
    display: inline-flex;
    align-items: center;
    min-height: 26px;
    padding: 0 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 900;
}

.role-badge.admin {
    background: #fff1f1;
    color: #b42318;
}

.role-badge.almacen {
    background: #eff8ff;
    color: #0275d8;
}

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

.inline-action {
    margin: 0;
}

.inline-action button {
    font-family: inherit;
    cursor: pointer;
}

.inline-action button:disabled {
    cursor: not-allowed;
    opacity: .45;
    transform: none;
}

.settings-page,
.settings-form {
    display: grid;
    gap: 18px;
}

.settings-stats {
    margin-bottom: 0;
}

.settings-section .section-title {
    align-items: flex-start;
}

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

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

.setting-toggle {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    min-height: 74px;
    padding: 14px;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    background: #f8fafc;
}

.setting-toggle input {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    accent-color: #d71920;
}

.setting-toggle span,
.setting-toggle small {
    display: block;
}

.setting-toggle span {
    color: #101828;
    font-weight: 900;
}

.setting-toggle small {
    margin-top: 5px;
    color: #667085;
    font-weight: 600;
    line-height: 1.4;
}

.settings-health {
    min-height: 74px;
    padding: 14px;
    border: 1px solid #bbf7d0;
    border-radius: 8px;
    background: #ecfdf3;
}

.settings-health strong,
.settings-health span,
.settings-health small {
    display: block;
}

.settings-health strong {
    color: #027a48;
}

.settings-health span {
    margin-top: 6px;
    color: #101828;
    font-weight: 800;
}

.settings-health small {
    margin-top: 4px;
    color: #667085;
}

.settings-savebar {
    position: sticky;
    bottom: 0;
    z-index: 4;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 18px;
    border: 1px solid #e5e9f0;
    border-radius: 8px;
    background: rgba(255, 255, 255, .96);
    box-shadow: 0 -10px 28px rgba(16, 24, 40, .08);
    backdrop-filter: blur(10px);
}

.settings-savebar strong,
.settings-savebar span {
    display: block;
}

.settings-savebar span {
    margin-top: 4px;
    color: #667085;
    font-size: 13px;
}

@media print {
    .app-sidebar,
    .app-topbar,
    .app-footer,
    .no-print,
    .module-hero .button {
        display: none !important;
    }

    .app-shell {
        display: block;
    }

    .app-main,
    .module-page {
        padding: 0;
    }

    .dash-panel,
    .stat-card {
        box-shadow: none;
        break-inside: avoid;
    }
}

@media (max-width: 1100px) {
    .product-form {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .category-form,
    .provider-form,
    .entry-form,
    .category-filters {
        grid-template-columns: 1fr 1fr;
    }

    .provider-filters {
        grid-template-columns: 1fr 1fr;
    }

    .entry-filters {
        grid-template-columns: 1fr auto;
    }

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

    .product-filters {
        grid-template-columns: 1fr 1fr;
    }

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

    .stats-grid,
    .kardex-product-summary,
    .kardex-filters,
    .report-grid,
    .report-filters,
    .user-form,
    .settings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .user-filters {
        grid-template-columns: 1fr 1fr;
    }

    .kardex-search,
    .kardex-filter-actions,
    .report-actions {
        grid-column: span 2;
    }
}

@media (max-width: 620px) {
    .product-form,
    .category-form,
    .provider-form,
    .entry-form,
    .product-filters,
    .category-filters,
    .provider-filters,
    .entry-filters {
        grid-template-columns: 1fr;
    }

    .full-field {
        grid-column: span 1;
    }

    .form-actions {
        justify-content: stretch;
    }

    .form-actions .button {
        justify-content: center;
        width: 100%;
    }

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

    .wide-detail {
        grid-column: span 1;
    }

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

    .stats-grid,
    .kardex-product-summary,
    .kardex-filters,
    .report-grid,
    .report-filters,
    .report-balance,
    .user-form,
    .user-filters,
    .settings-grid {
        grid-template-columns: 1fr;
    }

    .wide-setting {
        grid-column: span 1;
    }

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

    .kardex-search,
    .kardex-filter-actions,
    .report-actions {
        grid-column: span 1;
    }

    .kardex-filter-actions,
    .report-actions {
        align-items: stretch;
        flex-direction: column;
    }
}
