* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: #070B14;
}

body {
    margin: 0;
    min-height: 100vh;
    font-family: Arial, Helvetica, sans-serif;
    background: radial-gradient(circle at top left, rgba(37, 99, 235, .23), transparent 34%), radial-gradient(circle at bottom right, rgba(34, 197, 94, .10), transparent 32%), linear-gradient(135deg, #070B14 0%, #0F172A 48%, #172554 100%);
    color: #0F172A;
    overflow-x: hidden;
}

main {
    min-height: 100vh;
}

a {
    -webkit-tap-highlight-color: transparent;
}

button,
input {
    font-size: 16px;
    font-family: inherit;
}

input {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid #CBD5E1;
    border-radius: 16px;
    background: #FFFFFF;
    outline: none;
    color: #0F172A;
}

    input::placeholder {
        color: #94A3B8;
    }

    input:focus {
        border-color: #2563EB;
        box-shadow: 0 0 0 4px rgba(37, 99, 235, .16);
    }

button {
    border: none;
    border-radius: 14px;
    padding: 13px 16px;
    cursor: pointer;
    font-weight: 900;
    color: white;
    background: #111827;
    box-shadow: 0 8px 16px rgba(15, 23, 42, .14);
}

    button:active,
    .brand-btn:active,
    .model-card:active {
        transform: scale(.98);
    }

/* LOGIN */

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 22px;
}

.login-card {
    width: min(410px, 100%);
    background: rgba(248, 250, 252, .98);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 34px;
    padding: 30px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .30);
    text-align: center;
}

.login-logo-box {
    width: 92px;
    height: 92px;
    margin: 0 auto 18px;
    border-radius: 28px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 10px 24px rgba(15, 23, 42, .10);
}

    .login-logo-box img {
        max-width: 68px;
        max-height: 68px;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
    }

.login-logo-fallback {
    font-size: 25px;
    font-weight: 1000;
    color: #0F172A;
}

.login-title h1 {
    margin: 0;
    font-size: 28px;
    line-height: 1.05;
    font-weight: 1000;
    color: #0F172A;
    letter-spacing: -.5px;
}

.login-title p {
    margin: 7px 0 24px;
    color: #64748B;
    font-size: 14px;
    font-weight: 700;
}

.login-form {
    text-align: left;
}

    .login-form label {
        display: block;
        font-size: 13px;
        color: #334155;
        font-weight: 900;
        margin-bottom: 6px;
        margin-top: 12px;
    }

    .login-form input {
        margin-bottom: 8px;
    }

    .login-form button {
        width: 100%;
        margin-top: 16px;
        background: linear-gradient(135deg, #2563EB, #1D4ED8);
    }

.error-box {
    margin-top: 16px;
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
    padding: 12px;
    border-radius: 14px;
    font-weight: 800;
    text-align: center;
}

/* APP GENERAL */

.app-shell {
    width: min(1180px, 100%);
    margin: 0 auto;
    padding: 18px;
}

.main-card {
    background: rgba(248, 250, 252, .98);
    border: 1px solid rgba(226, 232, 240, .95);
    border-radius: 28px;
    box-shadow: 0 18px 40px rgba(0, 0, 0, .20);
}

.header-card {
    padding: 18px;
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 18px;
    align-items: center;
    margin-bottom: 14px;
}

.logo-box {
    width: 82px;
    height: 82px;
    border-radius: 24px;
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    display: grid;
    place-items: center;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(15, 23, 42, .08);
}

    .logo-box img {
        max-width: 66px;
        max-height: 66px;
        width: auto;
        height: auto;
        object-fit: contain;
        display: block;
    }

.logo-fallback {
    font-size: 24px;
    font-weight: 1000;
    color: #0F172A;
}

.header-title h1 {
    margin: 0;
    font-size: 30px;
    font-weight: 1000;
    letter-spacing: -.6px;
    line-height: 1.02;
}

.header-title p {
    margin: 5px 0 0;
    color: #64748B;
    font-size: 14px;
}

.header-title strong {
    display: block;
    color: #2563EB;
    font-size: 14px;
    margin-top: 8px;
}

.total-box {
    background: #0F172A;
    color: white;
    border-radius: 20px;
    padding: 13px 22px;
    text-align: center;
    min-width: 150px;
    box-shadow: inset 0 0 0 1px rgba(255,255,255,.05);
}

    .total-box small {
        display: block;
        color: #CBD5E1;
        font-size: 10px;
        font-weight: 900;
        letter-spacing: .5px;
    }

    .total-box span {
        display: block;
        color: #22C55E;
        font-size: 30px;
        font-weight: 1000;
        margin-top: 2px;
    }

.toolbar-card {
    padding: 14px;
    margin-bottom: 14px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
}

.search-form {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
}

    .search-form button {
        background: #2563EB;
        min-width: 110px;
    }

.logout-btn {
    background: #475569;
}

.brand-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;
    margin-bottom: 14px;
}

