:root {
    --primary: #44a8d2;
    /* Indigo 500 */
    --primary-dark: #3282aa;
    --secondary: #ec4899;
    /* Pink 500 */
    --dark: #0f172a;
    /* Slate 900 */
    --dark-surface: #1e293b;
    /* Slate 800 */
    --light: #f8fafc;
    /* Slate 50 */
    --text-main: #334155;
    --text-light: #94a3b8;
    --white: #ffffff;
    --success: #10b981;
    --danger: #ef4444;

    --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
    --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1);

    --radius: 12px;
    --font-main: 'Inter', system-ui, -apple-system, sans-serif;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-main);
    background-color: var(--light);
    color: var(--text-main);
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    margin: 0;
    padding: 0;
    /* App feel */
    display: flex;
}

/* Typography */
h1,
h2,
h3 {
    font-weight: 700;
    color: var(--dark);
}

/* Login Screen */
#login-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--dark) 0%, var(--primary-dark) 100%);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

@media (min-width: 769px) {
    #login-screen {
        background: linear-gradient(rgba(15, 23, 42, 0.3), rgba(15, 23, 42, 0.3)), url('../../images/CALLE_1.webp');
        background-size: cover;
        background-position: center;
        background-repeat: no-repeat;
    }

    #login-screen .login-card {
        background: rgba(255, 255, 255, 0.85);
        backdrop-filter: blur(15px);
        -webkit-backdrop-filter: blur(15px);
        border: 1px solid rgba(255, 255, 255, 0.4);
        box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    }
}

.login-card {
    background: var(--white);
    padding: 2.5rem;
    border-radius: var(--radius);
    width: 100%;
    max-width: 400px;
    box-shadow: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
    color: var(--text-main);
    text-align: center;
}

.login-card h2 {
    color: var(--dark);
    margin-bottom: 1rem;
}

.login-logo {
    display: block;
    margin: 0 auto 1.5rem auto;
    width: 200px;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    border-radius: 12px;
}

.form-group {
    margin-bottom: 1.25rem;
    text-align: left;
}

.form-group.centered {
    text-align: center;
}

.form-group.centered label {
    text-align: center !important;
    display: block !important;
    width: 100% !important;
}

.form-group.centered input {
    text-align: center !important;
}

.centered-cell {
    text-align: center !important;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    color: var(--text-main);
    font-weight: 500;
}

.form-group input {
    width: 100%;
    padding: 0.75rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    background: #f8fafc;
    color: var(--dark);
    outline: none;
    transition: all 0.2s;
}

.form-group input:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(68, 168, 210, 0.1);
}

.btn {
    padding: 0 1.5rem;
    height: 54px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 0px;
    border: none;
    cursor: pointer;
    font-weight: 700;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    line-height: 1;
    white-space: nowrap;
    font-size: 0.95rem;
    letter-spacing: -0.01em;
    gap: 0.5rem;
    box-shadow: var(--shadow-sm);
}

.btn i {
    font-size: 1.25rem;
    margin: 0;
}

.btn-pagination {
    background: #0a4064;
    color: white;
    border: 1px solid #0a4064;
}

.btn-pagination:hover:not(:disabled) {
    background: #0a4064;
    color: white;
    border-color: #0a4064;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    filter: brightness(1.2);
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(68, 168, 210, 0.2);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(68, 168, 210, 0.3);
    filter: brightness(1.1);
}

.btn-success-mod {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
}

.btn-success-mod:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
    filter: brightness(1.1);
}

/* Specific Header Button Colors */
#export-excel-btn {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%) !important;
    color: white;
}

#export-excel-btn:hover {
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.3);
}

#bulk-upload-btn {
    background: linear-gradient(135deg, #44a8d2 0%, #3282aa 100%) !important;
    color: white;
}

#add-product-btn {
    background: linear-gradient(135deg, #3282aa 0%, #3730a3 100%) !important;
    color: white;
}

#add-user-btn {
    background: linear-gradient(135deg, #ec4899 0%, #db2777 100%) !important;
    color: white;
}

/* App Layout */
#app-layout {
    display: flex;
    width: 100%;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    /* Evita scroll vertical global */
    opacity: 0;
    /* Hidden initially until logged in */
    pointer-events: none;
    transition: opacity 0.3s;
}

#app-layout.active {
    opacity: 1;
    pointer-events: all;
}

/* Sidebar */
.sidebar {
    width: 250px;
    /* Slightly narrower */
    background: #0f172a;
    color: white;
    padding: 0.5rem 0.4rem;
    /* Even more compact */
    display: flex;
    flex-direction: column;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 100;
    position: relative;
    overflow: hidden;
    height: 100%;
    min-width: 250px;
    max-width: 250px;
}

.sidebar:hover {
    width: 250px;
    min-width: 250px;
    max-width: 250px;
}

