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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #f5f7fa;
    color: #333;
    line-height: 1.5;
}

.login-body {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    background: linear-gradient(135deg, #0f2027, #203a43, #2c5364);
}

.login-box {
    background: #fff;
    padding: 2.5rem;
    border-radius: 12px;
    width: 100%;
    max-width: 380px;
    box-shadow: 0 20px 40px rgba(0,0,0,0.25);
    text-align: center;
}

.login-box h1 { margin-bottom: 1.5rem; font-size: 1.6rem; color: #1a202c; }

.login-box input,
.login-box button {
    width: 100%;
    padding: 0.75rem;
    margin-bottom: 0.75rem;
    border-radius: 8px;
    border: 1px solid #ccc;
    font-size: 1rem;
}

.login-box button {
    background: #2c7a7b;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
    transition: background 0.2s;
}

.login-box button:hover { background: #285e61; }

.error { color: #e53e3e; margin-bottom: 0.75rem; font-size: 0.9rem; }

.topbar {
    background: #1a202c;
    color: #fff;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
}

.topbar h1 { font-size: 1.4rem; font-weight: 700; }

.topbar a {
    color: #fff;
    text-decoration: none;
    margin-left: 1rem;
    font-size: 0.9rem;
}

.topbar a:hover { text-decoration: underline; }

.container {
    padding: 1.5rem;
    max-width: 1600px;
    margin: 0 auto;
}

.grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
    align-items: start;
}

@media (max-width: 992px) {
    .grid { grid-template-columns: 1fr; }
}

.card {
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.card-header {
    padding: 1rem 1.25rem;
    font-size: 1.25rem;
    font-weight: 700;
    text-align: center;
    color: #1a202c;
    letter-spacing: 0.5px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.productos .card-header { background: #8bc34a; color: #fff; }
.entradas .card-header { background: #1abc9c; color: #fff; }
.salidas .card-header { background: #ff7043; color: #fff; }

.card-body { padding: 1rem; overflow-x: auto; }

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.85rem;
}

thead tr { background: #edf2f7; }

th, td {
    padding: 0.55rem 0.4rem;
    text-align: center;
    border-bottom: 1px solid #e2e8f0;
    white-space: nowrap;
}

th { font-weight: 600; color: #2d3748; }

tr:hover { background: #f7fafc; }

.alert { background: #fed7d7; color: #c53030; font-weight: 600; }

.alert td { color: #c53030; }

form.mini-form {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 1rem;
    border-bottom: 1px solid #edf2f7;
}

form.mini-form.full-width { grid-template-columns: 1fr; }

form.mini-form input,
form.mini-form select,
form.mini-form button {
    padding: 0.5rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.85rem;
}

form.mini-form button {
    background: #2c7a7b;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

form.mini-form button:hover { background: #285e61; }

.productos form.mini-form button { background: #689f38; }
.entradas form.mini-form button { background: #16a085; }
.salidas form.mini-form button { background: #f4511e; }

.message {
    background: #c6f6d5;
    color: #22543d;
    padding: 0.75rem 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.message.error {
    background: #fed7d7;
    color: #c53030;
}

.filters {
    background: #fff;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 4px 15px rgba(0,0,0,0.08);
}

.filters form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}

.filters input,
.filters select,
.filters button {
    padding: 0.55rem;
    border: 1px solid #cbd5e0;
    border-radius: 6px;
    font-size: 0.9rem;
}

.filters button {
    background: #2c7a7b;
    color: #fff;
    border: none;
    cursor: pointer;
    font-weight: 600;
}

.report-table th { background: #edf2f7; }

footer {
    text-align: center;
    padding: 1.5rem;
    color: #718096;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .topbar { flex-direction: column; text-align: center; }
    .topbar nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.5rem; }
    .topbar a { margin: 0; }
    .topbar h1 { font-size: 1.2rem; }
    .container { padding: 0.75rem; }
    .card-header { font-size: 1.05rem; }
    .card-body { padding: 0.5rem; }
    th, td { padding: 0.35rem 0.25rem; font-size: 0.78rem; }
    form.mini-form input,
    form.mini-form select,
    form.mini-form button { width: 100%; }
    .filters form { flex-direction: column; }
    .filters input,
    .filters select,
    .filters button { width: 100%; }
    .login-box { padding: 1.5rem; margin: 1rem; }
    .login-box h1 { font-size: 1.3rem; }
}