.brand-btn {
    display: block;
    text-align: center;
    text-decoration: none;
    color: white;
    padding: 23px 12px;
    border-radius: 18px;
    font-size: 20px;
    font-weight: 1000;
    box-shadow: 0 8px 18px rgba(0, 0, 0, .16);
    transition: transform .12s ease, filter .12s ease;
}

    .brand-btn:hover {
        filter: brightness(.98);
    }

.brand-tcl {
    background: linear-gradient(135deg, #F59E0B, #D97706);
}

.brand-samsung {
    background: linear-gradient(135deg, #2563EB, #1D4ED8);
}

.brand-hisense {
    background: linear-gradient(135deg, #10B981, #059669);
}

.breadcrumb-card {
    background: rgba(248, 250, 252, .96);
    border: 1px solid #E2E8F0;
    border-radius: 18px;
    padding: 12px 16px;
    margin-bottom: 14px;
    display: flex;
    align-items: center;
    gap: 9px;
    font-weight: 900;
    color: #475569;
    overflow-x: auto;
}

    .breadcrumb-card a {
        color: #2563EB;
        text-decoration: none;
        white-space: nowrap;
    }

    .breadcrumb-card strong {
        color: #0F172A;
        white-space: nowrap;
    }

.notice {
    margin-bottom: 14px;
    padding: 14px 16px;
    border-radius: 16px;
    font-weight: 800;
}

.success {
    background: #DCFCE7;
    color: #14532D;
    border: 1px solid #BBF7D0;
}

.error {
    background: #FEE2E2;
    color: #991B1B;
    border: 1px solid #FECACA;
}

.content-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 360px;
    gap: 14px;
}

.section-card {
    padding: 18px;
    min-width: 0;
}

.section-title {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    align-items: center;
    margin-bottom: 14px;
}

    .section-title h2 {
        margin: 0;
        font-size: 20px;
        font-weight: 1000;
    }

    .section-title p {
        margin: 3px 0 0;
        color: #64748B;
        font-size: 13px;
    }

.live-pill {
    background: #0F172A;
    color: #22C55E;
    font-size: 12px;
    font-weight: 1000;
    border-radius: 999px;
    padding: 9px 14px;
    white-space: nowrap;
}

/* MODEL CARDS */

.model-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(235px, 1fr));
    gap: 16px;
}

.model-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 28px;
    padding: 14px;
    text-decoration: none;
    color: #0F172A;
    box-shadow: 0 12px 28px rgba(0, 0, 0, .11);
    transition: transform .12s ease, box-shadow .12s ease;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
}

    .model-card:hover {
        transform: translateY(-2px);
        box-shadow: 0 16px 34px rgba(0, 0, 0, .15);
    }

