.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 8px 14px;
    border-radius: var(--radius-md);

    font-size: 14px;
    font-weight: 600;

    text-decoration: none;
    border: 1px solid transparent;
    cursor: pointer;

    transition: all 0.2s ease;

    white-space: nowrap;
    min-height: 36px;
}

/* =========================
   BOTONES (MEJOR CONTRASTE)
========================= */

.btn--primary {
    background: var(--color-primary);
    color: #ffffff;
    box-shadow: var(--shadow-sm);
}

.btn--primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn--secondary {
    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.btn--secondary:hover {
    background: var(--color-border);
}

.btn--danger {
    background: var(--color-danger);
    color: #ffffff;
}

.btn--danger:hover {
    opacity: 0.9;
}

.btn--success {
    background: var(--color-success);
    color: #ffffff;
}

.btn--success:hover {
    opacity: 0.9;
}

.btn--warning {
    background: var(--color-warning);
    color: #ffffff;
}

.btn--warning:hover {
    opacity: 0.9;
}

/* =========================
   SMALL BUTTONS
========================= */

.btn--small {
    padding: 6px 10px;
    font-size: 12px;
}

/* =========================
   ACTIONS
========================= */

.actions {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-start;
}

/* =========================
   CARDS
========================= */

.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 16px;
}

/* =========================
   ALERTAS
========================= */

.alert {
    padding: 14px;
    border-radius: var(--radius-md);
    border: 1px solid var(--color-border);
    background: var(--color-surface);
    color: var(--color-text);
}

.alert--success {
    border-left: 4px solid var(--color-success);
}

.alert--danger {
    border-left: 4px solid var(--color-danger);
}

.alert--warning {
    border-left: 4px solid var(--color-warning);
}

/* =========================
   BADGES
========================= */

.badge {
    display: inline-block;
    padding: 3px 10px;
    border-radius: 999px;
    font-size: 12px;

    background: var(--color-surface);
    color: var(--color-text);
    border: 1px solid var(--color-border);
}


/* =========================
   DASHBOARD
========================= */

.dashboard {
    display: flex;
    flex-direction: column;
    gap: 30px;
}

.dashboard-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
}

.dashboard-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    padding: 20px;

    box-shadow: var(--shadow-sm);

    transition: all 0.2s ease;
}

.dashboard-card:hover {
    transform: translateY(-3px);
}

.dashboard-card.link {
    text-decoration: none;
    color: var(--color-text);
}

.dashboard-icon {
    font-size: 32px;
    margin-bottom: 12px;
}

.dashboard-number {
    font-size: 22px;
    font-weight: 700;
}

.dashboard-label {
    margin-top: 6px;
    opacity: 0.7;
    font-size: 14px;
}

.dashboard-section h2 {
    margin-bottom: 16px;
}

/* =========================
   MÉTRICAS
========================= */

.metrics-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 20px;
}

.metric-card {
    display: flex;
    justify-content: space-between;
    align-items: center;

    padding: 18px;

    border-radius: var(--radius-md);

    background: var(--color-surface);
    border: 1px solid var(--color-border);

    box-shadow: var(--shadow-sm);
}

.metric-card span {
    font-size: 28px;
}

.metric-card.warning {
    border-left: 4px solid var(--color-warning);
}

.metric-card.info {
    border-left: 4px solid var(--color-primary);
}

.metric-card.success {
    border-left: 4px solid var(--color-success);
}


.filters-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 16px;
}

.filters-bar input {
    flex: 1;
    min-width: 220px;
}

.filters-bar select {
    width: 220px;
}

#modalPDF {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.5);
    box-sizing: border-box;
}

.modal-pdf-contenido {
    background: white;
    padding: 25px;
    border-radius: 10px;
    width: 90%;
    max-width: 450px;
    box-sizing: border-box;
}

.modal-pdf-contenido h3 {
    margin-top: 0;
    margin-bottom: 20px;
    text-align: center;
}

.modal-pdf-contenido label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 25px;
}

.modal-pdf-acciones {
    display: flex;
    justify-content: center;
    gap: 10px;
}

@media (max-width:768px){

    .toolbar .actions{
        flex-direction:column;
    }

    .toolbar .actions .btn{
        width:100%;
    }

    .filters-bar{
        flex-direction:column;
    }

    .filters-bar input,
    .filters-bar select{
        width:100%;
        min-width:0;
    }

}

@media (max-width:768px){

    .filters-bar{
        flex-direction:column;
    }

    .filters-bar input,
    .filters-bar select{
        width:100%;
        min-width:0;
    }

}

/* =========================
   ACCIONES PRODUCTOS
========================= */

.page-header .actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.page-header .actions #searchInput {
    flex: 1;
    min-width: 250px;
}

.page-header .actions #stockFilter {
    width: 180px;
}

@media (max-width:768px){

    .page-header .actions #searchInput,
    .page-header .actions #stockFilter{
        width:100%;
        min-width:0;
    }

}
/* =========================
   RESPONSIVE
========================= */

@media (max-width: 768px) {

    .navbar-menu {
        justify-content: center;
    }

    .page-header {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .actions {
        display: flex;
        flex-direction: column;
        gap: 10px;
        width: 100%;
    }

    .actions .btn {
        width: 100%;
    }

    .toolbar .actions {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .toolbar .actions .btn {
        flex: 1;
        min-width: 120px;
    }
}