.brand {
    margin-bottom: 2.5rem;
    /* Even more separation from menu */
    display: flex;
    align-items: center;
    justify-content: flex-start;
    /* Shifted to the left */
    position: relative;
    padding: 1.5rem 0.5rem 0.5rem 1.1rem;
    /* Adjusted left padding to 1.1rem */
    /* More space at top */
    min-height: 60px;
    border-bottom: none;
}

.sidebar-toggle-btn {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-light);
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 5px;
    border-radius: 8px;
    position: absolute;
    right: 0.0rem;
    bottom: 9px;
}

.sidebar-toggle-btn:hover {
    color: white;
    background: var(--primary);
    border-color: var(--primary);
}

.nav-links {
    list-style: none;
    flex: 1;
    overflow-y: auto;
    /* Re-enable scroll if needed, but keeping it clean */
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    /* Increased gap for better separation */
}

.nav-links::-webkit-scrollbar {
    display: none;
    /* Keep it clean but functional */
}

.nav-links::-webkit-scrollbar {
    width: 3px;
}

.nav-links::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(255, 255, 255, 0.03);
    padding-bottom: 0;
}

.nav-item:last-child {
    border-bottom: none;
}

.nav-link {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    padding: 0.75rem 1rem;
    /* More balanced padding */
    border-radius: 4px;
    /* Less curved, almost straight */
    color: #94a3b8;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
    font-size: 0.85rem;
    width: 100%;
    box-sizing: border-box;
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.12);
    color: #e2e8f0;
    padding: 0.75rem 1rem;
    width: 100%;
    box-sizing: border-box;
}

.nav-link i {
    width: 24px;
    flex-shrink: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.1rem;
    transition: none;
}

#install-app-btn {
    color: #10b981 !important;
    font-weight: 700;
}

.nav-link.active {
    background: var(--primary);
    color: white;
    box-shadow: none;
    padding: 0.75rem 1rem;
    /* Match regular padding */
    border-radius: 4px;
    /* Uncurved */
    transform: none;
    /* Removed scale 0.98 */
    width: 100%;
    box-sizing: border-box;
}

.nav-link.active i {
    transform: none;
    /* Avoid scaling which adds height */
}

