/* ==================== Brand Colors (softwareeconomico.com) ==================== */
:root {
    --se-blue-900: #1e3a8a;
    --se-blue-800: #1e40af;
    --se-blue-600: #2563eb;
    --se-gray-900: #111827;
    --se-gray-800: #1f2937;
    --se-gray-100: #f3f4f6;
    --se-amber-500: #f59e0b;
    --se-amber-600: #d97706;
}

/* ==================== Bootstrap overrides ==================== */
.btn-primary {
    background-color: var(--se-blue-600);
    border-color: var(--se-blue-600);
}
.btn-primary:hover {
    background-color: var(--se-blue-800);
    border-color: var(--se-blue-800);
}

.btn-dark {
    background-color: var(--se-gray-900);
    border-color: var(--se-gray-900);
}
.btn-dark:hover {
    background-color: var(--se-gray-800);
    border-color: var(--se-gray-800);
}

.btn-warning {
    background-color: var(--se-amber-500);
    border-color: var(--se-amber-500);
}
.btn-warning:hover {
    background-color: var(--se-amber-600);
    border-color: var(--se-amber-600);
}

.bg-light {
    background-color: var(--se-gray-100) !important;
}

.bg-dark {
    background-color: var(--se-gray-900) !important;
}

.text-primary {
    color: var(--se-gray-900) !important;
}

.badge.bg-dark {
    background-color: var(--se-gray-900) !important;
}

.border-dark {
    border-color: var(--se-gray-900) !important;
}

