* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    color: #222;
}

body {
    font-size: 16px;
}

.page {
    min-height: 100vh;
}

/* login */

.page-login {
    background-color: #f2f2f2;
}

.card-login {
    width: 440px;
    max-width: 100%;
    padding: 35px;
    background-color: #fff;
}

.brand {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 30px;
}

.brand-logo {
    display: block;
    width: 260px;
    height: 150px;
    max-width: 100%;
    object-fit: contain;
}

.page-title {
    margin-bottom: 28px;
}

    .page-title h1 {
        margin: 0 0 10px;
        font-size: 28px;
        font-weight: 600;
    }

    .page-title p {
        margin: 0;
        color: #777;
        font-size: 14px;
        line-height: 22px;
    }

.form-group .form-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    font-weight: bold;
}

.form-control {
    width: 100%;
    min-height: 46px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 14px;
}

    .form-control:focus {
        border-color: #555;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.10);
    }

.password-container {
    position: relative;
    width: 100%;
}

    .password-container .form-control {
        width: 100%;
        padding-right: 48px;
    }

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    width: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: none;
    border-radius: 5px;
    background: transparent;
    color: #777;
    cursor: pointer;
}

    .password-toggle:hover {
        color: #222;
    }

    .password-toggle:focus {
        outline: none;
        box-shadow: none;
    }

    .password-toggle:focus-visible {
        outline: 2px solid #555;
        outline-offset: -4px;
    }

    .password-toggle svg {
        display: block;
    }

.btn {
    min-height: 44px;
    border-radius: 5px;
    font-size: 14px;
}

.btn-dark {
    background-color: #1a1a1a;
    border-color: #1a1a1a;
}

    .btn-dark:hover {
        background-color: #333;
        border-color: #333;
    }

.btn-block {
    width: 100%;
    min-height: 46px;
}

/* layout */

.app-body {
    margin: 0;
    background-color: #f4f5f7;
    font-family: "Inter", "Segoe UI", Arial, sans-serif;
    color: #222;
}

.sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 250px;
    height: 100vh;
    background-color: #1a1a1a;
    display: flex;
    flex-direction: column;
    padding: 24px 16px;
    z-index: 1050;
    transition: transform 0.3s ease;
}

.sidebar-brand {
    margin-bottom: 24px;
    padding: 10px;
    text-align: center;
}

.sidebar-logo {
    width: 130px;
    max-width: 100%;
    height: auto;
    object-fit: contain;
    filter: invert(1) brightness(2);
}

.sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 6px;
    flex: 1;
}

.sidebar-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    border-radius: 6px;
    color: #a1a1a6;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: 0.2s;
}

    .sidebar-link:hover,
    .sidebar-link.active {
        background-color: #2a2a2a;
        color: #fff;
    }

.sidebar-icon {
    width: 20px;
    text-align: center;
    font-size: 18px;
    display: inline-block;
}

.sidebar-user {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 16px;
    margin-top: 16px;
}
.user-avatar {
    width: 40px;
    height: 40px;
    background-color: #555;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

.user-info {
    display: flex;
    flex-direction: column;
}

.user-name {
    color: #fff;
    font-size: 14px;
    font-weight: 600;
}

.user-logout {
    color: #888;
    font-size: 12px;
    text-decoration: none;
}

    .user-logout:hover {
        color: #fff;
    }

.sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    transition: opacity 0.3s;
}

.sidebar.open ~ .sidebar-overlay {
    display: block;
}

.sidebar-bottom {
    padding-top: 16px;
    margin-top: 16px;
    border-top: 1px solid #333; 
}

.app-main {
    margin-left: 250px;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: margin-left 0.3s ease;
}

.topbar {
    background-color: #fff;
    border-bottom: 1px solid #e5e5e5;
    padding: 16px 24px;
    display: flex;
    align-items: center;
    gap: 16px;
}

.topbar-title {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #111;
}

.topbar-toggle {
    display: none;
    min-width: 44px;
    min-height: 44px;
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 18px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}

.app-content {
    padding: 24px;
    flex: 1;
}

/* buscador */

.search-input {
    min-height: 46px;
    font-size: 14px;
    border-color: #ddd;
    border-radius: 8px;
    padding-left: 16px;
}

    .search-input:focus {
        border-color: #888;
        box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.05);
    }

/* ventas */

.item-card {
    border: 1px solid #eaeaea;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    background-color: #fff;
    transition: transform 0.2s;
}

    .item-card:hover {
        transform: translateY(-2px);
    }

.item-icon {
    font-size: 48px;
    background-color: #f9f9f9;
    border-radius: 8px;
    padding: 20px 0;
}