.nav-link span {
    font-size: 0.85rem;
    font-weight: 500;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Medium Screens / Notebooks */
@media (max-width: 1366px) {
    .sidebar {
        width: 210px;
        padding: 0.75rem;
        min-width: 210px;
        max-width: 210px;
    }

    .sidebar:hover {
        width: 210px;
        min-width: 210px;
        max-width: 210px;
    }

    .brand {
        margin-bottom: 0.75rem;
        /* Aún más pequeño */
        height: 40px;
    }

    .brand img {
        width: 250px !important;
    }

    .nav-links {
        padding-right: 0.25rem;
    }

    .nav-item {
        margin-bottom: 0.15rem;
        width: 100%;
    }

    .nav-link {
        padding: 0.45rem 0.6rem;
        font-size: 0.8rem;
        gap: 0.5rem;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-link:hover {
        padding: 0.45rem 0.6rem;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-link.active {
        padding: 0.45rem 0.6rem;
        width: 100%;
        box-sizing: border-box;
    }

    .nav-link i {
        font-size: 1rem;
    }

    .main-content {
        padding: 1rem;
    }

    .header {
        padding: 0.75rem 1.25rem;
        margin-bottom: 1rem;
    }

    .page-title {
        font-size: 1.4rem;
    }

    .table-container {
        max-height: calc(100vh - 140px);
    }
}

/* Sidebar Collapsed State (Desktop Only) */
@media (min-width: 769px) {
    .sidebar.collapsed {
        width: 88px;
        padding: 1.5rem 0.75rem;
        min-width: 88px;
        max-width: 88px;
    }

    .sidebar.collapsed:hover {
        width: 88px;
        min-width: 88px;
        max-width: 88px;
    }

    .sidebar.collapsed .brand {
        flex-direction: column;
        height: auto;
        gap: 0;
        padding: 0 0 0.5rem 0;
        justify-content: center;
        margin-bottom: 0.5rem;
        /* Menos espacio para que el menú suba */
    }

    .sidebar.collapsed .main-logo {
        display: none !important;
    }

    .sidebar.collapsed .collapsed-only {
        display: none !important;
        /* Ocultar el icono al estar cerrado */
    }

    .sidebar.collapsed .sidebar-toggle-btn {
        position: static;
        transform: none;
        margin: 0 auto;
        /* Centrado */
        width: 40px;
        height: 40px;
    }

    .sidebar.collapsed .nav-links {
        padding-right: 0;
        margin-right: 0;
        align-items: center;
        gap: 0;
    }

    .sidebar.collapsed .nav-item {
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        padding: 0.15rem 0;
        /* Menos padding vertical */
    }

    .sidebar.collapsed .nav-item:last-child {
        border-bottom: none;
    }

    .sidebar.collapsed .nav-link {
        justify-content: center;
        width: 48px;
        /* Reducido de 54px */
        height: 48px;
        /* Reducido de 54px */
        padding: 0;
        border-radius: 8px;
        /* Menos curvo para que parezca más pequeño */
        min-width: 48px;
        max-width: 48px;
        min-height: 48px;
        max-height: 48px;
        box-sizing: border-box;
    }

    .sidebar.collapsed .nav-link:hover {
        background: rgba(255, 255, 255, 0.12);
        width: 48px;
        height: 48px;
        min-width: 48px;
        max-width: 48px;
        min-height: 48px;
        max-height: 48px;
        padding: 0;
        box-sizing: border-box;
    }

    .sidebar.collapsed .nav-link.active {
        width: 48px;
        height: 48px;
        min-width: 48px;
        max-width: 48px;
        min-height: 48px;
        max-height: 48px;
        padding: 0;
        box-sizing: border-box;
    }

    .sidebar.collapsed .nav-item {
        display: flex;
        justify-content: center;
        margin: 0;
        border-bottom: none;
    }

    .sidebar.collapsed .nav-link span {
        display: none;
    }

    .sidebar.collapsed .nav-link i {
        font-size: 1.5rem;
        width: 100%;
    }
}

/* Main Content */
.main-content {
    flex: 1;
    min-width: 0;
    /* Permite que el contenido se encoja correctamente en flexbox */
    overflow-y: auto;
    padding: 2rem;
    background: var(--light);
    transition: all 0.3s ease;
}

.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    /* Permitir que los elementos bajen si no hay espacio */
    gap: 0.75rem;
    /* Reducido de 1rem */
    margin-bottom: 1.5rem;
    /* Reducido de 2.5rem */
    background: white;
    padding: 1rem 1.5rem;
    /* Reducido de 1.5rem 2rem */
    border-radius: 12px;
    /* Un poco más pequeño */
    box-shadow: var(--shadow-sm);
    position: relative;
    width: 100%;
    max-width: 100%;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    /* Reducido de 0.75rem */
    flex-wrap: wrap;
    /* Botones de acción envueltos */
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    letter-spacing: -0.02em;
    max-width: 100%;
}

@media (min-width: 769px) {
    .page-title {
        position: relative;
        left: 0;
        transform: none;
        margin: 0;
        z-index: 1;
        text-align: left;
        white-space: nowrap;
    }
}

/* Tables */
.table-container {
    background: white;
    border-radius: 0;
    box-shadow: var(--shadow-sm);
    overflow-x: auto;
    /* Scroll horizontal interno */
    overflow-y: auto;
    max-width: 100%;
    max-height: calc(100vh - 150px);
    /* Aumentado para usar más pantalla */
    /* Fixed height for sticky headers */
    border: 1px solid #e2e8f0;
}

table {
    width: 100%;
    border-collapse: separate;
    /* Important for sticky */
    border-spacing: 0;
}

th {
    padding: 0.75rem 0.5rem;
    /* Reducido para mayor densidad */
    text-align: center;
    border-bottom: 2px solid #e2e8f0;
    position: sticky;
    top: 0;
    background: #0a4064;
    font-weight: 700;
    color: #ffffff;
    font-size: 0.75rem;
    /* Más pequeño */
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 100;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    border-right: 1px solid rgba(255, 255, 255, 0.2);
}

th:last-child {
    border-right: none;
}

td {
    padding: 0.5rem;
    /* Reducido para mayor densidad */
    text-align: left;
    border-bottom: 1px solid #f1f5f9;
    position: relative;
}

/* Asegurar que la última columna tenga overflow visible */
td:last-child {
    overflow: visible;
}

/* Global TH styles already defined above */

/* Global TD styles already defined above */

/* Custom Scrollbar for the table */
.table-container::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

.table-container::-webkit-scrollbar-track {
    background: #f1f5f9;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}

.table-container::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

tr:hover {
    background: #f8fafc;
}

th.col-location {
    min-width: 120px;
    text-align: center !important;
}

th.col-sku,
th.col-actions {
    text-align: center !important;
}

.col-sku {
    font-weight: 600;
    white-space: nowrap;
}

td.col-sku {
    color: var(--primary);
}

th.col-sku {
    color: #ffffff !important;
}

.col-name {
    min-width: 150px;
}

.col-price,
.col-stock {
    min-width: 100px;
    white-space: nowrap;
}

.col-category {
    white-space: nowrap !important;
}

.col-category .status-badge {
    white-space: nowrap;
    display: inline-block;
}

.status-badge {
    padding: 0.25rem 0.5rem;
    border-radius: 99px;
    font-size: 0.75rem;
    font-weight: 600;
}

.bg-green {
    background: #dcfce7;
    color: #166534;
}

.bg-red {
    background: #fee2e2;
    color: #991b1b;
}

/* Global left alignment for data now handles this */

/* Grid View for Mobile Inventory */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
}

.product-card-mobile {
    background: white;
    padding: 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    transition: transform 0.2s, box-shadow 0.2s;
}

.product-card-mobile:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-lg);
}

