:root {
    --verde: #007a35;
    --verde-oscuro: #005c28;
    --rojo: #ef1c1c;
    --fondo: #f4f7f6;
    --texto: #1f2937;
    --borde: #d7dee2;
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    background: var(--fondo);
    color: var(--texto);
}

.login-body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    background: #fff;
}

.login-card {
    width: 520px;
    max-width: 92%;
    background: white;
    border: 1px solid var(--borde);
    border-radius: 24px;
    padding: 42px;
    box-shadow: 0 18px 45px rgba(0,0,0,.08);
}

.login-card img { width: 100%; margin-bottom: 22px; }
.login-card h1 { color: var(--verde); font-size: 32px; }

label {
    display: block;
    margin: 14px 0 6px;
    font-weight: 700;
}

input, select {
    width: 100%;
    padding: 13px 14px;
    border: 1px solid var(--borde);
    border-radius: 10px;
    font-size: 15px;
}

button, .btn {
    display: inline-block;
    border: 0;
    background: var(--verde);
    color: white;
    padding: 12px 18px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 700;
    cursor: pointer;
}

.btn:hover, button:hover { background: var(--verde-oscuro); }
.btn.secondary { background: #64748b; }
.btn.disabled { background: #94a3b8; pointer-events: none; }

.alert-error {
    padding: 14px;
    background: #fde2e2;
    color: #a40000;
    border-radius: 12px;
    margin-bottom: 18px;
}

.wrapper { display: flex; min-height: 100vh; }

.sidebar {
    width: 260px;
    background: #062b18;
    color: white;
    padding: 20px;
}

.brand {
    background: white;
    border-radius: 14px;
    padding: 12px;
    margin-bottom: 24px;
}

.brand img { width: 100%; }

.menu a {
    display: block;
    color: white;
    text-decoration: none;
    padding: 13px 14px;
    border-radius: 10px;
    margin-bottom: 6px;
}

.menu a:hover { background: rgba(255,255,255,.14); }

.main { flex: 1; }

.topbar {
    height: 64px;
    background: white;
    border-bottom: 1px solid var(--borde);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 26px;
}

.content { padding: 26px; }

.cards {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.card, .table-card, .form-card {
    background: white;
    border: 1px solid var(--borde);
    border-radius: 16px;
    padding: 20px;
}

.page-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 18px;
}

.search-box {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
}

.search-box input { max-width: 520px; }

table {
    width: 100%;
    border-collapse: collapse;
    background: white;
}

th, td {
    padding: 12px;
    border-bottom: 1px solid var(--borde);
    text-align: left;
    font-size: 14px;
}

th { background: #eef3f1; }

a { color: var(--verde); font-weight: 700; }
a.danger { color: var(--rojo); }

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 18px;
}

.form-grid .full { grid-column: 1 / -1; }

.form-actions {
    margin-top: 22px;
    display: flex;
    gap: 10px;
}

@media (max-width: 850px) {
    .wrapper { display: block; }
    .sidebar { width: 100%; }
    .cards, .form-grid { grid-template-columns: 1fr; }
}
