* {
    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;
}

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

.navbar ul {
    list-style: none;
    display: flex;
    gap: 1.5rem;
}

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

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

.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;
}

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;
}

.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;
}
