html {
  font-size: 14px;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

html {
  position: relative;
  min-height: 100%;
}

body {
  margin-bottom: 60px;
}

.form-floating > .form-control-plaintext::placeholder, .form-floating > .form-control::placeholder {
  color: var(--bs-secondary-color);
  text-align: end;
}

.form-floating > .form-control-plaintext:focus::placeholder, .form-floating > .form-control:focus::placeholder {
  text-align: start;
}
html {
    font-size: 16px;
}

.app-main-container {
    padding-left: 1rem;
    padding-right: 1rem;
}

.app-logo {
    display: block;
    width: auto;
    height: 34px;
    max-height: 34px;
    max-width: 160px;
    object-fit: contain;
}

.dashboard-logo {
    display: block;
    width: auto;
    max-height: 56px;
    flex: 0 0 auto;
}

.dashboard-hero {
    padding: 0.75rem 0 0.25rem;
}

.home-section {
    margin-bottom: 1.25rem;
}

.home-section-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 0.75rem;
}

.home-section-title {
    display: block;
    margin: 0;
    color: #172033;
    font-size: 1.1rem;
    font-weight: 800;
}

.home-section-subtitle {
    display: block;
    margin: 0.15rem 0 0;
    color: #6c757d;
    font-size: 0.9rem;
    line-height: 1.3;
}

.home-collapsible {
    padding: 0.75rem;
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-radius: 16px;
}

.home-toggle {
    margin-bottom: 0;
    padding: 0;
    color: inherit;
    text-align: left;
    background: transparent;
    border: 0;
}

.card {
    border-radius: 0.75rem;
}

.mobile-action-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 1rem;
}