.item-name {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.item-price {
    font-weight: 700;
    color: #111;
    font-size: 16px;
}

.cart-panel {
    position: sticky;
    top: 90px;
    border: 1px solid #eaeaea;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    max-height: calc(100vh - 120px);
    display: flex;
    flex-direction: column;
}

/* inventario */

.item-icon-small {
    width: 40px;
    height: 40px;
    background-color: #f4f5f7;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.table th {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #777;
    border-bottom-width: 1px;
}

.table td {
    font-size: 14px;
    vertical-align: middle;
}

.btn-block-mobile {
    width: 100%;
}

@media (min-width: 768px) {
    .btn-block-mobile {
        width: auto;
    }
}

.modal-content {
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.modal-header .btn-close {
    background-color: #f0f0f0;
    border-radius: 50%;
    padding: 8px;
}

/* responsive ventas e inventario */

@media (max-width: 1024px) {
    .sidebar {
        transform: translateX(-100%);
    }

        .sidebar.open {
            transform: translateX(0);
        }

    .app-main {
        margin-left: 0;
    }

    .topbar-toggle {
        display: flex;
    }

    .cart-panel {
        position: static;
        max-height: none;
    }

    .app-content {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    .app-content {
        padding: 16px;
    }

    .topbar {
        padding: 12px 16px;
    }

    .topbar-title {
        font-size: 20px;
    }

    .item-icon {
        font-size: 36px;
        padding: 15px 0;
    }

    .search-input {
        min-height: 44px;
        font-size: 16px;
    }
}

@media (max-width: 360px) {
    .app-content {
        padding: 12px;
    }

    .topbar {
        padding: 10px 12px;
        gap: 10px;
    }

    .topbar-title {
        font-size: 18px;
    }

    .item-icon {
        font-size: 30px;
        padding: 10px 0;
    }

    .item-name {
        font-size: 14px;
    }

    .item-price {
        font-size: 15px;
    }

    .cart-panel {
        border-radius: 8px;
    }

        .cart-panel .p-3 {
            padding: 10px !important;
        }

    .btn-block {
        min-height: 40px;
        font-size: 13px;
    }

    .table th {
        font-size: 11px;
    }

    .table td {
        font-size: 12px;
    }

    .item-icon-small {
        width: 32px;
        height: 32px;
        font-size: 16px;
    }
}

@media (max-height: 500px) {
    .sidebar {
        padding: 12px 16px;
    }

    .sidebar-brand {
        margin-bottom: 12px;
        padding: 5px;
    }

    .sidebar-logo {
        width: 100px;
    }

    .sidebar-link {
        padding: 8px 12px;
        min-height: 36px;
        font-size: 13px;
    }

    .topbar {
        padding: 8px 16px;
    }

    .topbar-title {
        font-size: 16px;
    }

    .app-content {
        padding: 12px;
    }

    .item-icon {
        padding: 8px 0;
        font-size: 28px;
    }

    .cart-panel {
        max-height: none;
    }
}

@media (min-width: 1025px) {
    .sidebar-overlay {
        display: none !important;
    }
}

/* responsive login */

@media (min-width: 481px) and (max-width: 1024px) {
    .card-login {
        width: 420px;
        padding: 32px;
    }

    .brand-logo {
        width: 220px;
        height: 125px;
    }

    .page-title h1 {
        font-size: 26px;
    }
}

@media (max-width: 480px) {
    .page-login main {
        padding: 16px !important;
    }

    .card-login {
        width: 100%;
        padding: 26px 20px;
        border-radius: 8px;
    }

    .brand {
        margin-bottom: 22px;
    }

    .brand-logo {
        width: 190px;
        height: 110px;
    }

    .page-title {
        margin-bottom: 24px;
    }

        .page-title h1 {
            font-size: 24px;
        }

        .page-title p {
            font-size: 13px;
        }

    .form-control {
        min-height: 44px;
        font-size: 16px;
    }

    .btn {
        min-height: 44px;
    }

    .password-toggle {
        width: 44px;
    }
}

@media (max-width: 360px) {
    .card-login {
        padding: 22px 15px;
    }

    .brand-logo {
        width: 160px;
        height: 95px;
    }

    .page-title h1 {
        font-size: 22px;
    }

    .password-container .form-control {
        padding-right: 42px;
    }

    .password-toggle {
        width: 40px;
    }
}

@media (max-height: 500px) {
    .brand {
        margin-bottom: 12px;
    }

    .brand-logo {
        height: 60px;
    }

    .page-title {
        margin-bottom: 16px;
    }
}

.btn-icon {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 32px !important;
    height: 32px !important;
    min-width: 32px !important;
    min-height: 32px !important;
    padding: 0 !important;
    line-height: 1 !important;
    font-size: 14px !important;
    border-radius: 6px !important;
}