.product-img-mobile {
    width: 100%;
    max-width: 180px;
    height: 150px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 1rem;
    background: #ffffff;
    border: none;
}

.product-info-mobile {
    width: 100%;
    text-align: center;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.product-info-mobile .btn {
    margin-top: auto;
}

.product-card {
    background: white;
    padding: 1rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    text-align: center;
    position: relative;
    border: 1px solid transparent;
}

.product-card.selected {
    border-color: var(--primary);
}

.product-img {
    width: 100px;
    height: 100px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 1rem;
    background: #f1f5f9;
}

.stock-control {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.icon-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.icon-btn:hover {
    background: #f1f5f9;
}

.products-table-view table {
    min-width: 1000px;
}

.products-table-view .product-list-img {
    width: 80px !important;
    height: 80px !important;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: zoom-in;
}

.products-table-view .product-list-img:hover {
    transform: scale(1.5);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    position: relative;
}

.products-table-view td {
    font-size: 0.85rem;
}

@media (max-width: 1366px) {
    .products-table-view table {
        min-width: 900px;
    }

    .products-table-view .product-list-img {
        width: 70px !important;
        height: 70px !important;
    }

    .products-table-view td {
        font-size: 0.8rem;
    }
}

/* Inventory Cards */
.inventory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
}

/* Removidos media queries manuales para grid que ahora es auto-fit */

.product-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-sm);
    padding: 1rem;
    display: flex;
    flex-direction: column;
}

.card-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1rem;
}

.card-img {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    object-fit: cover;
}

.card-header h4 {
    margin: 0;
    font-size: 1.1rem;
}

.card-body p {
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.card-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: auto;
}

/* Floating Action Button for Mobile */
.fab {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-lg);
    cursor: pointer;
    font-size: 1.5rem;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 2000;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: white;
    padding: 2rem;
    border-radius: var(--radius);
    width: 90%;
    max-width: 850px;
    max-height: 90vh;
    overflow-y: auto;
}

.modal .header {
    display: flex !important;
    justify-content: center !important;
    position: relative;
    border-bottom: 2px solid #f1f5f9;
    padding-bottom: 1.25rem;
    margin-bottom: 2rem !important;
    width: 100%;
}

.modal .header h3 {
    margin: 0 !important;
    text-align: center !important;
}

.modal .header i {
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    background: #f1f5f9;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: all 0.2s;
}

.modal .header i:hover {
    background: #fee2e2;
    color: var(--danger);
}

/* Modal Layout Helpers */
.modal-grid {
    display: grid;
    gap: 1.25rem;
    margin-bottom: 1.25rem;
}

.modal-grid-2 {
    grid-template-columns: 1fr 1fr;
}

.modal-grid-3 {
    grid-template-columns: 1fr 1fr 1fr;
}

.modal-footer {
    padding-top: 1.5rem;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 1rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .modal-footer {
        flex-direction: column-reverse;
        gap: 0.75rem;
    }

    .modal-footer .btn {
        width: 100%;
        margin: 0;
    }
}

#reader {
    border-radius: 12px;
    overflow: hidden;
    border: none !important;
    box-shadow: var(--shadow-md);
}

#reader__status_span {
    display: none !important;
}

#reader__dashboard_section_csr button {
    background: var(--primary) !important;
    color: white !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    font-weight: 600 !important;
}

#barcode-preview-container {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    border: 1px dashed #cbd5e1;
    margin-bottom: 1.25rem;
    overflow: hidden;
}

#barcode-preview {
    max-width: 100%;
    height: auto;
    display: block;
}

/* Utilities */
.hidden {
    display: none !important;
}

.flex {
    display: flex;
}

.justify-between {
    justify-content: space-between;
}

.mb-4 {
    margin-bottom: 1rem;
}

/* Print Styles */
@media print {

    .sidebar,
    .fab,
    .bottom-nav,
    .header button,
    .stock-control,
    #login-screen {
        display: none !important;
    }

    .main-content {
        margin: 0;
        padding: 0;
    }

    body,
    #app-layout {
        background: white;
        height: auto;
        overflow: visible;
    }

    .table-container {
        box-shadow: none;
    }
}

/* Action Dropdown Button */
.action-dropdown {
    position: relative;
    display: inline-block;
}

.action-btn {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border: none;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(68, 168, 210, 0.3);
}

.action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(68, 168, 210, 0.4);
}

.action-btn i {
    font-size: 1.1rem;
}