/* ==================== Form focus states ==================== */
.form-control:focus {
    border-color: var(--se-blue-600);
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

/* ==================== Grid (custom - no Bootstrap equivalent) ==================== */
.grid-container {
    display: flex;
    flex-direction: column;
    margin-top: 10px;
    max-width: 100%;
    overflow: hidden;
}

.grid-header,
.grid-item {
    flex: 1;
    text-align: center;
    padding: 10px;
    margin: 2px;
}

.grid-header {
    background-color: transparent;
    color: var(--se-gray-800);
    border-radius: 0;
    font-size: 0.7em;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
    border-bottom: 2px solid var(--se-gray-800);
    padding: 6px 10px;
}

.grid-item {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border-radius: 6px;
    border: 1px solid #e9ecef;
    border-left: 3px solid var(--se-gray-900);
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    margin-bottom: 4px;
}

.grid-item:nth-child(odd) {
    background-color: #ffffff;
}

.grid-item:nth-child(even) {
    background-color: #f8f9fa;
}

.grid-data {
    flex: 1;
    text-align: center;
    padding: 5px;
}

.grid-header.hidden,
.grid-item.hidden,
.grid-data.hidden {
    display: none;
}

.grid-item:hover {
    background-color: #f0f4ff;
    border-left-color: var(--se-blue-600);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    cursor: pointer;
}

/* ==================== Totals ==================== */
.total-tax,
.total-amount {
    text-align: right;
    font-weight: 700;
    font-size: 1.1em;
}

.total-amount {
    color: var(--se-gray-900);
    border-color: var(--se-gray-900) !important;
}

/* ==================== Autocomplete ==================== */
.autocomplete-list {
    list-style-type: none;
    padding: 0;
    margin: 0;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    position: absolute;
    background-color: white;
    z-index: 1000;
    width: 95%;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    font-size: 12px;
}

.autocomplete-list li {
    padding: 10px 12px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    border-bottom: 1px solid #e9ecef;
    border-left: 3px solid transparent;
}

.autocomplete-list li:last-child {
    border-bottom: none;
}

.autocomplete-list li:nth-child(odd) {
    background-color: #f8f9fa;
}

.autocomplete-list li:nth-child(even) {
    background-color: #fff;
}

.autocomplete-list li:hover {
    background-color: #f0f4ff;
    border-left-color: var(--se-blue-600);
}

/* ==================== Edit/Delete Buttons ==================== */
.edit-button {
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100px;
    margin-right: 8px;
    background-color: var(--se-gray-900);
    color: #fff;
}

.delete-button {
    border: none;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 100px;
    margin-right: 8px;
    background-color: #6b7280;
    color: #fff;
}

.edit-button:hover {
    background-color: var(--se-gray-800);
}

.delete-button:hover {
    background-color: #4b5563;
}

/* ==================== Collapse (custom) ==================== */
.collapse {
    display: none;
    transition: all 0.3s ease;
}
.collapse.show {
    display: block;
}

/* ==================== Dialog ==================== */
dialog {
    border: none;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    padding: 20px;
    max-width: 400px;
}

dialog::backdrop {
    background-color: rgba(0, 0, 0, 0.5);
}

/* ==================== Order Cards ==================== */
.border-left-accent {
    border-left-width: 4px !important;
}

.chevron-icon {
    transition: transform 0.3s;
}

.table-detail {
    font-size: 0.8rem;
    border-collapse: collapse;
}

.table-detail thead {
    border-bottom: 2px solid var(--se-gray-800);
}

.table-detail thead th {
    background-color: transparent !important;
    color: var(--se-gray-800) !important;
    font-weight: 600;
    font-size: 0.7em;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none !important;
    padding: 6px 10px;
}

.table-detail tbody tr {
    transition: all 0.15s ease;
}

.table-detail tbody tr:hover {
    background-color: #f0f4ff !important;
}

.table-detail .sku-accent {
    color: var(--se-blue-600);
    font-weight: 600;
}

.received-qty-input {
    width: 80px;
    display: inline-block;
    text-align: center;
}

/* ==================== Login Logo & Title ==================== */
.logo-img {
    max-width: 90%;
    width: auto;
    max-height: 210px;
}

.logo-img + h1#auth_title {
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.body-login {
    height: 100vh;
}

/* ==================== Responsive ==================== */
@media (max-width: 600px) {
    .body-login {
        min-height: 100vh;
    }

    .autocomplete-list {
        border: 3px solid #dee2e6;
        width: 90%;
    }

    /* Grid headers: hide on mobile, show card-style items instead */
    .grid-container .row > .grid-header {
        display: none;
    }

    .grid-container {
        flex-direction: column;
    }

    .grid-item {
        flex-direction: column;
        align-items: stretch;
        padding: 10px 12px;
    }

    .grid-item .grid-data {
        display: flex;
        justify-content: space-between;
        text-align: right;
        padding: 3px 0;
        border-bottom: 1px solid #f0f0f0;
    }

    .grid-item .grid-data::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        color: var(--se-gray-800);
        font-size: 0.85em;
    }

    .grid-item .grid-data.hidden {
        display: none;
    }

    .grid-item .grid-data:last-of-type {
        border-bottom: none;
    }

    .edit-button,
    .delete-button {
        width: 100%;
        margin-right: 0;
        margin-top: 8px;
        margin-bottom: 0;
    }

    img.logo-img.img-fluid {
        max-height: 130px;
        width: auto;
    }

    .logo-img + h1#auth_title {
        margin-top: 0.5rem;
        margin-bottom: 1rem;
    }

    .card .card-body.p-4 {
        padding: 1rem;
    }


    .table-detail thead {
        display: none;
    }

    .table-detail tbody tr {
        display: block;
        margin-bottom: 0.75rem;
        padding: 0.5rem;
        border: 1px solid #e9ecef;
        border-radius: 6px;
    }

    .table-detail tbody td {
        display: flex;
        justify-content: space-between;
        padding: 0.25rem 0.5rem;
        border: none;
        text-align: right;
    }

    .table-detail tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        text-align: left;
        margin-right: 0.5rem;
    }
}

@media (min-width: 600px) and (max-width: 900px) {
    .autocomplete-list {
        border: 3px solid #dee2e6;
        width: 95%;
    }
}
