/* ===== Reset básico ===== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    height: 100%;
}

body {
    font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    font-size: 14px;
    background: radial-gradient(circle at top, #f0f4ff 0, #e9ecef 45%, #dee2e6 100%);
    color: #1f2933;
    line-height: 1.4;
}

/* ===== Layout general ===== */
.app-wrapper {
    max-width: 1100px;
    margin: 24px auto 32px auto;
    padding: 16px;
}

/* ===== Header principal ===== */
.app-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    margin-bottom: 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #0d6efd, #2563eb);
    box-shadow: 0 10px 25px rgba(15, 23, 42, 0.25);
    color: #ffffff;
}

.app-header h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 4px;
}

.app-subtitle {
    font-size: 13px;
    opacity: 0.9;
}

/* ===== Tarjetas y contenedores ===== */
.card,
.login-card,
.form-card {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 16px 18px;
    margin-bottom: 16px;
    border: 1px solid #e1e7ef;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.login-page {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    background: radial-gradient(circle at top, #e0ebff 0, #dee2e6 50%, #ced4da 100%);
}

/* ===== Formularios ===== */
label {
    display: inline-block;
    font-weight: 500;
    margin-bottom: 4px;
    font-size: 13px;
}

input[type="text"],
input[type="number"],
input[type="password"],
input[type="email"],
input[type="datetime-local"],
input[type="date"],
select,
textarea {
    width: 100%;
    padding: 7px 8px;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    font-size: 14px;
    outline: none;
    background-color: #ffffff;
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background-color 0.16s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
    background-color: #f8fafc;
}

textarea {
    min-height: 70px;
    resize: vertical;
}

button {
    font-family: inherit;
}

/* ===== Botones ===== */
.btn {
    display: inline-block;
    padding: 7px 14px;
    border-radius: 999px;
    border: none;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    text-align: center;
    transition: transform 0.12s ease, box-shadow 0.12s ease, background-color 0.15s ease, color 0.15s ease;
    border: 1px solid transparent;
}

.btn-primary {
    background: linear-gradient(135deg, #0d6efd, #1d4ed8);
    color: #ffffff;
    box-shadow: 0 4px 10px rgba(37, 99, 235, 0.3);
}

.btn-primary:hover {
    background: linear-gradient(135deg, #1d4ed8, #1d4ed8);
    transform: translateY(-1px);
    box-shadow: 0 6px 15px rgba(37, 99, 235, 0.4);
}

.btn-secondary {
    background-color: #e2e8f0;
    color: #111827;
    border-color: #cbd5e1;
}

.btn-secondary:hover {
    background-color: #cbd5e1;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(148, 163, 184, 0.4);
}

/* ===== Alertas ===== */
.alert {
    padding: 8px 10px;
    border-radius: 8px;
    margin-bottom: 10px;
    font-size: 13px;
}

.alert-info {
    background-color: #e0f2fe;
    color: #075985;
}

.alert-success {
    background-color: #dcfce7;
    color: #166534;
}

.alert-error {
    background-color: #fee2e2;
    color: #b91c1c;
}

/* ===== Badges ===== */
.badge {
    display: inline-block;
    padding: 2px 6px;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 600;
}

.badge-secondary {
    background-color: #e5e7eb;
    color: #374151;
}

.badge-warning {
    background-color: #fef3c7;
    color: #92400e;
}

.badge-success {
    background-color: #dcfce7;
    color: #166534;
}

/* ===== Tablas ===== */
table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 16px;
    background-color: #ffffff;
}

th, td {
    border: 1px solid #e5e7eb;
    padding: 6px 8px;
    text-align: left;
    vertical-align: middle;
    font-size: 13px;
}

th {
    background: linear-gradient(135deg, #f3f4f6, #e5e7eb);
    font-weight: 600;
    color: #111827;
}

tr:nth-child(even) td {
    background-color: #f9fafb;
}

tr:hover td {
    background-color: #eff6ff;
}

/* ===== Filtros layout ===== */
.form-filtros {
    margin-bottom: 8px;
}

.filtros-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px 16px;
}

/* ===== Mobile cards (listas) ===== */
.mobile-card-list {
    list-style: none;
    margin-top: 8px;
}

.mobile-card {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 10px;
    margin-bottom: 8px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 2px 6px rgba(15, 23, 42, 0.08);
}

.mobile-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 4px;
}

.mobile-card-title {
    font-weight: 600;
    font-size: 14px;
}

.mobile-card-subtitle {
    font-size: 11px;
    color: #6b7280;
}

.mobile-card-body {
    font-size: 13px;
    color: #374151;
}

/* ===== Desktop vs mobile ===== */
.desktop-only {
    display: block;
}

.mobile-only {
    display: none;
}

/* ===== Extras para vistas clave (conteo, rutas, etc.) ===== */
.conteo-panel {
    background-color: #ffffff;
    border-radius: 12px;
    padding: 14px 16px;
    border: 1px solid #e1e7ef;
    box-shadow: 0 3px 10px rgba(15, 23, 42, 0.08);
}

.conteo-panel h3 {
    font-size: 18px;
    margin-bottom: 4px;
}

.conteo-meta {
    font-size: 13px;
    color: #4b5563;
    margin-bottom: 6px;
}

.conteo-input-cantidad {
    font-size: 18px;
    font-weight: 600;
}

/* Grid simple para formularios de dos col / tres col si quieres reusar */
.form-grid-2 {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px 16px;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
    .app-wrapper {
        margin: 12px auto 18px auto;
        padding: 10px;
    }

    .app-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
        padding: 12px 13px;
    }

    .filtros-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 640px) {
    .app-wrapper {
        margin: 4px auto 12px auto;
        padding: 8px;
    }

    .app-header h2 {
        font-size: 18px;
    }

    .app-subtitle {
        font-size: 12px;
    }

    .filtros-grid {
        grid-template-columns: 1fr;
    }

    .desktop-only {
        display: none;
    }

    .mobile-only {
        display: block;
    }

    .btn {
        padding: 6px 10px;
        font-size: 12px;
    }
}