.dropdown-menu {
    position: fixed;
    /* Cambiado de absolute a fixed para evitar problemas de overflow */
    margin-top: 0.5rem;
    background: white;
    border-radius: 8px;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    min-width: 180px;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-10px);
    transition: all 0.3s ease;
    z-index: 2500;
    overflow: hidden;
}

.action-dropdown.open .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    color: var(--text-main);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.9rem;
}

.dropdown-item:hover {
    background: var(--light);
    color: var(--primary);
}

.dropdown-item i {
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

.dropdown-item.danger:hover {
    background: #fee2e2;
    color: var(--danger);
}

.dropdown-divider {
    height: 1px;
    background: #e2e8f0;
    margin: 0.25rem 0;
}

/* Dashboard Grid View */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    margin-top: 0.5rem;
}

/* Removidos media queries manuales para dashboard-grid que ahora es auto-fit */

.dashboard-card {
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow-md);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    border: 1px solid #f1f5f9;
}

.dashboard-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary);
}

.dashboard-card.highlighted {
    background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
    border: 2px solid #fbbf24;
    box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
    animation: highlightPulse 2s ease-in-out infinite;
}

.dashboard-card.highlighted:hover {
    box-shadow: 0 8px 20px rgba(251, 191, 36, 0.4);
}

@keyframes highlightPulse {

    0%,
    100% {
        box-shadow: 0 4px 12px rgba(251, 191, 36, 0.3);
    }

    50% {
        box-shadow: 0 8px 24px rgba(251, 191, 36, 0.5);
    }
}

.location-badge-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
}

.location-badge {
    background: #f1f5f9;
    padding: 0.4rem 0.6rem;
    border-radius: 8px;
    border: 1px solid #e2e8f0;
    font-size: 0.8rem;
    line-height: 1.2;
    text-align: left;
    min-width: 100px;
    transition: all 0.2s ease;
}

.location-badge:hover {
    border-color: var(--primary);
    background: #f5f3ff;
}

.location-badge .wh-name {
    font-weight: 700;
    color: var(--primary);
    font-size: 0.7rem;
    text-transform: uppercase;
    display: block;
    margin-bottom: 2px;
}

.location-badge .wh-pos {
    color: #475569;
    font-weight: 600;
}

.location-badge .wh-stock {
    color: var(--primary);
    font-weight: 700;
    margin-left: 4px;
}



/* Warehouse Selection Cards (Responsive) */
.warehouse-selection-grid {
    display: grid;
    gap: 0.75rem;
    grid-template-columns: 1fr;
    margin-top: 0.5rem;
}

@media (min-width: 600px) {
    .warehouse-selection-grid {
        grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    }
}

.warehouse-selection-card {
    background: #ffffff;
    border: 2px solid #e2e8f0;
    border-radius: 12px;
    padding: 0.75rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: var(--shadow-sm);
}

.warehouse-selection-card:hover {
    border-color: #cbd5e1;
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.warehouse-selection-card.selected {
    border-color: var(--primary);
    background: #f5f3ff;
    box-shadow: 0 10px 15px -3px rgba(68, 168, 210, 0.1);
}

.warehouse-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
}

.warehouse-card-info {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    flex: 1;
}

.warehouse-card-info i {
    font-size: 1.1rem;
    color: #64748b;
    background: #f1f5f9;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    transition: all 0.2s;
}

.selected .warehouse-card-info i {
    color: var(--primary);
    background: #ede9fe;
}

.warehouse-card-name {
    font-weight: 700;
    color: #1e293b;
    font-size: 0.95rem;
}

.selected .warehouse-card-name {
    color: var(--primary);
}

.warehouse-card-fields {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    width: 100%;
}

.field-stock {
    grid-column: span 2;
}

.warehouse-field-group {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.warehouse-field-group label {
    font-size: 0.6rem;
    font-weight: 800;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.warehouse-field-group input {
    width: 100% !important;
    height: 34px !important;
    border: 1px solid #e2e8f0 !important;
    border-radius: 8px !important;
    padding: 0 0.6rem !important;
    font-size: 0.9rem !important;
    transition: all 0.2s !important;
    background: #f8fafc !important;
}

.selected .warehouse-field-group input {
    background: #ffffff !important;
    border-color: #c7d2fe !important;
}

.selected .warehouse-field-group input:focus {
    border-color: var(--primary) !important;
    box-shadow: 0 0 0 3px rgba(68, 168, 210, 0.1) !important;
}

.selected .warehouse-field-group .warehouse-stock-input {
    border-color: #facc15 !important;
    background-color: #fef08a !important;
    color: #000000 !important;
    font-weight: 800 !important;
}

.dashboard-card-img {
    width: 100%;
    max-width: 180px;
    height: 150px;
    object-fit: contain;
    border-radius: 12px;
    margin-bottom: 0.75rem;
    background: #ffffff;
    transition: all 0.3s ease;
}

.dashboard-card-img:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    filter: brightness(1.05);
}

.dashboard-card-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 0.2rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.6rem;
}