.model-image {
    width: 100%;
    height: 190px;
    background: radial-gradient(circle at center, #FFFFFF 0%, #F8FAFC 60%, #EEF2F7 100%);
    border: 1px solid #E2E8F0;
    border-radius: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 12px;
    overflow: hidden;
    padding: 8px;
    flex-shrink: 0;
}

    .model-image img {
        display: block;
        max-width: 98% !important;
        max-height: 98% !important;
        width: auto !important;
        height: auto !important;
        object-fit: contain !important;
        object-position: center center !important;
        transform: none !important;
    }

.model-top {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-items: flex-start;
}

    .model-top strong {
        font-size: 15px;
        font-weight: 1000;
        word-break: break-word;
        line-height: 1.18;
        color: #0F172A;
    }

    .model-top span {
        background: #DCFCE7;
        color: #16A34A;
        border: 1px solid #BBF7D0;
        border-radius: 999px;
        padding: 6px 10px;
        font-size: 11px;
        font-weight: 1000;
        white-space: nowrap;
    }

.model-card p {
    background: #F8FAFC;
    border-radius: 14px;
    padding: 9px 10px;
    margin: 9px 0;
    color: #334155;
    font-size: 12px;
    font-weight: 800;
    line-height: 1.22;
    min-height: 38px;
}

.model-info {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-top: auto;
}

    .model-info span {
        background: #F1F5F9;
        color: #475569;
        border-radius: 999px;
        padding: 6px 9px;
        font-size: 11px;
        font-weight: 800;
    }

/* PRODUCT / SKU CARDS */

.product-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(285px, 1fr));
    gap: 14px;
}

.product-card {
    background: #FFFFFF;
    border: 1px solid #E2E8F0;
    border-radius: 24px;
    padding: 16px;
    box-shadow: 0 10px 22px rgba(0, 0, 0, .10);
    min-width: 0;
}

.product-image {
    width: 100%;
    height: 175px;
    background: radial-gradient(circle at center, #FFFFFF 0%, #F8FAFC 60%, #EEF2F7 100%);
    border: 1px solid #E2E8F0;
    border-radius: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 14px;
    overflow: hidden;
    padding: 8px;
}

    .product-image img {
        display: block;
        max-width: 98%;
        max-height: 98%;
        width: auto;
        height: auto;
        object-fit: contain;
        object-position: center center;
    }

.product-top {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: flex-start;
}

.sku {
    font-size: 17px;
    font-weight: 1000;
    color: #0F172A;
    word-break: break-word;
    line-height: 1.15;
}

.gtin {
    display: block;
    margin-top: 4px;
    color: #2563EB;
    font-size: 12px;
    font-weight: 800;
}

.stock-box {
    background: #DCFCE7;
    border: 1px solid #BBF7D0;
    color: #16A34A;
    border-radius: 18px;
    padding: 10px 13px;
    text-align: center;
    min-width: 78px;
}

    .stock-box small {
        display: block;
        color: #64748B;
        font-size: 10px;
        font-weight: 900;
    }

    .stock-box span {
        display: block;
        font-size: 26px;
        font-weight: 1000;
    }

.product-name {
    background: #F8FAFC;
    border-radius: 14px;
    padding: 10px;
    margin: 14px 0 8px;
    color: #334155;
    font-size: 13px;
    font-weight: 700;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    margin-bottom: 14px;
}

.tag {
    background: #F1F5F9;
    color: #475569;
    border-radius: 999px;
    padding: 6px 9px;
    font-size: 11px;
    font-weight: 800;
}

.move-form {
    display: grid;
    grid-template-columns: 75px 1fr 1fr;
    gap: 8px;
}

    .move-form input {
        padding: 10px;
        border-radius: 12px;
    }

.entrada {
    background: #16A34A;
}

.salida {
    background: #DC2626;
}

/* HISTORY */

.history-list {
    display: flex;
    flex-direction: column;
}

.history-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid #E2E8F0;
}

    .history-row:last-child {
        border-bottom: none;
    }

    .history-row strong {
        display: block;
        font-size: 13px;
    }

    .history-row span {
        display: block;
        color: #64748B;
        font-size: 12px;
        margin-top: 2px;
    }

    .history-row small {
        display: block;
        color: #64748B;
        font-size: 11px;
        text-align: right;
    }

.empty-state {
    background: #EFF6FF;
    border: 1px solid #BFDBFE;
    border-radius: 20px;
    padding: 18px;
    color: #1E3A8A;
}

    .empty-state h3 {
        margin: 0 0 5px;
        font-size: 18px;
    }

    .empty-state p {
        margin: 0;
        color: #475569;
    }

