* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f5f5;
    min-height: 100vh;
}

.navbar {
    background: #2c3e50;
    color: white;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem 1.5rem;
}

.navbar h1 {
    font-size: 1.5rem;
}

.navbar ul {
    list-style: none;
    display: flex;
    gap: 0.75rem;
    align-items: center;
}

.navbar ul .nav-section {
    color: #8ba0b8;
    font-size: 0.7rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.25rem 0.5rem;
    margin-left: 0.75rem;
    border-left: 1px solid #4a6076;
    white-space: nowrap;
}

.navbar a {
    color: white;
    text-decoration: none;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.navbar a:hover {
    background: #34495e;
}

.navbar .nav-logout {
    background: none;
    border: none;
    color: white;
    font: inherit;
    cursor: pointer;
    padding: 0.5rem 1rem;
    border-radius: 4px;
    transition: background 0.3s;
}

.navbar .nav-logout:hover {
    background: #34495e;
}

.navbar-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    flex-direction: column;
    gap: 4px;
}

.navbar-toggle span {
    display: block;
    width: 24px;
    height: 3px;
    background: white;
    border-radius: 2px;
}

@media (max-width: 1400px) {
    .navbar-toggle {
        display: flex;
    }

    .navbar ul {
        display: none;
        flex-direction: column;
        width: 100%;
        align-items: stretch;
        gap: 0.25rem;
    }

    .navbar ul.open {
        display: flex;
    }

    .navbar ul .nav-section {
        margin: 0.5rem 0 0.25rem;
        padding: 0.25rem 0.5rem;
        border-left: none;
        border-bottom: 1px solid #4a6076;
    }
}

.container {
    max-width: 1400px;
    margin: 2rem auto;
    padding: 0 1rem;
    width: 100%;
}

.card {
    background: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    width: 100% !important;
    max-width: 100%;
}

.card h2 {
    color: #2c3e50;
    margin-bottom: 1rem;
    border-bottom: 2px solid #3498db;
    padding-bottom: 0.5rem;
}

.btn {
    padding: 0.5rem 1rem;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s;
    font-size: 1rem;
    line-height: 1.5;
    vertical-align: middle;
}

button[type="submit"].btn,
input[type="submit"].btn {
    height: auto;
    line-height: 1.5;
    vertical-align: middle;
    margin: 0;
}

.btn-primary {
    background: #3498db;
    color: white;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-success {
    background: #27ae60;
    color: white;
}

.btn-success:hover {
    background: #219a52;
}

.btn-danger {
    background: #e74c3c;
    color: white;
}

.btn-danger:hover {
    background: #c0392b;
}

.btn-warning {
    background: #f39c12;
    color: white;
}

.btn-warning:hover {
    background: #d68910;
}

.btn-info {
    background: #17a2b8;
    color: white;
}

.btn-info:hover {
    background: #138496;
}

table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
}

table th, table td {
    padding: 0.75rem;
    text-align: left;
    border-bottom: 1px solid #ddd;
}

table th {
    background: #34495e;
    color: white;
}

table tr:hover {
    background: #f8f9fa;
}

form {
    width: 100%;
    max-width: 100%;
}

.form-group {
    margin-bottom: 1rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 500;
    color: #2c3e50;
}

.form-group input, 
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #3498db;
}

.alert {
    padding: 1rem;
    border-radius: 4px;
    margin-bottom: 1rem;
}

.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.alert-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.alert-warning {
    background: #fff3cd;
    color: #856404;
    border: 1px solid #ffeeba;
}

.login-container {
    max-width: 400px;
    margin: 100px auto;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
}

.stat-card {
    background: white;
    padding: 1.5rem;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    text-align: center;
}

.stat-card h3 {
    color: #7f8c8d;
    font-size: 0.9rem;
    margin-bottom: 0.5rem;
}

.stat-card .value {
    font-size: 2rem;
    font-weight: bold;
    color: #2c3e50;
}

.detail-row {
    display: grid;
    grid-template-columns: 140px 2fr 100px 110px 70px 110px 40px;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    background: #f8f9fa;
    border-radius: 4px;
    min-width: 0;
}

.detail-row select,
.detail-row input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    min-width: 0;
    width: 100%;
}

.detail-row .insumo-nombre {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

@media (max-width: 1200px) {
    .detail-row {
        grid-template-columns: 120px 1.5fr 80px 90px 60px 90px 35px;
        gap: 0.4rem;
        font-size: 0.9rem;
    }
    .detail-row input, .detail-row select {
        padding: 0.4rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 900px) {
    .detail-row {
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
    }
    .detail-row input[type="text"]:first-child {
        grid-column: 1 / -1;
    }
    .detail-row .insumo-nombre {
        grid-column: 1 / -1;
    }
    .detail-row button {
        grid-column: 2;
        justify-self: end;
    }
}

.detail-header {
    display: grid;
    grid-template-columns: 140px 2fr 100px 110px 70px 110px 40px;
    gap: 0.5rem;
    align-items: center;
    margin-bottom: 0.5rem;
    padding: 0.5rem;
    font-weight: bold;
    color: #495057;
    font-size: 0.85rem;
}

@media (max-width: 1200px) {
    .detail-header {
        grid-template-columns: 120px 1.5fr 80px 90px 60px 90px 35px;
        font-size: 0.8rem;
    }
}

@media (max-width: 900px) {
    .detail-header {
        display: none;
    }
}

.search-bar {
    display: flex;
    gap: 1rem;
    margin-bottom: 1rem;
}

.search-bar input {
    flex: 1;
    padding: 0.75rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.report-filters {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 1.5rem;
}

.report-filters select,
.report-filters input {
    padding: 0.5rem;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.total-row {
    font-weight: bold;
    font-size: 1.1rem;
    padding: 1rem;
    background: #ecf0f1;
    border-radius: 4px;
    margin-top: 1rem;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #7f8c8d;
}

.row-negativo {
    background: #fdecea !important;
}

.row-positivo {
    background: #e8f5e9 !important;
}

.pagination-info {
    margin: 1rem 0;
    text-align: right;
    color: #7f8c8d;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.pagination-info select {
    padding: 0.4rem 0.6rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    cursor: pointer;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.3rem;
    margin-top: 1rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-block;
    min-width: 36px;
    height: 36px;
    line-height: 36px;
    text-align: center;
    padding: 0 0.5rem;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    text-decoration: none;
    color: #555;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.pagination a {
    background: #fff;
}

.pagination a:hover {
    background: #3498db;
    color: white;
    border-color: #3498db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.pagination .page-current {
    background: #2c3e50;
    color: white;
    border-color: #2c3e50;
    font-weight: 600;
}

.pagination .page-ellipsis {
    border: none;
    color: #999;
    min-width: auto;
    background: transparent;
}

.dataTables_wrapper .filters input {
    width: 100%;
    padding: 4px 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.85rem;
}

.dataTables_wrapper .filters input:focus {
    outline: none;
    border-color: #3498db;
}

#tablaInsumos thead.filters th {
    background: #f8f9fa;
    padding: 8px 4px;
}

.pagination-info-mobile {
    display: none;
}