.dashboard-card-sku {
    font-size: 0.85rem;
    color: var(--text-light);
    margin-bottom: 1rem;
    font-weight: 600;
}

.dashboard-card-stat {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
    align-items: center;
}

.dashboard-card-location {
    font-size: 0.8rem;
    color: var(--text-main);
    width: 100%;
    margin-bottom: 0.25rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.1rem;
    max-height: 120px;
    overflow-y: auto;
    padding-right: 2px;
}

.dashboard-card-location::-webkit-scrollbar {
    width: 3px;
}

.dashboard-card-location::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 10px;
}

.dashboard-card-actions {
    margin-top: auto;
    width: 100%;
}

.dashboard-card-actions-modern {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    margin-top: auto;
    padding-top: 0.5rem;
}

.icon-action-btn {
    width: 44px;
    height: 44px;
    border-radius: 0;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1.25rem;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.icon-action-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.icon-action-btn.edit {
    background: linear-gradient(135deg, #44a8d2 0%, #3282aa 100%);
    color: white;
}

.icon-action-btn.edit:hover {
    background: linear-gradient(135deg, #3282aa 0%, #4338ca 100%);
}

.icon-action-btn.view {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: white;
}

.icon-action-btn.view:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
}

.icon-action-btn.print {
    background: linear-gradient(135deg, #0ea5e9 0%, #0284c7 100%);
    color: white;
}

.icon-action-btn.print:hover {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%);
}

.icon-action-btn.delete {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
}

.icon-action-btn.delete:hover {
    background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
}

.product-checkbox {
    accent-color: var(--primary);
    width: 20px;
    height: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    border-radius: 4px;
}

.product-checkbox:hover {
    transform: scale(1.15);
    box-shadow: 0 0 0 3px rgba(68, 168, 210, 0.2);
}

.product-checkbox:checked {
    animation: checkboxPulse 0.3s ease;
}

@keyframes checkboxPulse {
    0% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.2);
    }

    100% {
        transform: scale(1);
    }
}

.view-toggle {
    display: flex;
    background: #ffffff;
    padding: 0.25rem;
    border-radius: 8px;
    gap: 0.25rem;
}

.view-btn {
    padding: 0.5rem;
    border: none;
    background: #0a4064;
    cursor: pointer;
    border-radius: 6px;
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.view-btn.active {
    background: #0a4064;
    color: white;
    box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.3);
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .sidebar {
        position: fixed;
        transform: translateX(-100%);
        z-index: 1000;
        height: 100%;
        transition: transform 0.3s;
    }

    .sidebar.open {
        transform: translateX(0);
    }

    .main-content {
        padding: 1rem;
    }

    .desktop-only {
        display: none;
    }

    .inventory-grid {
        display: grid;
    }

    .inventory-table {
        display: none;
    }

    .menu-toggle {
        display: block;
    }

    .mobile-hide {
        display: none;
    }

    .mobile-btn {
        width: 48px;
        height: 48px;
        font-size: 1.2rem;
    }

    #inv-search {
        font-size: 1.5rem;
        padding: 1.2rem;
    }

    .dropdown-menu {
        right: auto;
        left: 0;
    }

}

/* Toast Notifications */
#toast-container {
    position: fixed;
    top: 2rem;
    right: 2rem;
    z-index: 3000;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.toast {
    background: white;
    padding: 1rem 1.5rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 280px;
    transform: translateX(120%);
    transition: all 0.3s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    border-left: 4px solid var(--primary);
}

.toast.show {
    transform: translateX(0);
}

.toast-success {
    border-left-color: var(--success);
}

.toast-error {
    border-left-color: var(--danger);
}

.toast i {
    font-size: 1.4rem;
}

.toast-success i {
    color: var(--success);
}

.toast-error i {
    color: var(--danger);
}

/* Warehouse Selection Styles */
.warehouse-selection-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
    width: 100%;
}

.warehouse-item {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    gap: 0.6rem !important;
    padding: 0.5rem 0.6rem !important;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-main);
    text-align: left;
    height: 40px !important;
    margin-bottom: 0 !important;
    overflow: hidden;
}



.warehouse-item span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
    display: flex;
    align-items: center;
    line-height: 1;
}




