* { box-sizing: border-box; }
body {
    margin: 0;
    font-family: -apple-system, "Segoe UI", Arial, sans-serif;
    background: #f4f5f7;
    color: #1f2430;
}
.container { max-width: 1100px; margin: 0 auto; padding: 24px; }

.topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #003366;
    color: #fff;
    padding: 14px 24px;
}
.topbar-brand { font-weight: 700; font-size: 18px; }
.topbar-nav a { color: #fff; text-decoration: none; margin-right: 20px; opacity: 0.9; }
.topbar-nav a:hover { opacity: 1; text-decoration: underline; }
.topbar-user { font-size: 13px; display: flex; gap: 12px; align-items: center; }
.topbar-user a { color: #FFCC00; text-decoration: none; }

.page-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.page-head h1 { font-size: 20px; margin: 0; }

.text-muted { color: #6b7280; font-size: 12px; }

.metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 12px; margin-bottom: 20px; }
.metric-card { background: #fff; border-radius: 8px; padding: 16px; border: 1px solid #e2e4e9; }
.metric-label { font-size: 12px; color: #6b7280; margin: 0 0 4px; }
.metric-value { font-size: 24px; font-weight: 600; margin: 0; }

table.tabla { width: 100%; border-collapse: collapse; background: #fff; border-radius: 8px; overflow: hidden; }
table.tabla th, table.tabla td { padding: 10px 12px; border-bottom: 1px solid #eceef1; text-align: left; font-size: 13px; }
table.tabla th { background: #fafafa; color: #6b7280; font-weight: 600; }

.badge { padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-borrador { background: #eceef1; color: #4b5563; }
.badge-enviada { background: #dbeafe; color: #1d4ed8; }
.badge-aprobada { background: #dcfce7; color: #15803d; }
.badge-rechazada { background: #fee2e2; color: #b91c1c; }
.badge-anulada { background: #f3f4f6; color: #9ca3af; }

.btn { display: inline-block; padding: 8px 16px; border-radius: 6px; border: 1px solid #d1d5db; background: #fff; color: #1f2430; text-decoration: none; font-size: 13px; cursor: pointer; }
.btn-primary { background: #003366; border-color: #003366; color: #fff; }
.btn-link-danger { background: none; border: none; color: #b91c1c; cursor: pointer; text-decoration: underline; padding: 0; font-size: 13px; }

.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 14px; background: #fff; padding: 16px; border-radius: 8px; border: 1px solid #e2e4e9; }
.form-grid label { display: block; font-size: 12px; color: #6b7280; margin-bottom: 4px; }

label { font-size: 13px; color: #374151; }
input, select, textarea, button {
    font-family: inherit; font-size: 13px; padding: 8px 10px;
    border: 1px solid #d1d5db; border-radius: 6px; background: #fff;
}
button { cursor: pointer; }
button:hover { background: #f4f5f7; }

.inline-form { display: flex; gap: 8px; align-items: center; }

.resumen-box { max-width: 320px; margin-left: auto; margin-top: 20px; background: #fff; border-radius: 8px; padding: 16px; border: 1px solid #e2e4e9; }
.resumen-fila { display: flex; justify-content: space-between; padding: 4px 0; font-size: 13px; }
.resumen-total { border-top: 1px solid #e2e4e9; margin-top: 6px; padding-top: 10px; font-weight: 700; font-size: 15px; }

.alert-info { background: #dbeafe; color: #1d4ed8; padding: 10px 14px; border-radius: 6px; font-size: 13px; }
.alert-error { background: #fee2e2; color: #b91c1c; padding: 10px 14px; border-radius: 6px; font-size: 13px; }

.login-body { display: flex; align-items: center; justify-content: center; height: 100vh; background: #003366; }
.login-card { background: #fff; padding: 32px; border-radius: 10px; width: 320px; display: flex; flex-direction: column; gap: 10px; }
.login-card h1 { font-size: 18px; text-align: center; margin-bottom: 10px; color: #003366; }
.login-card button { background: #FFCC00; border: none; font-weight: 700; margin-top: 8px; }