/* RESPONSIVE */

@media (max-width: 1000px) {
    .content-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 820px) {
    .app-shell {
        padding: 12px;
    }

    .header-card {
        grid-template-columns: auto 1fr;
        gap: 12px;
        border-radius: 24px;
    }

    .total-box {
        grid-column: 1 / -1;
        width: 100%;
    }

    .toolbar-card {
        grid-template-columns: 1fr;
        border-radius: 24px;
    }

    .search-form {
        grid-template-columns: 1fr;
    }

    .brand-grid {
        grid-template-columns: 1fr;
    }

    .brand-btn {
        padding: 18px 12px;
        font-size: 18px;
    }

    .section-card {
        padding: 14px;
        border-radius: 24px;
    }

    .section-title {
        align-items: flex-start;
    }

    .live-pill {
        display: none;
    }

    .model-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .model-card {
        border-radius: 24px;
        padding: 12px;
    }

    .model-image {
        height: 145px;
        padding: 6px;
        border-radius: 18px;
    }

        .model-image img {
            max-width: 98% !important;
            max-height: 98% !important;
        }

    .model-top strong {
        font-size: 13px;
    }

    .model-top span {
        font-size: 10px;
        padding: 5px 8px;
    }

    .model-card p {
        font-size: 11px;
        padding: 8px;
        min-height: 34px;
    }

    .model-info span {
        font-size: 10px;
        padding: 5px 7px;
    }

    .product-list {
        grid-template-columns: 1fr;
    }

    .product-image {
        height: 160px;
        padding: 6px;
    }

        .product-image img {
            max-width: 98%;
            max-height: 98%;
        }

    .move-form {
        grid-template-columns: 1fr;
    }

    .header-title h1 {
        font-size: 21px;
    }

    .header-title p {
        font-size: 12px;
    }

    .header-title strong {
        font-size: 13px;
    }

    .logo-box {
        width: 64px;
        height: 64px;
        border-radius: 19px;
    }

        .logo-box img {
            max-width: 50px;
            max-height: 50px;
        }
}

@media (max-width: 420px) {
    .model-list {
        grid-template-columns: 1fr;
    }

    .model-image {
        height: 185px;
    }
}
.toolbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

    .toolbar-actions form {
        margin: 0;
    }

.install-btn {
    background: linear-gradient(135deg, #7C3AED, #4F46E5);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.history-tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    background: #EEF2F7;
    border-radius: 16px;
    padding: 6px;
    margin-bottom: 12px;
}

.history-tab {
    background: transparent;
    color: #475569;
    box-shadow: none;
    border-radius: 12px;
    padding: 10px;
    font-size: 13px;
}

    .history-tab.active {
        background: #0F172A;
        color: white;
    }

.history-panel {
    display: none;
}

    .history-panel.active {
        display: block;
    }

.login-history-row strong {
    max-width: 130px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.install-modal {
    position: fixed;
    inset: 0;
    background: rgba(2, 6, 23, .65);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    z-index: 9999;
}

    .install-modal.active {
        display: flex;
    }

.install-modal-card {
    width: min(420px, 100%);
    background: #F8FAFC;
    border-radius: 28px;
    padding: 24px;
    box-shadow: 0 24px 60px rgba(0,0,0,.35);
    border: 1px solid #E2E8F0;
}

    .install-modal-card h2 {
        margin: 0 0 8px;
        color: #0F172A;
        font-size: 24px;
        font-weight: 1000;
    }

.install-main-text {
    color: #475569;
    margin: 0 0 12px;
    font-weight: 700;
}

.install-modal-card ol {
    margin: 0 0 18px;
    padding-left: 22px;
    color: #334155;
}

.install-modal-card li {
    margin-bottom: 8px;
}

.install-modal-card button {
    width: 100%;
    background: #2563EB;
}

@media (max-width: 820px) {
    .toolbar-actions {
        display: grid;
        grid-template-columns: 1fr;
    }

    .install-btn,
    .logout-btn {
        width: 100%;
    }
}