.warehouse-card {
    background: white;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 0.75rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.warehouse-card:hover {
    border-color: var(--primary);
    background: #f8fafc;
    transform: translateY(-1px);
}

.warehouse-card.selected {
    border-color: var(--primary);
    background: rgba(68, 168, 210, 0.02);
    box-shadow: 0 4px 12px rgba(68, 168, 210, 0.08);
}




.warehouse-item i {
    font-size: 1.25rem;
    color: #cbd5e1;
    transition: color 0.2s;
    width: 22px;
    min-width: 22px;
    display: flex;
    justify-content: center;
}


.warehouse-item.selected i {
    color: var(--primary);
}

.warehouse-item input[type="checkbox"] {
    width: 18px !important;
    height: 18px !important;
    margin: 0;
    cursor: pointer;
    accent-color: var(--primary);
}


.warehouse-item.selected {
    border-color: var(--primary);
    background: rgba(68, 168, 210, 0.05);
    color: var(--primary-dark);
}

.warehouse-add-row {
    display: flex;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid #e2e8f0;
}

.warehouse-add-row input {
    flex: 1;
    height: 40px !important;
    padding: 0 0.75rem;
    font-size: 0.9rem;
}

.warehouse-add-row .btn-add {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary);
    color: white;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.warehouse-add-row .btn-add:hover {
    background: var(--primary-dark);
    transform: scale(1.05);
}

/* Stock Modal Warehouse Specifics */
#stock-warehouse-list-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.5rem;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

#stock-warehouse-list-container .warehouse-item {
    padding: 0.4rem 0.6rem;
    font-size: 0.8rem;
    border-radius: 8px;
}

#column-mapping-body-container {
    max-height: 450px;
    overflow-y: auto;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
}

@media (max-width: 768px) {
    .warehouse-selection-list {
        max-height: 300px;
    }

    .warehouse-selection-grid {
        grid-template-columns: 1fr;
    }
}

.warehouse-item {
    padding: 0.6rem 0.4rem;
    font-size: 0.8rem;
}

/* PC Specific Styles for Product Codes in Edit Modal */
@media (min-width: 769px) {
    .product-code-group {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .product-code-group label {
        text-align: center !important;
        width: 100%;
        margin-bottom: 0.75rem;
        font-weight: 700;
        font-size: 1rem;
        color: var(--primary);
    }

    .product-code-group input {
        text-align: center !important;
        font-size: 1.35rem !important;
        /* Slightly larger as requested */
        font-weight: 700 !important;
        color: var(--dark) !important;
        padding: 0.75rem 1rem !important;
        border: 2px solid #cbd5e1 !important;
        background: white !important;
        letter-spacing: 0.05em;
        height: auto !important;
        /* Override any fixed heights */
    }

    .product-code-group input:focus {
        border-color: var(--primary) !important;
        box-shadow: 0 0 0 4px rgba(68, 168, 210, 0.15) !important;
    }

    /* Container for internal code with refresh button */
    .product-code-group>div {
        width: 100% !important;
        display: flex !important;
        justify-content: center !important;
    }

    #p_internal_code {
        flex: 1;
        max-width: 100%;
    }

    /* Centering the barcode preview */
    #barcode-preview-container {
        display: flex !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding: 1.5rem !important;
    }

    #barcode-preview {
        margin: 0 auto !important;
        display: block !important;
    }

    /* Modal adjustments for PC */
    .modal {
        max-width: 750px !important;
        /* Wider modal to fit buttons */
    }

    .modal-footer {
        flex-wrap: nowrap !important;
        /* Force one line */
        justify-content: flex-end !important;
        gap: 0.5rem !important;
        /* Smaller gap */
    }

    .modal-footer .btn {
        min-width: auto !important;
        /* Remove min-width to let them fit */
        padding: 0 0.75rem !important;
        font-size: 0.9rem !important;
    }

    .btn-close-modal {
        background: #64748b !important;
        color: white !important;
    }

    .btn-close-modal:hover {
        background: #475569 !important;
        box-shadow: 0 4px 12px rgba(71, 85, 105, 0.3) !important;
    }
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.install-banner-premium {
    transition: all 0.3s ease;
}

.install-banner-premium:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 30px -5px rgba(79, 70, 229, 0.5);
}

.install-banner-premium button:active {
    transform: scale(0.95);
}

/* Delivery View Styles */
.delivery-container {
    max-width: 800px;
    margin: 0 auto;
    padding: 1rem;
}

.delivery-items-list {
    background: white;
    padding: 1.5rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
    border: 2px solid var(--primary);
}

.delivery-items-table {
    width: 100%;
    border-collapse: collapse;
}

.delivery-validation-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
}

.delivery-product-info {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 12px;
    border: 1px solid #e2e8f0;
}

.delivery-form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.delivery-search-card {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    box-shadow: var(--shadow-md);
    margin-bottom: 2rem;
}

/* --- SETTINGS ENHANCEMENTS --- */
.header.is-settings {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    border-bottom: none;
}

.header.is-settings .page-title {
    color: white !important;
}

.header.is-settings .mobile-hide,
.header.is-settings #user-display {
    color: rgba(255, 255, 255, 0.9) !important;
}