.mobile-action-card {
    display: block;
    min-height: auto;
    padding: 14px 16px;
    color: #172033;
    text-decoration: none;
    background: linear-gradient(180deg, #ffffff 0%, #f7f9fc 100%);
    border: 1px solid rgba(13, 110, 253, 0.14);
    border-radius: 16px;
    box-shadow: 0 10px 24px rgba(17, 24, 39, 0.08);
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.mobile-action-card:hover,
.mobile-action-card:focus {
    color: #0d3d7a;
    text-decoration: none;
    border-color: rgba(13, 110, 253, 0.35);
    box-shadow: 0 14px 28px rgba(17, 24, 39, 0.12);
    transform: translateY(-1px);
}

.mobile-action-header {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mobile-action-icon {
    font-size: 1.35rem;
    line-height: 1;
}

.mobile-action-title {
    font-weight: 700;
    font-size: 1rem;
}

.mobile-action-text {
    margin-top: 4px;
    color: #5f6b7a;
    font-size: 0.875rem;
    line-height: 1.35;
}

.touch-button {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 12px;
    padding: 0.65rem 1rem;
}

.action-card .card-body,
.summary-card .card-body {
    padding: 1.25rem;
}

.action-card .btn {
    min-height: 3rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

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

.table-actions {
    display: flex;
    flex-wrap: nowrap;
    gap: 0.35rem;
    align-items: center;
}

.table-actions .btn {
    min-width: 2.25rem;
    min-height: 2.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.35rem 0.55rem;
}

.mobile-list {
    display: grid;
    gap: 12px;
}

.mobile-list-card {
    padding: 14px;
    background: #ffffff;
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 20px rgba(17, 24, 39, 0.07);
}

.mobile-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
}

.mobile-card-title {
    color: #172033;
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
}

.mobile-card-meta {
    color: #6c757d;
    font-size: 0.875rem;
    line-height: 1.35;
}

.mobile-card-amount {
    flex: 0 0 auto;
    font-weight: 700;
    text-align: right;
    white-space: nowrap;
}

.mobile-card-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.35rem;
    margin-top: 0.65rem;
}

.mobile-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.75rem;
}

.mobile-card-actions .btn,
.mobile-list-card .btn {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    padding: 0.4rem 0.65rem;
}

.login-page {
    min-height: calc(100vh - 40px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 12px;
    background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
}

.login-card {
    width: 100%;
    max-width: 420px;
    background: #fff;
    border-radius: 20px;
    padding: 28px 24px;
    box-shadow: 0 12px 35px rgba(15, 23, 42, 0.12);
    border: 1px solid rgba(15, 23, 42, 0.06);
}

.login-logo {
    display: block;
    max-width: 170px;
    max-height: 80px;
    object-fit: contain;
    margin: 0 auto 18px auto;
}

.login-title {
    font-size: 1.8rem;
    font-weight: 800;
    text-align: center;
    margin-bottom: 4px;
}

.login-subtitle {
    text-align: center;
    color: #6c757d;
    margin-bottom: 24px;
}

.login-card .form-control {
    min-height: 48px;
    border-radius: 12px;
}

.login-card .btn {
    min-height: 48px;
    border-radius: 12px;
    font-weight: 700;
}

@media (max-width: 575.98px) {
    body {
        background-color: #f8f9fa;
    }

    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .app-logo {
        height: 32px;
        max-height: 32px;
        max-width: 130px;
    }

    .dashboard-logo {
        max-height: 48px;
    }

    .navbar-nav .nav-link {
        padding-top: 0.85rem;
        padding-bottom: 0.85rem;
    }

    .action-card .card-body {
        padding: 1rem;
    }

    .auth-main-container {
        min-height: 100vh;
        display: flex;
        align-items: center;
        justify-content: center;
        padding-top: 2rem;
        padding-bottom: 2rem;
    }

    .auth-main-container main {
        width: 100%;
        max-width: 420px;
    }

    .table-responsive {
        overflow-x: visible;
    }

    .table-responsive table,
    table.table {
        display: block;
        width: 100%;
        min-width: 0;
    }

    .table-responsive thead,
    table.table thead {
        display: none;
    }

    .table-responsive tbody,
    table.table tbody {
        display: grid;
        gap: 12px;
    }

    .table-responsive tr,
    table.table tr {
        display: block;
        padding: 12px 14px;
        background: #ffffff;
        border: 1px solid rgba(17, 24, 39, 0.1);
        border-radius: 16px;
        box-shadow: 0 8px 20px rgba(17, 24, 39, 0.07);
    }

    .table-responsive td,
    table.table td {
        display: block;
        width: 100%;
        padding: 0.25rem 0;
        border: 0;
        white-space: normal;
    }

    .table-responsive td:last-child,
    table.table td:last-child {
        padding-top: 0.75rem;
    }

    .table-responsive .btn,
    table.table .btn {
        min-height: 40px;
        border-radius: 10px;
        padding: 0.4rem 0.65rem;
    }

    .table-actions,
    .table-responsive form,
    table.table form {
        display: flex;
        flex-wrap: wrap;
        gap: 0.45rem;
    }

    .login-card {
        padding: 24px 18px;
        border-radius: 18px;
    }

    .login-logo {
        max-width: 150px;
    }
}

@media (min-width: 768px) {
    .mobile-action-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1200px) {
    .mobile-action-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.dashboard-page {
    display: grid;
    gap: 1rem;
}

.dashboard-heading,
.dashboard-section-title {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.dashboard-heading .btn,
.dashboard-section-title a,
.dashboard-quick-links .btn {
    min-height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.dashboard-summary-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

.dashboard-summary-card,
.dashboard-section {
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.dashboard-summary-card {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem;
}

.dashboard-summary-card span,
.dashboard-summary-card small,
.dashboard-note,
.dashboard-empty,
.dashboard-list-card span,
.dashboard-action p {
    color: #667085;
}

.dashboard-summary-card strong {
    color: #172033;
    font-size: 1.45rem;
    line-height: 1.15;
}

.dashboard-summary-card small,
.dashboard-note {
    font-size: 0.8rem;
}

.dashboard-section {
    padding: 0.9rem;
}

.dashboard-section-title {
    margin-bottom: 0.75rem;
}

.dashboard-section-title h2 {
    margin: 0;
    color: #172033;
    font-size: 1rem;
    font-weight: 800;
}

.dashboard-action-list,
.dashboard-mobile-cards,
.dashboard-quick-links {
    display: grid;
    gap: 0.75rem;
}

.dashboard-action,
.dashboard-list-card {
    display: grid;
    gap: 0.45rem;
    padding: 0.8rem;
    background: #fbfcfe;
    border: 1px solid rgba(17, 24, 39, 0.08);
    border-left: 4px solid #6c757d;
    border-radius: 8px;
}

.dashboard-action p {
    margin: 0.2rem 0 0;
}

.dashboard-level-advertencia {
    border-left-color: #d97706;
}

.dashboard-level-critico {
    border-left-color: #dc3545;
}

.dashboard-card-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

.dashboard-card-actions .btn {
    min-height: 38px;
}

.dashboard-table-wrap {
    display: none;
}

.dashboard-table {
    margin-bottom: 0;
}

.dashboard-two-columns {
    display: grid;
    gap: 1rem;
}

.dashboard-quick-links {
    grid-template-columns: 1fr;
}

@media (min-width: 576px) {
    .dashboard-heading,
    .dashboard-section-title {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

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

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

@media (min-width: 992px) {
    .dashboard-summary-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }

    .dashboard-mobile-cards:not(.always) {
        display: none;
    }

    .dashboard-table-wrap {
        display: block;
        overflow-x: auto;
    }

    .dashboard-table-wrap.show-mobile {
        display: block;
    }

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

    .dashboard-quick-links {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

.stock-summary-page {
    display: grid;
    gap: 1rem;
}

.stock-summary-header,
.stock-summary-filters {
    display: grid;
    gap: 0.75rem;
}

.stock-summary-actions,
.stock-product-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 0.45rem;
}

.stock-summary-actions .btn,
.stock-product-actions .btn {
    min-height: 40px;
}

.stock-summary-filters {
    padding: 0.9rem;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 8px;
}

.stock-summary-check {
    align-self: end;
    min-height: 40px;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.stock-product-grid {
    display: grid;
    gap: 0.85rem;
}

.stock-product-card {
    display: grid;
    gap: 0.8rem;
    padding: 0.9rem;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.1);
    border-radius: 8px;
    box-shadow: 0 8px 18px rgba(17, 24, 39, 0.06);
}

.stock-product-empty {
    opacity: 0.68;
}

.stock-product-main,
.stock-product-numbers,
.stock-detail-row {
    display: flex;
    justify-content: space-between;
    gap: 0.75rem;
}

.stock-product-main {
    align-items: flex-start;
}

.stock-product-name {
    color: #172033;
    font-weight: 800;
    line-height: 1.25;
}

.stock-product-type,
.stock-product-numbers span,
.stock-detail-row span,
.stock-threshold-note,
.stock-empty-message {
    color: #667085;
}

.stock-threshold-note {
    font-size: 0.9rem;
}

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

.stock-product-numbers strong {
    display: block;
    color: #172033;
    font-size: 1.15rem;
}

.stock-status {
    flex: 0 0 auto;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 700;
}

.stock-status-ok {
    color: #0f5132;
    background: #d1e7dd;
}

.stock-status-advertencia {
    color: #664d03;
    background: #fff3cd;
}

.stock-status-critico {
    color: #842029;
    background: #f8d7da;
}

.stock-product-detail {
    border-top: 1px solid rgba(17, 24, 39, 0.08);
    padding-top: 0.5rem;
}

.stock-detail-row {
    padding: 0.55rem 0;
    border-bottom: 1px solid rgba(17, 24, 39, 0.06);
}

.stock-detail-row:last-child {
    border-bottom: 0;
}

.stock-detail-row > div {
    display: grid;
    gap: 0.1rem;
}

.stock-detail-row > div:last-child {
    text-align: right;
}

.stock-detail-empty {
    opacity: 0.6;
}

@media (min-width: 768px) {
    .stock-summary-header,
    .stock-summary-filters {
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: end;
    }

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

@media (min-width: 1200px) {
    .stock-product-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}