.settings-tabs-wrapper {
    background: white;
    border-radius: 12px 12px 0 0;
    box-shadow: var(--shadow-sm);
    margin-bottom: 0;
}

.settings-tabs {
    display: flex;
    border-bottom: 2px solid #e2e8f0;
    padding: 0 0.5rem;
    background: #f8fafc;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.settings-tabs::-webkit-scrollbar {
    display: none;
}

.settings-tab {
    padding: 1rem 1.5rem;
    border: none;
    background: none;
    cursor: pointer;
    font-weight: 600;
    color: #64748b;
    border-bottom: 3px solid transparent;
    margin-bottom: -2px;
    transition: all 0.3s;
    white-space: nowrap;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.settings-tab.active {
    color: var(--primary) !important;
    border-bottom: 3px solid var(--primary) !important;
}

.settings-content-card {
    background: white;
    border-radius: 0 0 12px 12px;
    box-shadow: var(--shadow-sm);
    padding: 2rem;
    min-height: 500px;
}

.settings-inner-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 2rem;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    color: white;
}

/* New adaptive utility classes */
.btn-group {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    width: 100%;
    margin-top: 1.5rem;
}

.btn-group .btn {
    height: 60px;
    font-size: 1.05rem;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    transition: all 0.3s ease;
}

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

/* Sync/Action Buttons (Card style) */
.btn-sync {
    height: auto !important;
    min-height: 100px;
    flex-direction: column !important;
    padding: 1.5rem !important;
    text-align: center;
    white-space: normal !important;
}

.btn-card {
    display: flex !important;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem !important;
    text-align: left !important;
    height: auto !important;
    width: 100%;
    /* Ensure full width */
    border-radius: var(--radius);
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: normal !important;
    /* Allow text wrapping */
    min-width: 0;
    /* Prevent flex overflow */
}

.btn-card i {
    font-size: 2.5rem !important;
    flex-shrink: 0;
}

.btn-card-content {
    flex: 1;
}

.btn-card-title {
    font-weight: 700;
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
    display: block;
}

.btn-card-desc {
    font-size: 0.85rem;
    opacity: 0.9;
    display: block;
    line-height: 1.3;
}

@media (max-width: 768px) {
    .btn-card {
        padding: 1.25rem !important;
        gap: 1rem;
        flex-direction: column;
        /* Better for small screens */
        align-items: flex-start;
        text-align: left !important;
    }

    .btn-card i {
        font-size: 2rem !important;
        margin-bottom: 0.5rem;
    }

    .btn-card-title {
        font-size: 1rem;
    }
}

.btn-sync i {
    font-size: 2rem !important;
    margin-bottom: 0.5rem !important;
}

.btn-sync div {
    font-size: 1.1rem;
    font-weight: 700;
}

.btn-sync small {
    display: block;
    margin-top: 0.25rem;
    opacity: 0.9;
    font-weight: 400;
    line-height: 1.2;
}

@media (max-width: 768px) {
    .btn-sync {
        padding: 1.25rem !important;
        min-height: auto;
    }

    .btn-sync i {
        font-size: 1.5rem !important;
    }

    .settings-content-card {
        padding: 1.25rem;
    }

    .settings-tab {
        padding: 0.85rem 1rem;
        font-size: 0.9rem;
    }

    .settings-inner-header {
        padding: 1.25rem !important;
    }

    .settings-inner-header h2 {
        font-size: 1.25rem !important;
    }

    /* Stack buttons and grids on mobile */
    .btn-group {
        grid-template-columns: 1fr;
        width: 100%;
        gap: 0.85rem;
    }

    .btn-group .btn {
        width: 100% !important;
        justify-content: center;
        margin: 0 !important;
        height: 58px;
        border-radius: 14px;
        font-size: 1rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
        border: 1px solid rgba(0, 0, 0, 0.05);
    }

    .grid-2 {
        grid-template-columns: 1fr;
    }
}

/* Toast Notifications */
@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }

    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOut {
    from {
        transform: translateX(0);
        opacity: 1;
    }

    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

.toast {
    font-weight: 600;
    pointer-events: none;
}

/* Quotation Styles */
.quotation-container table th {
    background: #f8fafc;
    color: #64748b;
    font-weight: 700;
    font-size: 0.75rem;
    padding: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 2px solid #e2e8f0;
}

.quotation-container table td {
    border-bottom: 1px solid #f1f5f9;
}

.quotation-container .form-group label {
    font-size: 0.85rem;
    margin-bottom: 0.4rem;
    display: block;
}

.quotation-container .form-group input,
.quotation-container .form-group select {
    border: 1px solid #cbd5e1;
    transition: all 0.2s;
}

.quotation-container .form-group input:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(68, 168, 210, 0.1);
}

#q-search-results .btn:hover {
    filter: brightness(1.1);
    transform: scale(1.05);
}